I'm trying to solve the narnia2 challenge on overthewire.
I read a guide for help and managed to overwrite the stack with A's using some python
$(python -c "print 'A'*132 + '\xef\xbe\xad\xde'")
and that works fine. I get a seg fault, and can use gdb to see eip has been overwritten with 0xdeadbeef - great so now I assumed the stack size is 132 bytes and then the next 4 overwrite eip to redirect the return.
( a lot of guides say to use 144 here - but I'm assuming the challenge changed? )
I used pwntools to generate me shellcode for a shell ( the same way I solves the previous challenge ) - and got
This payload worked on the previous challenge, but now when I go through the process of sticking this shellcode in my payload it never works. Replacing this with a shellcode from a guide works fine
It looks the same but with some extra stuff at the start. Why is this and how is it produced?