🔬IIS - WebDAV
Lab 1
Target IP:
10.3.26.115IIS exploitation
Credentials provided:
bob:password_123321
ping 10.3.26.115
nmap -sV -sC 10.3.26.115PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE COPY PROPFIND LOCK UNLOCK PROPPATCH MKCOL PUT DELETE MOVE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Did not follow redirect to /Default.aspx
| http-webdav-scan:
| WebDAV type: Unknown
| Public Options: OPTIONS, TRACE, GET, HEAD, POST, PROPFIND, PROPPATCH, MKCOL, PUT, DELETE, COPY, MOVE, LOCK, UNLOCK
| Allowed Methods: OPTIONS, TRACE, GET, HEAD, POST, COPY, PROPFIND, LOCK, UNLOCK
| Server Type: Microsoft-IIS/10.0
|_ Server Date: Fri, 10 Mar 2023 12:34:28 GMT
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
3306/tcp open mysql MySQL (unauthorized)
3389/tcp open ms-wbt-server Microsoft Terminal Services
| rdp-ntlm-info:
| Target_Name: DOTNETGOAT
| NetBIOS_Domain_Name: DOTNETGOAT
| NetBIOS_Computer_Name: DOTNETGOAT
| DNS_Domain_Name: DotNetGoat
| DNS_Computer_Name: DotNetGoat
| Product_Version: 10.0.17763
|_ System_Time: 2023-03-10T12:34:28+00:00
| ssl-cert: Subject: commonName=DotNetGoat
| Not valid before: 2023-03-09T12:25:30
|_Not valid after: 2023-09-08T12:25:30
|_ssl-date: 2023-03-10T12:34:36+00:00; 0s from scanner time.
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 2.02:
|_ Message signing enabled but not required
| smb2-time:
| date: 2023-03-10T12:34:33
|_ start_date: N/A
A
http-enumscript scan can also be done, focusing only on port80:


hydra- a parallelized fast and flexible login cracker which supports numerous protocols to attack.
❗Pay attention with brute-force attacks as they can cause a DoS (Denial of Service)❗
Try
hydrato brute force WebDAV in this case

Use the lab provided credentials instead, first in the web browser then with
davtesttool

It sends exploit files to the WebDAV server and automatically creates the directory and uploads different format types of files, then it tries to execute uploaded files and gives an output of successfully executed files.
Use the provided credentials with
davtest

📌 Summary:
All important file types can be uploaded to the
/webdavdirectory
.txt,.asp,.htmlfiles can be executed
Use
cadaverto upload an.asppayload to the/webdavdirectory


Access the backdoor using the browser
http://10.3.26.115/webdav/webshell.asp
Windows commands can be provided in the box

Run
whoami,ipconfigor other commands to find the flag

dir C:\commandhttp://10.3.26.115/webdav/webshell.asp?cmd=dir+C%3A%5C
type C:\flag.txtcommandhttp://10.3.26.115/webdav/webshell.asp?cmd=type+C%3A%5Cflag.txt
Lab 2
🔬 Windows: IIS Server: WebDav Metasploit
Target IP:
10.4.18.218IIS exploitation with Metasploit
Credentials provided:
bob:password_123321

Use
davtestto get the all the file types that can be uploaded and executed on the IIS server

Use Metasploit module to execute a payload and optain a reverse shell (
meterpreter session) on the target system or usemsfvenomto manually create a payload and use it with metasploit.
msfvenom - manual
Manually generate the
.asppayload
Use
cadaverto upload the generatedshell.asppayload to the/webdavdirectory
Before executing the shell.asp, setup a listener/handler that will receive the reverse connection from the target and send the stage that provides with a meterpreter session when executed.
Open a new terminal tab and run Metasploit with database support
Setup a Metasploit handler, using the same payload, LHOST, LPORT provided to
msfvenom
The listener (reverse TCP handler) starts listening and waits for a connection from the actual
shell.asppayload

Open the
http://10.4.18.218/webdavlink in the browser and click onshell.aspfileThe Meterpreter session will be opened

Get remote system info with
sysinfo

Get the user that the server is running as with
getuid

📌 No privilege escalation needed since the user is
NT AUTHORITY\SYSTEM❗ Once access is optained, the uploaded payloads can be deleted from the target system, to avoid detection!
Use cadaver to delete the
shell.aspuploaded file
metasploit - automatic
Use Metasploit iis_webdav_upload_asp module to get a
meterpretersession on the target system.

This exploit automatically deleted the
/webdav/metasploit.asppayloadFind the flag, running
meterpretercommands
Lab 3 (Extra)
Windows: IIS Server Metasploit Backdoor
Target IP:
10.4.23.148IIS exploitation with Metasploit
Credentials provided:
bob:password_123321
Meterpreter Commands
Last updated
Was this helpful?


