Hacking IIS: W/ Shubs
Hacking IIS: W/ Shubs
Hacking IIS: W/ Shubs
w/ shubs
Dealing with HTTPAPI 2.0
Assets
Have you seen this before?
• Either, you’re missing the subdomain associated with the IP address (No SSL certificate)
• Or the subdomain doesn’t resolve but you can obtain a full/partial subdomain from the SSL
certificate
Resolving the HTTPAPI 2.0 404 Error
• This is super simple, but often people skip assets when they see the HTTPAPI
2.0 404 error. This error usually means that the asset needs the correct host
header to route to the application.
• You’re not always fortunate enough to have the full subdomain provided to
you via the SSL certificate.
• If you know the hostname, simply provide the hostname in the HTTP Host
header.
• Sometimes you have to bruteforce VHosts until you can access the
application.
After fixing the host header
• Add a line to your /etc/hosts file to map the correct host name to the IP
address of the asset.
• Run all of your scanning again, including your enumeration through IIS
shortname scanner.
• Find all other assets that respond with HTTPAPI 2.0 404 errors and apply the
same workflow (rinse and repeat).
VHost Hopping
Accessing an internal admin panel via VHost
Hopping ($1900)
• Came across an asset that looked something like apply.company.com
running IIS.
• DownloadCategoryExcel?fileName=../../web.config
• DownloadCategoryExcel?fileName=../../global.asax
• DownloadCategoryExcel?fileName=../../bin/Company.Web.Api.dll
• For IIS webservers, if you can read the web.config file, you can almost always
get RCE.
• https://github.com/0xacb/viewgen
• /admin/cutesoft_client/cuteeditor/uploader.ashx
• The ZIP file that can be downloaded from the above URL contains a number
of DLL files, but no source code.
• We can use DNSpy to analyse the source code and find vulnerabilities.
Source Code Analysis through DNSpy
• https://github.com/dnSpy/dnSpy/releases
• DNSpy is capable of reversing assemblies (i.e DLL files) back into source
code. Simply load the DLL file and export the source code project.
Navigating through DNSpy
Complex XXE Vectors
Constraints
• No outbound HTTP traffic. The only outbound traffic possible is DNS.
• You cannot use an external DTD because you cannot reach your external
host via HTTP.
😭
No data, parsing error
Local DTDs (Attempt 2) Added a # so that the
file entity is a part
of a fragment
• A huge thank you to Robert Vulpe on Twitter for this trick: @nytr0gen_ identifier
• For example, for ffuf, you would put use the following fuzzing pattern:
• LIDSDI_____ → LIDSFUZZ
• LIDSSE_____ → LIDSFUZZ
• EASYFI_____ → EASYFUZZ
v1.1.0
________________________________________________
:: Method : GET
:: URL : http://161.215.212.13/lidsFUZZ
:: Wordlist : FUZZ: final_fucking_wordlist.txt
:: Extensions : asp html aspx ashx asmx
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 1000
:: Matcher : Response status: 200,204,301,302,307,401,403
________________________________________________
• https://bit.ly/3q2yFwY
More resources on hacking IIS
• https://bit.ly/3uzOP4N → Assetnote Youtube Channel