Published on February 27th, 2016 📆 | 8517 Views ⚑0
IIS Short Name Scanner – Scanner For IIS Short File Name Disclosure Vulnerability
- If you can guess the full extension (for instance .ASPX when the 8.3 extension is .ASP), always try the short name with the full extension.
- Sometimes short names are listed in Google which can be used to find the actual names
- Using text dictionary files is also recommended. If a name starts with another word, the second part should be guessed based on a dictionary file separately. For instance, ADDACC~1.ASP can be AddAccount.aspx, AddAccounts.aspx, AddAccurateMargine.aspx, etc
- Searching in the website contents and resources can also be useful to find the full name. This can be achieved for example by searching Site Map in the Burp Suite tool.
Command line options
USAGE 1 (To verify if the target is vulnerable with the default config file): java -jar iis_shortname_scanner.jar [URL]
USAGE 2 (To find 8.3 file names with the default config file): java -jar iis_shortname_scanner.jar [ShowProgress] [ThreadNumbers] [URL]
USAGE 3 (To verify if the target is vulnerable with a new config file): java -jar iis_shortname_scanner.jar [URL] [configFile]
USAGE 4 (To find 8.3 file names with a new config file): java -jar iis_shortname_scanner.jar [ShowProgress] [ThreadNumbers] [URL] [configFile]
USAGE 5 (To scan multiple targets using a linux box): ./multi_targets.sh
DETAILS: [ShowProgress]: 0= Show final results only - 1= Show final results step by step - 2= Show Progress [ThreadNumbers]: 0= No thread - Integer Number = Number of concurrent threads [be careful about IIS Denial of Service] [URL]: A complete URL - starts with http/https protocol [configFile]: path to a new config file which is based on config.xml
- Example 0 (to see if the target is vulnerable): java -jar iis_shortname_scanner.jar https://example.com/folder/ - Example 1 (uses no thread - very slow): java -jar iis_shortname_scanner.jar 2 0 https://example.com/folder/new%20folder/ - Example 2 (uses 20 threads - recommended): java -jar iis_shortname_scanner.jar 2 20 https://example.com/folder/new%20folder/ - Example 3 (saves output in a text file): java -jar iis_shortname_scanner.jar 0 20 https://example.com/folder/new%20folder/ > c:\results.txt - Example 4 (bypasses IIS basic authentication): java -jar iis_shortname_scanner.jar 2 20 https://example.com/folder/AuthNeeded:$I30:$Index_Allocation/ - Example 5 (using a new config file): java -jar iis_shortname_scanner.jar 2 20 https://example.com/folder/ newconfig.xml - Example 6 (scanning multiple targets using a linux box): ./multi_targets.sh scope.txt 1
Note 1: Edit config.xml file to change the scanner settings and add additional headers. Note 2: Sometimes it does not work for the first time and you need to try again.
How Does It Work?
In the following examples, IIS responds with a different message when a file exists:
However, different IIS servers may respond differently, and for instance some of them may work with the following or other similar patterns:
Method of sending the request such as GET, POST, OPTIONS, DEBUG, ... is also important.
I believe monitoring the requests by using a proxy is the best way of understating this issue and this scanner.
How To Fix This Issue
Microsoft will not patch this security issue. Their last response is as follows:
Thank you for contacting the Microsoft Security Response Center. We appreciate your bringing this to our attention. Our previous guidance stands: deploy IIS with 8.3 names disabled.
Therefore, it is recommended to deploy IIS with 8.3 names disabled by creating the following registry key on a Windows operating system:
Key: HKLM\SYSTEM\CurrentControlSet\Control\FileSystem Name: NtfsDisable8dot3NameCreation Value: 1
Note: The web folder needs to be recreated, as the change to the NtfsDisable8dot3NameCreation registry entry affects only files and directories that are created after the change, so the files that already exist are not affected.
One of the new methods: https://soroush.secproject.com/blog/2014/08/iis-short-file-name-disclosure-is-back-is-your-server-vulnerable/
Original research file: https://soroush.secproject.com/downloadable/microsoft_iis_tilde_character_vulnerability_feature.pdf
Website Reference: https://soroush.secproject.com/blog/2012/06/microsoft-iis-tilde-character-vulnerabilityfeature-short-filefolder-name-disclosure/
Video Link: https://www.youtube.com/watch?v=XOd90yCXOP4