Subdomains Enumeration: Tools, Techniques, and Tips (2024)

Subdomains Enumeration: Tools, Techniques, and Tips (1)

In our previous adventure, we gathered a treasure trove of information: IPs, CIDRs, ASNs, IP ranges, live IPs, open ports, and hostnames (subdomains). ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ“ฆ This time, weโ€™re diving deep into the ocean of subdomain enumeration tools and techniques. But first, letโ€™s get cozy with the basics of TLDs, domains, and different domain levels! ๐ŸŠโ€โ™‚๏ธ๐Ÿ’ป

Subdomains Enumeration: Tools, Techniques, and Tips (2)

Domain Hierarchy

Subdomains Enumeration: Tools, Techniques, and Tips (3)

For beginner bug hunters, sub-domain enumeration is essential because:

Discover Hidden Vulnerabilities: Uncovering sub-domains helps you find lesser-known parts of a website where vulnerabilities might be hiding. ๐Ÿ•ต๏ธโ€โ™‚๏ธExpand Attack Surface: Identifying sub-domains gives you a broader view of the websiteโ€™s infrastructure, revealing more potential targets to test. ๐ŸŒFind Sensitive Information: Some sub-domains may expose sensitive data or internal tools that can be exploited. ๐Ÿ”“Spot Mis-configurations: Sub-domains often have mis-configurations or outdated plugins, scripts, functions making them easier to exploit. ๐Ÿ› ๏ธImprove Overall Security: By finding and reporting bugs in sub-domains, you help the organization secure their entire web presence, not just the main site. ๐Ÿ›ก๏ธ

DNS Hijacking (DNS Redirection) ๐ŸŽฃ : Attackers change the domainโ€™s DNS settings to redirect users to malicious websites. ๐Ÿ˜ฑ๐Ÿ‘ฟDNS Spoofing (Cache Poisoning) ๐Ÿ’‰: Corrupting DNS cache entries to redirect users to malicious sites. ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ”€Sub-Domain Takeover ๐Ÿดโ€โ˜ ๏ธ: Exploiting misconfigured or unclaimed sub-domains to take control of them. ๐Ÿ‘ป๐Ÿ’ปDomain Squatting (Cybersquatting) ๐Ÿ’ฐ: Registering domains that are similar to well-known brands to profit from user mistakes. ๐Ÿ˜ˆ๐Ÿ’ธTyposquatting โœ๏ธ: Registering domains with common typos of popular websites to catch mistyped URLs. ๐Ÿคฆโ€โ™‚๏ธ๐Ÿ–ฅ๏ธDNS Tunneling ๐Ÿš‡: Using DNS queries and responses to transmit data, often for malicious purposes like exfiltrating data or bypassing firewalls. ๐Ÿ•ณ๏ธ๐Ÿ’ปDNS Amplification Attack ๐Ÿ“ข: Using DNS servers to amplify traffic and launch Distributed Denial of Service (DDoS) attacks on targeted domains.๐Ÿ’ฅ๐ŸŒ

Step 1: Collecting AMA Subdomains ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ”Ž

First, we need to gather all the juicy subdomains of our target. Weโ€™ll be using our awesome arsenal of tools and websites:

Website Tools:๐Ÿฆธโ€โ™‚๏ธ crt.sh: Certificate Transparency logs to uncover subdomains.๐Ÿ›ก๏ธ VirusTotal: Scan for any suspicious domains.๐Ÿข Chaos ProjectDiscovery: The ultimate chaos for finding hidden gems.Terminal Tools:๐Ÿ•ต๏ธโ€โ™€๏ธ subfinder: Quickly find subdomains.๐Ÿ•ธ๏ธ amass: Dive deep into the domain space.โš™๏ธ chaos client: Chaos but in a controlled manner.๐Ÿฆพ ffuf: Bruteforce your way to victory.๐Ÿ‘ฝ oneforall: All-in-one subdomain hunter (VPC only).๐ŸŒ€ massdns: Massively resolve DNS queries (VPC only).๐Ÿ”„ shuffledns: Shuffle and resolve like a pro (VPC only).

Step 2: Filtering Out Duplicates and Finding Live Ones ๐Ÿงน๐Ÿ”—

Step 3: Analyzing Live Subdomains ๐Ÿ–ผ๏ธ๐Ÿ”

Uncover Subdomains with crt.sh ๐Ÿ•ต๏ธโ€โ™‚๏ธ

Crt.sh is a website of certificate Transparency logs to uncover subdomains.

1. Visit crt.sh๐ŸŒ
โ€” Open your favorite browser and go to [crt.sh](https://crt.sh).

2. Search for Your Domain ๐Ÿ”
โ€” In the search bar, type โ€domain.comโ€ (replace this with your actual domain).

3. Inspect the Results ๐Ÿง
โ€” Youโ€™ll see a list of certificates with info like ID, domains, subdomains, certificate issuer names, and validation dates.

4. Gather the Subdomains ๐Ÿ“‹
โ€” Copy and paste the subdomains from the list into your own list.

Subdomains Enumeration: Tools, Techniques, and Tips (5)

Explore Domains with VirusTotal ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿฆ 

VirusTotal is an all-rounder tool that gives you every bit of information about a domain! ๐ŸŒ Hereโ€™s how you can dig into the details:
โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€”
Details Tab ๐Ÿ“‹

DNS Records: Check out where the domain points. ๐ŸŒWhois Record: Learn who owns the domain. ๐Ÿ•ต๏ธโ€โ™‚๏ธCertificate Details: Get info on SSL certificates. ๐Ÿ”

โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€”
Relation Tab ๐Ÿ”—

Passive DNS Replication: See DNS records over time. โณSubdomains: Discover all the little sibling domains! ๐Ÿ Communicating Files: Find files that have interacted with the domain. ๐Ÿ“Historical Whois Lookups/SSL Certificates: Track the domainโ€™s history. ๐Ÿ•ฐ๏ธGraph: Visualize all this info in a cool graph! ๐Ÿ“Š (The most important!)

Steps:
1. Go to โ€œvirustotal.comโ€ and Login/Register ๐Ÿ–ฅ๏ธ๐Ÿ”‘
2. Enter the domain name without โ€œhttps://www" or โ€œ/โ€ (remove forward slashes). Example: type facebook.com (not https://www.facebook.com/) โŒ
3. Go to the Relation Tab โžก๏ธ Graph โžก๏ธ Click the โ€œwwwโ€ node.

Subdomains Enumeration: Tools, Techniques, and Tips (6)

4. Double-click the subdomain nodes to load more subdomains. ๐Ÿ–ฑ๏ธ

Subdomains Enumeration: Tools, Techniques, and Tips (7)

5. A pop-up will appear and click the download button.๐Ÿ“ฅ

Subdomains Enumeration: Tools, Techniques, and Tips (8)

6. Youโ€™ve got all the subdomains! ๐Ÿ†

Get Subdomains with Chaos Projectdiscovery ๐ŸŒ๐Ÿ’ฅ

Chaos Projectdiscovery offers a treasure trove of subdomains from publicly available bug bounty programs worldwide. The best part? Itโ€™s free and updated daily! ๐Ÿš€

Steps :
1. Open your browser and visit the Chaos Projectdiscovery website.๐Ÿ–ฅ๏ธ๐Ÿ”
2. Type the target ๐Ÿนname in the search box.
Example: type facebook to search for Facebook subdomains.
3. Once you find the results, download ๐Ÿ“ฅ the file to get the complete list of subdomains.

Subdomains Enumeration: Tools, Techniques, and Tips (9)

Power of Amass for Subdomain Enumeration ๐Ÿ’ป๐Ÿ”

Amass is a superhero tool for finding subdomains, using both passive and active methods to get the most comprehensive results. ๐Ÿฆธโ€โ™‚๏ธ๐Ÿ•ต๏ธโ€โ™‚๏ธ Hereโ€™s how you can use Amass for bug bounty hunting and penetration testing:

# Full Enumeration (Active + Passive):
amass enum -d example.com -o subdomains.txt

# Specifying a Wordlist for Brute Force:
amass enum -d example.com -brute -w wordlist.txt

# Enumeration using ASN
amass enum -d example.com -asn 13335

# Enumeration using CIDR
amass enum -d example.com -cidr 192.168.1.0/24

# Note
Flag -o subdomains.txt is used to save results in to txt files

this command can cover overall subdomains ๐Ÿ˜Ž

Power of OneForAll Subdomain Enumeration ๐ŸŒ๐Ÿ”

OneForAll is a supercharged tool designed for subdomain sleuthing, tapping into various data sources and techniques. When you fire it up, all modules kick into action, turbocharging your discovery process. ๐Ÿ’ปโšก๏ธ

# Basic enumeration for a single target domain
python3 oneforall.py --target example.com run

# Enumeration for multiple target domains listed in a file
python3 oneforall.py --targets ./domains.txt run

# Disable checking if subdomains are alive (skip ping check)
python3 oneforall.py --target example.com --alive False run

# Disable brute-force subdomain enumeration
python3 oneforall.py --target example.com --brute False run

# Use medium port scan range during enumeration
python3 oneforall.py --target example.com --port medium run

# Output results in CSV format
python3 oneforall.py --target example.com --fmt csv run

# Disable DNS resolution for discovered subdomains
python3 oneforall.py --target example.com --dns False run

# Disable HTTP(S) request checks for discovered subdomains
python3 oneforall.py --target example.com --req False run

# Disable checking for subdomain takeover vulnerabilities
python3 oneforall.py --target example.com --takeover False run

# Display detailed results in the console
python3 oneforall.py --target example.com --show True run

For a deep dive into usage and commands, dive into the official documentation available at: [GitHub Documentation](https://github.com/shmilylty/OneForAll/blob/master/docs/en-us/README.md). ๐Ÿ“š๐Ÿ”—

This tool is your trusty sidekick in the world of bug bounties and penetration testing, making subdomain discovery a breeze! ๐Ÿฆธโ€โ™‚๏ธ๐Ÿ’ผ

Power of Subfinder Subdomain Enumeration ๐ŸŒ๐Ÿ”

Subfinder is a specialized tool for discovering valid subdomains of websites through passive online sources. With its streamlined, modular architecture, Subfinder is optimized for speed and efficiency. It excels in passive subdomain enumeration, focusing solely on this task with high effectiveness. ๐Ÿ’ปโšก๏ธ

# Basic usage to find subdomains for a single domain
subfinder -d example.com -o subdomains.txt

# Find subdomains for multiple domains listed in a file
subfinder -dL domains.txt

# Use all available sources for enumeration (this may be slow)
subfinder -d example.com -all

# Note
Flag -o subdomains.txt used to save output into text file

Widely favored among bug bounty hunters, Subfinder stands out as a top choice due to its speed and effectiveness in uncovering subdomains. ๐Ÿฆธโ€โ™‚๏ธ๐Ÿ’ผ

FFuF: The Furious Web Fuzzer ๐Ÿš€

FFuF (Fuzz Faster U Fool) is your go-to tool for lightning-fast web fuzzing, written in Go. Itโ€™s your Swiss Army knife for brute-forcing domains, discovering directories and files, and fuzzing parameters. Just type โ€œFUZZโ€ and let it do its magic! ๐Ÿ”๐Ÿ’ฅ

# Subdomain Enumeration:
ffuf -u http://FUZZ.example.com -w /path/to/wordlist.txt

# Directory and File Discovery:
ffuf -u http://example.com/FUZZ -w /path/to/wordlist.txt

# Want specific extension output:
ffuf -u http://example.com/FUZZ -w /path/to/wordlist.txt -e .php,.html,.js

# Filtering by Status Codes:
ffuf -u http://example.com/FUZZ -w /path/to/wordlist.txt -mc 200,301

# Subdomain Enumeration with Verbose Output and Custom Headers:
ffuf -u http://FUZZ.example.com -w /path/to/wordlist.txt -H "Host: example.com" -v

Bug bounty hunters swear by FFuF โ€” itโ€™s their first choice for aggressive yet effective reconnaissance in penetration testing and bug hunting adventures. ๐Ÿฆธโ€โ™‚๏ธ๐Ÿ”Ž

Letโ€™s merge these files and harness the combined power of our subdomain discoveries! Together, weโ€™ll conquer the digital landscape! ๐ŸŒ๐Ÿ”“

Supposed here we have used:
website crt.sh โžก๏ธsave subdomainsโžก๏ธ crtsh.txt file
website virustotal โžก๏ธsave subdomainsโžก๏ธ virustotal.txt
Tool Amass โžก๏ธsave subdomainsโžก๏ธ amass.txt
Tool Oneforall โžก๏ธsave subdomainsโžก๏ธ oneforall.txt
Tool Subfinder โžก๏ธsave subdomainsโžก๏ธ subfinder.txt
Tool Ffuf โžก๏ธsave subdomainsโžก๏ธ ffuf.txt

# combine all file
cat crtsh.txt virustotal.txt amass.txt oneforall.txt subfinder.txt ffuf.txt > final-subdomains.txt

After tidying up our list to remove duplicates, itโ€™s time to pinpoint the active host ๐ŸŒŸ ones โ€” those hosts that are ready to chat! ๐ŸŽ‰

Using httpx-toolkit: Fire up httpx for HTTP/HTTPS probing to see which targets are itching to respond to our web requests. ๐Ÿš€๐Ÿ•ต๏ธโ€โ™‚๏ธ

# Example usage to find online hosts using httpx
cat targets.txt | httpx -silent

Using DNSX: Turn to dnsx for quick DNS queries to verify which hosts are proudly sporting active DNS records. ๐ŸŒ๐Ÿ”

# Example usage to find online hosts using dnsx
cat targets.txt | dnsx -silent

Take your pick and letโ€™s uncover those live hosts! Time to knock on digital doors and see whoโ€™s home. ๐Ÿ ๐Ÿ’ป

Ever wondered whatโ€™s behind those mysterious subdomains? Let Eyewitness shed some light! ๐ŸŒŸ

EyeWitness, an open-source cyber sleuth, snaps screenshots of websites, services, and apps on specified hosts. Perfect for pen testers and bounty hunters, it swiftly uncovers and documents web apps across tons of domains or IPs. ๐Ÿ›ก๏ธ๐Ÿ•ต๏ธโ€โ™‚๏ธ

EyeWitness isnโ€™t picky โ€” it handles HTTP, HTTPS, RDP, VNC, and more, making it your all-in-one recon and report buddy. ๐ŸŒ๐Ÿ“ธ

# Basic Screenshot Capture from a List of URLs/subdomains:
EyeWitness.py --web -f urls.txt -d output

# Using with Nmap Results:
EyeWitness.py --web -x nmap_output.xml -d output

# Specifying Custom Ports:
EyeWitness.py --web -f urls.txt --ports 80,443,8080 -d output

Once done, just peek into your output folder for screenshots. Theyโ€™re like digital Polaroids, revealing the secrets of each URL or subdomain. ๐Ÿ–ผ๏ธ๐Ÿ’ป

With this guide, you now have a solid understanding of the basics of TLD, domains, sub-domains, and how to use tools/websites like amass, subfinder, oneforall, virustotal, crt.sh etc. for effective subdomains enumeration. ๐ŸŽฏ๐Ÿ•ต๏ธโ€โ™‚๏ธ

Stay tuned for the next part of this series, where weโ€™ll dive even deeper into advanced recon techniques and uncover more secrets of the digital world. ๐ŸŒ๐Ÿ”โœจ

Until then, happy hunting and keep exploring! ๐Ÿ›๐Ÿ”ฆ

Subdomains Enumeration: Tools, Techniques, and Tips (2024)

References

Top Articles
Latest Posts
Article information

Author: Arline Emard IV

Last Updated:

Views: 6279

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Arline Emard IV

Birthday: 1996-07-10

Address: 8912 Hintz Shore, West Louie, AZ 69363-0747

Phone: +13454700762376

Job: Administration Technician

Hobby: Paintball, Horseback riding, Cycling, Running, Macrame, Playing musical instruments, Soapmaking

Introduction: My name is Arline Emard IV, I am a cheerful, gorgeous, colorful, joyous, excited, super, inquisitive person who loves writing and wants to share my knowledge and understanding with you.