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?
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.
Sign up to join this communityI'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?
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.