Binary Exploitation (Pwn)
This section will talk about CTF writeup.
ROP Emporium
To download all challenge:
https://ropemporium.com/binary/rop_emporium_all_challenges.zip
Ret2win
When we run the program and enter a bunch of a . It was segmentation fault
┌─[sheinn101@parrot]─[~/ctf/rop_emporium/ret2win]
└──╼ [??]$ ./ret2win32
ret2win by ROP Emporium
x86
For my first trick, I will attempt to fit 56 bytes of user input into 32 bytes of stack buffer!
What could possibly go wrong?
You there, may I have your input please? And don't worry about null bytes, we're using read()!
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Thank you!
Segmentation fault info functions
Disassemble ret2win
It has system function which is /bin/cat flag.txt
Generate pattern with cyclic , run the program and paste it.

To know the offset , run cyclic -l laaa .
Now we know the offset is 44 ,So the payload will be like this. A*44 + ret2win address which is cat flag.txt
Check the address of ret2win function
Change it that address to little endian like this \x2c\x86\x04\x08
Script with pwntools
Comming Soon...
Last updated