Actually I solved this challenage with angr, but I tried to do this with gdb scripting after DEF CON.
Have fun :)
gdb ./neophyte_revsersing
source ./neophyte_revsersing.gdbscript
# wait for flag
b *0x080492a4 | |
commands 1 | |
set $last_data = $eax | |
call memcpy($tmp, $last_data, 0x14) | |
continue | |
end | |
b *0x080492ad | |
commands 2 | |
call memcpy($last_data, $tmp, 0x14) | |
set $argv = *(char***)($ebp+0xc) | |
set $flag = $argv[1] | |
set $i = *(int*)($esp+0x18) | |
set $flag[$i] += 1 | |
x/s $flag | |
set $eip = 0x0804927e | |
continue | |
end | |
b *0x080492B5 | |
commands 3 | |
x/s $flag | |
continue | |
end | |
b *0x08049242 | |
commands 4 | |
call malloc(0x14) | |
set $tmp = $eax | |
continue | |
end | |
run " " | |
# vim: ft=gdb |
Actually I solved this challenage with angr, but I tried to do this with gdb scripting after DEF CON.
Have fun :)
gdb ./neophyte_revsersing
source ./neophyte_revsersing.gdbscript
# wait for flag
Binary: https://github.com/ctfs/write-ups-2016/tree/master/open-ctf-2016/reversing/neophyte-reversing-200