Return to ROP

Binary Exploitation/Pwn

Given an ELF file and also the OS to run the program, that means we don't have to go through the steps to leak libc. if we run the file:

we see the program prints two addresses. Then we proceed to decompile the program:

main:

write_to_memory:

vulnerable_function:

from here, we get that the addresses that the program leaked was the main address and .bss. We also got a BOF(Buffer Overflow) vuln in vulnerable_function.

so the exploit flow is like this: get leaked main and .bss address from the program -> write "/bin/sh" to .bss -> ROP chain to leak puts in libc -> calculate libc_base using the leaked puts address -> call system('/bin/sh').

solver.py:

If we run it, we get the flag:

Flag: RTRTNI25{Chaining_Gadgets_For_Ultimate_Power}

Last updated