SUBDOMAIN ENUMERATION

 Subdomain enumeration is the process of finding subdomains within a website. This can be achieved via brute force, open source intelligence (OSINT) or virtual hosts. This 0xffsec subdomain enumeration handbook may be of use

Some examples of effective OSINT for subdomain enumeration are:

OSINT - Certificate Transparency

SSL/TLS (Secure /Sockets Layer/Transport Layer Security) certificates are created for a domain by a CA (Certificate Authority). When these are made, the CA records the certificates in certificate transparency logs, which are publicly available. This can be used as part of a pen test by checking the logs for any subdomains that have been registered. Sites like https://crt.sh and https://ui.ctsearch.entrust.com/ui/ctsearchui offer databases that can be searched. 


The example below shows the logs for domain names added to https://tryhackme.com




Brute Force - Automated tools

There are many tools for automating the enumeration of subdomains. In the example below a tool called DNSrecon was used, however geobuster can be used with a DNS bruteforce option using  gobuster dns -t 30 -w [wordlist] -d [ip]


OSINT - automated tools.

There are also tools for automating enumeration in a passive manner. For example sublist3r as used in the example below.



Virtual Hosts

Some subdomains aren't hosted publicly, such as development versions of a web app or those for internal use only. Instead the DNS records could be kept on developer machines (at /etc/hosts for Linux users or  c:\windows\system32\drivers\etc\hosts for windows users) which map domain names to IP addresses.

Multiple websites can be hosted on a single server, so when a client requests a website from a server the server looks at the Host header in order to determine which website to send back to the client. A penetration tester can utilise this feature by using a tool such as ffuf with a wordlist of commonly used subdomain names to enumerate for hidden subdomains. 




Comments

Popular posts from this blog

BURPSUITE IN-DEPTH

PASSIVE AND ACTIVE RECONNAISSANCE

CROSS-SITE SCRIPTING