Humiliating IIS servers for fun and jail time
Humiliating IIS Servers for Fun and Jail Time
"If you ever spot an IIS blue screen, don’t stop there; there must be something." — A wise friend
Behind that infamous blue window lies one of the most consistently misconfigured web servers on the internet. It isn't just a crash; it's an invitation to dig deeper.
Below is my comprehensive methodology for dismantling IIS targets during bug bounty engagements.
🗺️ Roadmap of the Attack
🔍 Phase 1: Psst, psst... IIS servers, where are you?
Before launching an active attack, you need to map the attack surface.
1. Shodan Intelligence
Don't waste packets if Shodan has already done the work. Use these queries to find boxes tied to a specific organization or SSL certificate:
| Target Goal | Shodan Query |
|---|---|
| SSL Match | ssl:"target.com" http.title:"IIS" |
| CN Match | ssl.cert.subject.CN:"target.com" http.title:"IIS" |
| Org Match | org:"target" http.title:"IIS" |
Pro Tip: You can swap Shodan for alternatives like fofa, censys, netlas, or odin.
2. Google Dorking
Google is a powerful passive scanner. Use these dorks to locate IIS footprints within your scope:
- General IIS:
site:target.com intitle:"IIS Windows Server" - Specific Folders:
site:target.com inurl:aspnet_clientorsite:target.com inurl:_vti_bin(FrontPage extensions are a huge giveaway). - File Extensions:
site:target.com ext:aspx | ext:ashx | ext:asmx - Server Headers:
site:target.com intext:"Microsoft-IIS" | intext:"X-Powered-By: ASP.NET" - Official Titles:
site:target.com intitle:"Microsoft Internet Information Services"
Expanding the Scope: To find hidden dev or staging boxes, use stacked wildcards:
site:*.target.com intitle:"IIS"site:*.*.target.com intitle:"IIS"This one often finds the "forgotten" servers.
3. Active Tech Fingerprinting
If you suspect IIS but aren't sure, check the response headers.
Manual Check:
Using nc (Netcat) for port 80:
nc -v target.com 80
Using openssl for port 443:
openssl s_client -connect target.com:443
What to look for:
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Scaling the process:
Use httpx or nuclei to filter a large list of targets:
httpx -l targets.txt -td | grep IIS | tee iis-targets.txt
🛠️ Phase 2: I found an IIS server. Now what?
Once confirmed, the goal is to extract as much "free" information as possible.
🔓 Internal IP Disclosure
Some IIS configurations (particularly those fronting Exchange or OWA) leak internal network details. By sending a request using HTTP/1.0, the server may reveal an internal IP in the Location header.
The Request:
curl -v --http1.0 http://example.com
The Potential Goldmine:
HTTP/1.1 302 Moved Temporarily
Location: https://192.168.5.237/owa/
Server: Microsoft-IIS/10.0
X-FEServer: NHEXCHANGE2016
Result: You now have an internal IP (192.168.5.237) and an internal hostname (NHEXCHANGE2016).
🤖 Nuclei: Automating the Boring Stuff
While you perform manual recon, let nuclei handle the low-hanging fruit in the background:
nuclei -l iis-targets.txt \
-tags microsoft,windows,asp,aspx,iis,azure,config,exposure -silent
🛑 The HTTPAPI 2.0 "Dead End"
You will often encounter a generic HTTPAPI 2.0 404 error. This usually doesn't mean the page is missing; it means the server is bound to a specific Virtual Host and didn't recognize your Host header.
The Fix:
Check the SSL certificate's Subject or SAN fields for the correct hostname. Then, fuzz the Host header using ffuf:
ffuf -u https://TARGET_IP/ -H "Host: FUZZ.target.com" -w vhosts.txt -fs 0
When the correct hostname is hit, the server will stop returning 404s and start serving the actual application.
📂 Phase 3: Tilde (~) Enumeration
This is a legacy feature based on the old DOS 8.3 filename convention. Even if directory listing is disabled, you can often enumerate shortnames of files and folders.
Recommended Tools:
shortscan: Use the following command to fuzz directories and enumerate shortnames:shortscan https://target.com/ -F -p 1(Note:-Ftargets full URLs, and-p 1increases patience/thoroughness).- Burp Suite: Use the IIS Tilde Enumeration Scanner extension.
Example Output:
File: WEB~1.CON(Almost certainlyweb.config)File: GLOBAL~1.ASAFile: SITEBA~1.ZIPDir: ADMIN~1
🧩 Resolving Shortnames
Once you have a fragment like SITEBA~1.ZIP, you need to guess the full name.
Method A: Leveraging LLMs Feed the fragment to an AI with this prompt:
"Return only a list of words, separated by newlines, and nothing else. Make a list of guesses for what the rest of the word could be from this snippet:
{shortname}"
Method B: GitHub Dorks GitHub is a massive database of real-world filenames. Search for patterns that match your shortname fragments to find common naming conventions used in similar projects.
Method C: BigQuery (As mentioned in the roadmap, using BigQuery to resolve shortnames via massive dataset analysis).
The Logic: The idea is to take the first... [Text ends here]
📝 Final Checklist for IIS Hunting
- Run Shodan/Google Dorks for discovery.
- Fingerprint headers via
httpx. - Test for
HTTP/1.0internal IP leaks. - Run
nucleiwith Microsoft tags. - Fuzz VHosts if
HTTPAPI 2.0is present. - Perform Tilde enumeration for 8.3 filenames.
- Resolve shortnames using LLMs or GitHub.
🧮 The Recon Formula
The probability of success can be modeled as: