Pwn - Sound of Silence
Medium
Last updated
Medium
Last updated
Navigate the shadows in a dimly lit room, silently evading detection as you strategize to outsmart your foes. Employ clever distractions to divert their attention, paving the way for your daring escape!
Firstly, Full RELRO so no GOT overrides and NX enabled which means we can't execute shellcode on the stack.
The program is relatively simple with system()
and gets()
but no 'win' function. To pwn this we likely need to get the program to execute system('/bin/sh')
. There wasn't any gadget that could modify rdi
which made the challenge a little tough. (After the event, someone noted that there is the mov rdi, rax
gadget in the main function but interestingly, ROPgadget did not pick it up so we could use that if we wanted to.)
But we don't actually need a ROP gadget. gets()
actually stores the user input into rdi
which makes this very easy.
Another interesting thing to note is that if we just pass in "/bin/sh" to gets()
, the 5th character gets shifted 1 letter downwards.
To overcome this we just need to send "/bin0sh" instead.
Flag: HTB{n0_n33d_4_l34k5_wh3n_u_h4v3_5y5t3m}