I'm trying to understand why my buffer overflow will not work. I've been strugling with this for a few days now, so thought it was about time to ask professionals. I've only recent began to understand the concept of buffer overflow attacks with a NOP sled.
This is for a challange. No spoilers please, but helpfull pointers will be greatly appreciated.
My problem is this:
I am able to run a Perl command like this NOP ... Shellcode ... *mempntr
this works like expected when I give it an arbritary pointer.
- Where the blue stuff are my NOP's
- The Red is my shellcode
- The highlighted yellow is my
mempntr
Program received signal SIGSEGV, Segmentation fault.
0xaaaaaaaa in ?? ()
That is also as expected.
Try with correct mempntr
Now when I try to change the mempntr
to something I want to point it at, like halfway through the NOP sled, for instance the location 0xffffd580
things behave weirdly.
At the breakpoint at leave
I verify the saved eip
(gdb) i f
Stack level 0, frame at 0xffffd5c0:
eip = 0x80484b1 in main; saved eip = 0xffffd580
Arglist at 0xffffd5b8, args:
Locals at 0xffffd5b8, Previous frame's sp is 0xffffd5c0
Saved registers:
ebp at 0xffffd5b8, eip at 0xffffd5bc
Yet when I c
or continue
I have a SEGFUALT at a weird location.
Program received signal SIGSEGV, Segmentation fault.
0xffffd5a7 in ?? ()
I'm looking for an answer that could shed some light on this, or point me to a resource where I can learn what is happening.