The Troll Zone

Upsolve

ROP ROP all the way

Challenge Statement
file-archive
950KB
archive
chall.zip
Content of chall.zip
Checksec of vuln

Below is some interaction with the binary.

The look when running vuln

On decompiling the binary, notice that there is a format string vulnerability in the troll function() and stack buffer overflow vulnerability in the main() function.

main() function
troll() function

The only thing we need now is an infoleak of libc, as, there is no interesting ROP gadget in the binary itself. It seems that we can use the format string vulnerablility to leak something? When I'm looking at the stack state when the format string vulnerable printf is called, I found an address that seems to be related to / located in the libc executable area. Fortunately, this address can be leaked by the format string vulnerability. Now, we have everything needed to invoke ret2system.

Running the exploit

FLAG: KashiCTF{did_some_trolling_right_there_lzAXxn0b}

Last updated