Exploiting Tools
Metasploit
Shellkodes
GDB
Installeer
Parameters
Parameters
Instruksies
Jy kan opsioneel hierdie tak van GEF gebruik wat meer interessante instruksies bevat.
Sluike truuks
GDB dieselfde adresse
Tydens die foutopsporing sal GDB effens verskillende adresse hê as wat deur die binêre lêer gebruik word wanneer dit uitgevoer word. Jy kan GDB hê om dieselfde adresse te hê deur die volgende te doen:
unset env LINES
unset env COLUMNS
set env _=<pad>
Plaas die absolute pad na die binêre lêerExploiteer die binêre lêer deur dieselfde absolute roete te gebruik
PWD
enOLDPWD
moet dieselfde wees wanneer GDB gebruik word en wanneer die binêre lêer geëxploiteer word
Terugvoer om opgeroepen funksies te vind
Wanneer jy 'n staties gekoppelde binêre lêer het, sal al die funksies behoort aan die binêre lêer (en nie aan eksterne biblioteke nie). In hierdie geval sal dit moeilik wees om die vloei wat die binêre lêer volg om byvoorbeeld vir gebruikersinvoer te vra te identifiseer.
Jy kan hierdie vloei maklik identifiseer deur die binêre lêer met gdb te hardloop totdat jy vir insette gevra word. Stop dit dan met CTRL+C en gebruik die bt
(backtrace) bevel om die opgeroepen funksies te sien:
GDB-bediener
gdbserver --multi 0.0.0.0:23947
(in IDA moet jy die absolute pad van die uitvoerbare lêer in die Linux-masjien en in die Windows-masjien invul)
Ghidra
Vind stokverskuiwing
Ghidra is baie nuttig om die verskuiwing vir 'n buffer-oorvloei te vind danksy die inligting oor die posisie van die plaaslike veranderlikes.
Byvoorbeeld, in die voorbeeld hieronder, dui 'n buffer-vloei in local_bc
daarop dat jy 'n verskuiwing van 0xbc
benodig. Verder, as local_10
'n kanariekoekie is, dui dit daarop dat daar 'n verskuiwing van 0xac
is om dit vanaf local_bc
te oorskryf.
Onthou dat die eerste 0x08 waar die RIP gestoor word, aan die RBP behoort.
qtool
Kry elke opcode wat in die program uitgevoer word.
GCC
gcc -fno-stack-protector -D_FORTIFY_SOURCE=0 -z norelro -z execstack 1.2.c -o 1.2 --> Kompileer sonder beskerming -o --> Uitset -g --> Berg kode op (GDB sal dit kan sien) echo 0 > /proc/sys/kernel/randomize_va_space --> Om die ASLR in Linux af te skakel
Om 'n shellcode te kompileer: nasm -f elf assembly.asm --> gee 'n ".o" ld assembly.o -o shellcodeout --> Uitvoerbaar
Objdump
-d --> Ontbind uitvoerbare afdelings (sien opcodes van 'n gekompileerde shellcode, vind ROP Gadgets, vind funksie-adres...) -Mintel --> Intel sintaksis -t --> Simbole tabel -D --> Ontbind alles (adres van statiese veranderlike) -s -j .dtors --> dtors afdeling -s -j .got --> got afdeling -D -s -j .plt --> plt afdeling ontbin -TR --> Herlokasies ojdump -t --dynamic-relo ./exec | grep puts --> Adres van "puts" om te wysig in GOT objdump -D ./exec | grep "VAR_NAME" --> Adres van 'n statiese veranderlike (hierdie word gestoor in DATA afdeling).
Kernafleidings
Voer
ulimit -c unlimited
uit voordat ek my program beginVoer
sudo sysctl -w kernel.core_pattern=/tmp/core-%e.%p.%h.%t
uitsudo gdb --core=<path/core> --quiet
Meer
ldd executable | grep libc.so.6 --> Adres (as ASLR, verander dit dan elke keer) for i in `seq 0 20`; do ldd <Ejecutable> | grep libc; done --> Lus om te sien of die adres baie verander readelf -s /lib/i386-linux-gnu/libc.so.6 | grep system --> Verskuiwing van "system" strings -a -t x /lib/i386-linux-gnu/libc.so.6 | grep /bin/sh --> Verskuiwing van "/bin/sh"
strace executable --> Funksies wat deur die uitvoerbare aangeroep word rabin2 -i ejecutable --> Adres van al die funksies
Inmunity debugger
IDA
Debugging in afgeleë Linux
Binne die IDA-vouer kan jy bineêre lêers vind wat gebruik kan word om 'n bineêre lêer binne 'n Linux te ontleed. Om dit te doen, skuif die bineêre lêer linux_server
of linux_server64
na die Linux-bediener en hardloop dit binne die vouer wat die bineêre lêer bevat:
Dan, stel die debugger in: Debugger (linux remote) --> Proses opsies...:
Last updated