CTF - Ayuda? - Traceo del hombre pobre

9 views
Skip to first unread message

Felipe

unread,
Sep 16, 2012, 7:45:32 PM9/16/12
to seguridad-...@googlegroups.com
OBJETIVO: Tracear el challenge 11 
(i.e. tirar tooodas las instrucciones que ejecuta a un archivo) 

1) Preparar un script de inicializacion para el gdb

$cat > script.gdb
set log on /tmp/challenge11.trace
display /i $eip
start < mi_intento_de_solucion.bin

2) Ejecutar el gdb mandandole un monton de "stepi"

yes stepi | gdb  -x script.gdb ~/challenges/11-challenge


3)Cancelar cuando empiece a tirar ago asi:

(gdb) The program is not being run.
(gdb) The program is not being run.
(gdb) The program is not being run.
(gdb) The program is not being run.
(gdb) The program is not being run.
(gdb) The program is not being run.


4) Analizar la salida en /tmp/challenge11.trace con grep

P ej.. Todas las intrucciones que usan como valor inmediato una direccion del "ejecutable".

cat  /tmp/challenge11.log  |grep ".*:.*0x804"
=> 0x8048492 <main+23>: jmp    0x80484bb <main+64>
=> 0x80484bf <main+68>: jg     0x80484c7 <main+76>
=> 0x80484c5 <main+74>: jle    0x8048494 <main+25>
=> 0x8048494 <main+25>: call   0x8048458 <read_int>
=> 0x804845e <read_int+6>: mov    $0x80485a4,%edx
=> 0x8048463 <read_int+11>: mov    0x804a020,%eax
=> 0x804846e <read_int+22>: call   0x8048350 <__isoc99_fscanf@plt>
=> 0x8048350 <__isoc99_fscanf@plt>: jmp    *0x804a000
=> 0x804835b <__isoc99_fscanf@plt+11>: jmp    0x8048340
=> 0x8048340: pushl  0x8049ff8
=> 0x8048346: jmp    *0x8049ffc
=> 0x804849c <main+33>: call   0x8048458 <read_int>
=> 0x804845e <read_int+6>: mov    $0x80485a4,%edx
=> 0x8048463 <read_int+11>: mov    0x804a020,%eax
=> 0x804846e <read_int+22>: call   0x8048350 <__isoc99_fscanf@plt>
=> 0x8048350 <__isoc99_fscanf@plt>: jmp    *0x804a000

f/
Reply all
Reply to author
Forward
0 new messages