In other words, no :) Here's self-exploiting code to discover its own return address offset and exploit itself. It'll lend some insight into how this stuff works. Just a toy. Arjan van de Ven wrote: > On Thu, 2005-01-27 at 14:19 -0500, linux-os wrote: > >>Gentlemen, >> >>Isn't the return address on the stack an offset in the >>code (.text) segment? >> >>How would a random stack-pointer value help? I think you would >>need to start a program at a random offset, not the stack! >>No stack-smasher that worked would care about the value of >>the stack-pointer. > > > the simple stack exploit works by overflowing a buffer ON THE STACK with > a "dirty payload and then also overwriting the return address to point > back into that buffer. > > (all the security guys on this list will now cringe about this over > simplification; yes reality is more complex but lets keep the > explenation simple for Richard) > > pointing back into that buffer needs the address of that buffer. That > buffer is on the stack, which is now randomized. > > > -- All content of all messages exchanged herein are left in the Public Domain, unless otherwise explicitly stated.