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 advantageous as we can use resources such as https://crt.sh and https://ui.ctsearch.entrust.com/ui/ctsearchui to search for certificates and 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 administration portal. Instead, DNS records could be kept on a private DNS server or recorded on a developer's machine in their
/etc/hostsfile orC:\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. We can utilize this host header by making changes to it and monitoring the response to see if we've discovered a new website.
Just like DNS Brute Force, we can automate this process by using 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, we need to filter the output. We can do this by using the page size result with the -fs switch.
ffuf -w /usr/share/wordlists/SecLists/Discovery/DNS/namelist.txt -H "Host: FUZZ.tesla.com" -u http://<IP_HERE> -fs {size}
{size} = file size, which in the case of our first scan was 2395, so we can eliminate those in our search and find unique ones.