Pwn - Jumpy
Warmup | 62 Solves | 338 points
Description
I like jumping
Downloads
Solution
First, do some reconnaissance on the binary.

Perfect, no binary protections at all :) Now we decompile it in IDA to see its logic.

There is no boundary check for scanf which means we are able to get a stack-based buffer overflow. Also, there is an interesting function np with only 1 instruction in it, jmp rsp.

With that, we can formulate our attack plan as such:
Craft our own
/bin/shshellcodeBuffer overflow to write into
RIPand also, write our shellcode onto the stackControl
RIPto execute thejmp rspgadgetGet shell after shellcode is executed
Few things worth noting:
From IDA we know
v4is 48 bytes away fromrbp([rbp-0x30])We need to overwrite 8 more bytes because of
rbpand the binary is in 64-bit architectureInitially I did not explicitly state the
context.archtoamd64and was struggling to find out why I am not getting a shell, turns out it is important to explicitly state that!!
Flag: TFCCTF{B0unc3_B0unc3_B0unc3}
Last updated