IIS Misconfiguration Checks
IIS misconfigurations expose application internals, enable dangerous HTTP methods, and leak file paths and framework versions. Each finding below is independently reportable. Run these after IIS enumeration establishes the version and surface. Confirmed misconfigurations feed directly into exploitation paths.
Directory Listing Enabled
Check whether IIS returns directory contents when no default document exists:
<h2>Directory Listing for /</h2> <a href="uploads/">uploads/</a>
Directory listing: http://10.10.10.50/uploads/
TRACE Method Enabled
HTTP TRACE reflects the request back to the client including all headers. On IIS it is enabled by default and should be explicitly disabled:
TRACE / HTTP/1.1 X-Custom-Header: tracetest
The server reflecting the request body confirms TRACE is active. This is a reportable misconfiguration enabling cross-site tracing (XST) attacks in combination with XSS.
ASP.NET Stack Trace and Path Disclosure
Custom errors disabled or misconfigured causes ASP.NET to return full stack traces with physical file paths:
Physical path: C:\inetpub\wwwroot\doesnotexist.aspx ASP.NET Version: 4.0.30319 Exception Details: System.Web.HttpException
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<connectionStrings>
<add name="DefaultConnection" connectionString="Server=10.10.10.20;Database=webapp;User Id=sa;Password=SqlP@ss2024!" />
</connectionStrings>
A web.config backup containing a connection string with credentials is a direct path to the database. Test the credentials immediately against the MSSQL service.
ASP.NET Debug Mode Enabled
Debug mode enabled in web.config or detectable via response headers exposes additional information and may enable remote debugging:
Exposed Sensitive Files
Check for common IIS-specific sensitive files that are sometimes accessible despite server restrictions:
404 /web.config 200 /web.config.bak 404 /web.config.old 200 /elmah.axd 404 /trace.axd
elmah.axd (Error Logging Modules and Handlers) accessible without authentication is a high-impact finding — it exposes the full application error log including SQL queries, connection strings, and internal paths. Pull the full log:
IIS Version-Specific Vulnerabilities
Cross-reference the detected version against known CVEs before moving to manual testing:
Explain command
| 'Microsoft IIS' | Search term to query the Exploit-DB local database for IIS exploits. |
| -iE | Case-insensitive matching using extended regular expressions. |
| '10\.0|8\.5|7\.5|remote' | Regex pattern to filter results matching IIS versions or remote exploits. |
Explain command
| -u http://$TARGET_IP/ | Target URL to scan, with dynamic IP placeholder. |
| -tags iis,microsoft | Run only templates tagged with 'iis' or 'microsoft'. |
| -severity medium,high,critical | Filter templates by severity: medium, high, or critical. |
References
-
Microsoft — IIS Security Configurationlearn.microsoft.com/en-us/iis/manage/configuring-security/how-to-use-the-sample-read-only-xml-membership-and-role-providers-with-iis (opens in new tab)
IIS security hardening reference including custom errors and method restrictions
-
Error Logging Modules and Handlers — common IIS error log exposure
Was this helpful?
Your feedback helps improve this page.