I've found this interesting question Is this integer overflow vulnerability exploitable?.

How can I practically find the next instruction (in gdb) so that I can overwrite the return address and execute a shell code?

1 Answer 1


There is no clear and cut answer to this from my understanding, because different compilers and operating systems may or may not defend against such attacks in a variety of ways. Some examples are stack cookies and DEP, but that's probably only scratching the surface. Volumes have been written on such defense mechanisms and techniques to defeat such defense mechanisms.

To summarize, you will need to thoroughly understand the OS and the runtime environment to successfully mount an attack that takes advantage of this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .