23.-IIS-tilde-enumeration
1. IIS Tilde Enumeration Concept
IIS generates 8.3 short file names for files and directories.
These short names can be accessed using the tilde (~) character in URLs.
This technique helps uncover hidden resources.
The 8.3 filename format consists of 8 characters, a period, and a 3-character extension.
Example:
SecretDocuments
becomesSECRET~1
Example file:
somefile.txt
becomesSOMEFI~1.TXT
If two files have similar names, the number after the tilde increments.
Affected Versions: IIS 5.0, IIS 6.0, IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5.
2. Enumeration Process
Send HTTP requests with tilde and character combinations.
Analyze server responses (
200 OK
indicates a valid short name).Iteratively refine the short name.
Once the short name is found, access files within that directory.
3. Enumeration Commands and Tools
Nmap Port and Service Scan
Scans all ports, performs service version detection, runs default scripts, and displays open ports.
IIS ShortName Scanner (Java)
Automates tilde enumeration.
Requires Java to be installed.
Wordlist Generation (egrep and sed)
Generates a wordlist from files containing the string
transf
.
Gobuster Directory Bruteforcing
Brute-forces directories and files using the generated wordlist and specified extensions.
4. Command Breakdown
Nmap:
-p-
: Scan all ports.-sV
: Perform service version detection.-sC
: Run default scripts.--open
: Show only open ports.
IIS ShortName Scanner:
0
: Start position.5
: Maximum length of short file name.http://<target_ip>/
: Target URL.
egrep:
-r
: Recursive search.^transf
: Lines starting with "transf".
sed:
's/^[^:]*://'
: Remove text before the first colon.
Gobuster:
-u
: Target URL.-w
: Wordlist file.-x
: File extensions.
5. Practical Example
Sample Enumeration Output:
This output suggests:
/SECRET~1
is a valid directory./DOCUME~1/FILE.TXT
is an accessible file./ADMIN~1
exists but is restricted.
6. Mitigation Strategies
Disable 8.3 File Name Support:
Block tilde-based requests using URL Rewrite Rules in IIS.
Harden IIS configuration by restricting directory listings and permissions.
Regularly update IIS to mitigate known vulnerabilities.
7. Key Points
IIS tilde enumeration exploits a vulnerability in IIS's handling of short file names.
Tools like IIS ShortName Scanner and Gobuster automate the enumeration process.
Wordlists can be generated to target specific file names.
Nmap is used for initial port and service enumeration.
Java is required to run the IIS short name scanner.
Gobuster and wordlist generation help find the full file name from the 8.3 short file name.
Mitigation strategies should be implemented to prevent unauthorized access.
Last updated