Listen to this Post

Introduction
Subdomain enumeration is a critical skill for cybersecurity professionals, enabling them to identify potential attack surfaces and vulnerabilities in a target domain. Ethical hackers and penetration testers leverage this technique to uncover hidden or forgotten subdomains that may expose sensitive data or misconfigured services. This guide provides verified commands, tools, and methodologies to efficiently extract and validate subdomains.
Learning Objectives
- Learn how to perform subdomain enumeration using industry-standard tools.
- Understand how to verify active subdomains and filter out false positives.
- Discover advanced techniques for automating subdomain discovery in penetration testing.
You Should Know
1. Subdomain Enumeration with Sublist3r
Command:
sublist3r -d example.com -o subdomains.txt
Step-by-Step Guide:
1. Install Sublist3r:
git clone https://github.com/aboul3la/Sublist3r.git && cd Sublist3r pip install -r requirements.txt
2. Run the command above, replacing `example.com` with your target domain.
3. The tool queries multiple search engines and DNS services, saving results to subdomains.txt.
4. Review the output for valid subdomains to investigate further.
2. Active Subdomain Verification with HTTPX
Command:
httpx -l subdomains.txt -status-code -title -tech-detect -o active_subdomains.txt
Step-by-Step Guide:
1. Install HTTPX (requires Go):
go install github.com/projectdiscovery/httpx/cmd/httpx@latest
2. Run the command to check which subdomains from `subdomains.txt` are active.
3. Flags like `-status-code` and `-tech-detect` reveal server responses and technologies used.
4. Results are saved in `active_subdomains.txt` for further analysis.
3. DNS Bruteforcing with dnsrecon
Command:
dnsrecon -d example.com -D wordlist.txt -t brt -c dns_results.csv
Step-by-Step Guide:
1. Install dnsrecon:
sudo apt install dnsrecon
2. Use a wordlist (e.g., subdomains-top1million-5000.txt) to bruteforce common subdomains.
3. The `-t brt` flag specifies bruteforce mode, and results are exported to CSV.
4. Analyze `dns_results.csv` for newly discovered subdomains.
4. Passive Subdomain Discovery with Amass
Command:
amass enum -passive -d example.com -o amass_results.txt
Step-by-Step Guide:
1. Install Amass:
sudo snap install amass
2. The `-passive` flag ensures no direct interaction with the target, reducing detection risk.
3. Results are stored in amass_results.txt, including subdomains from certificates, archives, and APIs.
5. Automating Enumeration with Subfinder
Command:
subfinder -d example.com -all -o subfinder_results.txt
Step-by-Step Guide:
1. Install Subfinder:
go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
2. The `-all` flag enables all sources (DNS, APIs, search engines).
3. Combine with other tools like `httpx` for active verification.
What Undercode Say
- Key Takeaway 1: Subdomain enumeration is the first step in mapping an organization’s attack surface. Overlooked subdomains often host outdated or vulnerable services.
- Key Takeaway 2: Automation (e.g., combining Sublist3r, Amass, and HTTPX) significantly improves efficiency in large-scale assessments.
Analysis:
Subdomain discovery is foundational for both offensive and defensive security. Attackers use these techniques to find weak points, while defenders proactively identify and secure exposed assets. As organizations expand their digital footprint, subdomain sprawl increases risks like subdomain takeovers or credential leaks. Future advancements in AI-driven enumeration (e.g., ML-based wordlist generation) will further streamline reconnaissance, making continuous monitoring essential for robust security postures.
Relevant Courses by Zlatan H.:
For more tools and updates, follow Zlatan H. on Twitter or visit Z-Security.
IT/Security Reporter URL:
Reported By: Zlatanh Extract – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


