Web Enumeration
Techniques for enumerating a web server: fingerprinting the framework, reading headers and sitemaps, and brute-forcing directories and subdomains.
Favicon Fingerprinting
Sometimes when frameworks are used to build a website, a favicon that is part of the installation gets left over. If the developer doesn't replace it with a custom one, it can give a clue to the framework in use. OWASP hosts a database of common framework icons to check a target's favicon against: https://wiki.owasp.org/index.php/OWASP_favicon_database.
Pull the favicon from the website: curl https://static-labs.tryhackme.cloud/sites/favicon/images/favicon.ico -UseBasicParsing -o favicon.ico
Check the MD5 hash against OWASP: Get-FileHash .\favicon.ico -Algorithm MD5
Other Information Sources
- Sitemap: XML files such as sitemap.xml can reveal every file on a website that a developer does not necessarily want viewed. This can help a pentester enumerate a system.
- HTTP Headers:
curl http://<IP_HERE> -vcan sometimes reveal useful information such as the webserver software and possible programming or scripting language used. As a pentester, this is critical for exploiting known vulnerabilities. - OSINT: Wayback Machine: https://archive.org/web/
Automated Discovery
FFUF:
ffuf -w /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt -u http://<IP_HERE>/FUZZ
FFUF subdomain scan:
ffuf -w /usr/share/wordlists/SecLists/Discovery/DNS/bitquark-subdomains-top100000.txt -H "Host: FUZZ.red.thm" -u https://10.10.29.147 -fs 4605
Here we add the /etc/host created domain and the IP associated with it to specify SSL/HTTPS. Additionally, we use -fs to specify a false positive tolerance level of 4605. If a subdomain is discovered through this method, we need to add it to our /etc/hosts file as a VLAN. Such as (10.10.21.20 blog.futurevera.thm) or (10.10.21.20 support.futurevera.thm).
FFUF VLAN scan:
ffuf -w /usr/share/wordlists/SecLists/Discovery/Web-Content/raft-small-words.txt:FUZZ -u http://10.10.229.199/export2pdf.php -d "url=http://127.0.0.1/FUZZ" -H "Content-Type: application/x-www-form-urlencoded" -H "Cookie: PHPSESSID=dae98328a272b7146e83d3239f43e342" -e .txt,.php -fw 35
DIRB:
dirb http://<IP_HERE>/ /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt
GOBUSTER:
gobuster dir --url http://<IP_HERE>/ -w /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt
A really good gobuster scan to see hidden directories:
gobuster dir --url http://10.10.250.182/subrion/ -f -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -o subrion.txt -b 301,302,304 -t 100 -q
Searching for a specific file extension:
gobuster dir --url http://10.10.40.47/cvs/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x pdf.php,php.pdf