Subdomain Enumeration
There are three different subdomain enumeration methods:
- Brute Force
- OSINT
- Virtual Host
SSL/TLS Certificates
When an SSL/TLS certificate is created for a domain by a CA, they take part in what's called "Certificate Transparency (CT) logs". The purpose of CT logs is to stop malicious and accidentally made certificates from being used. This is an advantage for us: resources such as https://crt.sh and https://ui.ctsearch.entrust.com/ui/ctsearchui can be searched for certificates to identify subdomains belonging to a company.
DNSrecon
An automation tool used to brute force subdomains:
dnsrecon -t brt -d tesla.com
Sublist3r
This automation tool speeds up the process of OSINT subdomain discovery:
./sublist3r.py -d tesla.com
Scanning Virtual Hosts with Ffuf
Some subdomains are not always hosted in publicly accessible DNS results, such as development versions of a web application or an administration portal. Instead, DNS records could be kept on a private DNS server or recorded on a developer's machine in their /etc/hosts file or C:\windows\system32\drivers\etc\hosts. Because web servers can host multiple websites from one server, when a website is requested from a client the server knows which website the client wants from the Host header. By making changes to this host header and monitoring the response, we can see if a new website has been discovered.
Just like DNS brute force, this process can be automated with a wordlist of commonly used subdomains:
ffuf -w /usr/share/wordlists/SecLists/Discovery/DNS/namelist.txt -H "Host: FUZZ.tesla.com" -u http://<IP_HERE>
-w= wordlist switch-H= header switchFUZZ= placeholder for the unknown subdomain to fill (aka variable)
Because the above command will always produce a valid result, the output needs filtering. This is done with the page size result using the -fs switch:
ffuf -w /usr/share/wordlists/SecLists/Discovery/DNS/namelist.txt -H "Host: FUZZ.tesla.com" -u http://<IP_HERE> -fs {size}