Listen to this Post

Introduction:
In the high-stakes arena of bug bounty hunting, success is rarely determined by the brilliance of a single exploit—it is forged in the meticulous, methodical hours of reconnaissance that precede every attack. The difference between a hunter who consistently discovers critical vulnerabilities and one who constantly stares at “no bugs found” often lies not in skill, but in the breadth and depth of the attack surface they have mapped. As security researchers know, an overlooked subdomain, a forgotten API endpoint, or an exposed service can be the entry point that leads to a critical finding. This article provides a comprehensive, technical blueprint for building an automated reconnaissance pipeline using industry-standard tools, transforming raw data into actionable intelligence and giving you the edge to spot bugs before anyone else does.
Learning Objectives:
- Master the installation, configuration, and execution of core reconnaissance tools including OWASP Amass, ProjectDiscovery’s Subfinder and httpx, FFUF, and historical URL extractors.
- Construct a fully automated, multi-stage reconnaissance pipeline that integrates passive OSINT, active probing, and fuzzing to comprehensively map an organization’s external attack surface.
- Apply advanced filtering, matching, and automation techniques to efficiently identify live hosts, hidden directories, and vulnerable endpoints from vast datasets.
- Subdomain Enumeration: The Foundation of Attack Surface Mapping
Subdomain enumeration is the cornerstone of any reconnaissance effort. It uncovers the hidden assets—staging servers, development environments, and forgotten applications—that often harbor the most critical vulnerabilities. Two tools stand out in this domain: OWASP Amass and ProjectDiscovery’s Subfinder.
OWASP Amass is an open-source tool that performs network mapping of attack surfaces and external asset discovery using open-source information gathering and active reconnaissance techniques. It combines data from over 80 different sources, including certificate transparency logs, search engines, DNS databases, and brute-forcing. Amass operates through several subcommand modules: `intel` for gathering intelligence, `enum` for enumeration and mapping, `viz` for visualization, and `track` for comparing findings across enumerations.
Step-by-Step Guide:
1. Installation (Linux/Debian-based):
sudo apt install amass Or install the latest version via Go: go install -v github.com/OWASP/Amass/v3/...@master
- Passive Enumeration (Stealthy, Low-1oise): This method queries public data sources without sending any traffic directly to the target, making it safe and不易触发警报.
amass enum -passive -d example.com -o passive_subs.txt
-
Active Enumeration (More Thorough, Higher Noise): This mode performs DNS queries against the target, potentially uncovering deeper assets but also risking detection.
amass enum -active -d example.com -o active_subs.txt
-
Brute-Force Enumeration: This combines passive and active techniques with a dictionary attack to discover subdomains not found in public sources.
amass enum -d example.com -brute -w /path/to/wordlist.txt -o brute_subs.txt
-
Visualization: Generate an HTML graph to understand the subdomain structure and relationships.
amass viz -d example.com -o graph.html
Subfinder is a fast, passive subdomain discovery tool that queries certificate transparency logs, DNS databases, GitHub, and other public sources. It is designed to be useful for bug bounties and safe for penetration testing.
Step-by-Step Guide:
1. Installation:
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
2. Basic Passive Enumeration:
subfinder -d example.com -silent
- Use All Available Sources: Slower but more comprehensive.
subfinder -d example.com -all -silent -o all_subs.txt
4. JSON Output for Automation:
subfinder -d example.com -all -oJ -o subfinder_output.json
- Rate Limiting: Control the request rate to avoid being blocked.
subfinder -d example.com -rl 50 -t 50
-
Live Host & Port Discovery: Separating the Signal from the Noise
Once you have a list of potential subdomains, the next step is to determine which are actually live and what services they are running. `httpx` is a fast and multi-purpose HTTP toolkit designed for this purpose.
Step-by-Step Guide:
1. Installation:
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
- Basic Probing: Check if hosts are live and display status codes, titles, and content length.
cat subdomains.txt | httpx -sc -title -cl
-
Technology Detection: Identify the technologies in use (e.g., Nginx, WordPress).
cat subdomains.txt | httpx -td -server
-
Filter by Status Code: Focus on specific responses, such as 200 (OK) or 403 (Forbidden).
cat subdomains.txt | httpx -mc 200,403,401 -sc
-
Custom Headers for Bypassing WAF: Use headers like `X-Forwarded-For` to potentially bypass IP-based access controls.
cat subdomains.txt | httpx -H "X-Forwarded-For: 127.0.0.1" -sc -title
-
ASN Fingerprinting: Map the network affiliations of various domains.
cat subdomains.txt | httpx -asn
7. CIDR Input: Probe entire network ranges.
echo "173.0.84.0/24" | httpx -silent
- Probe Non-Standard Ports: Scan for services on ports beyond the default 80 and 443.
cat hosts.txt | httpx -ports 8080,8443,8000,3000 -path /admin -status-code
3. Endpoints & Directory Fuzzing: Uncovering the Unlinked
Fuzzing is the process of sending a large number of requests to a target to discover hidden directories, files, and parameters. `FFUF` (Fuzz Faster U Fool) is a fast web fuzzer written in Go, used for directory discovery, parameter fuzzing, and virtual host enumeration.
Step-by-Step Guide:
1. Installation:
go install github.com/ffuf/ffuf@latest
2. Basic Directory Fuzzing:
ffuf -w /path/to/SecLists/Discovery/Web-Content/directory-list-2.3-small.txt:FUZZ -u https://example.com/FUZZ -mc 200,204,301,302,307,401,403
This command uses a wordlist from SecLists and filters for specific status codes.
3. Recursive Fuzzing: Automatically fuzz newly discovered directories.
ffuf -w wordlist.txt:FUZZ -u https://example.com/FUZZ -recursion -recursion-depth 3
4. Parameter Fuzzing: Discover hidden or vulnerable parameters.
ffuf -w /path/to/params.txt:FUZZ -u https://example.com/admin.php?FUZZ=test -fs 1234
The `-fs` flag filters out responses of a specific size, helping to reduce noise.
- Virtual Host Enumeration: Identify other websites hosted on the same IP.
ffuf -w /path/to/vhosts.txt:FUZZ -u https://example.com -H "Host: FUZZ.example.com" -fc 404
-
OSINT & Historical Asset Discovery: Mining the Past for Future Exploits
Historical data from internet archives can reveal endpoints, parameters, and entire applications that are no longer linked from the main site but may still be accessible.
Waybackurls fetches historical URLs from the Wayback Machine (archive.org).
Step-by-Step Guide:
1. Installation:
go install github.com/tomnomnom/waybackurls@latest
2. Basic Usage:
echo "example.com" | waybackurls > wayback_urls.txt
GAU (Get All URLs) fetches known URLs from AlienVault’s Open Threat Exchange, the Wayback Machine, Common Crawl, and URLScan.
Step-by-Step Guide:
1. Installation:
go install github.com/lc/gau/v2/cmd/gau@latest
2. Basic Usage:
echo "example.com" | gau --threads 10 > gau_urls.txt
3. Filtering for Specific File Types:
cat gau_urls.txt | grep ".php" | tee php_urls.txt
4. Extracting Subdomains from Historical Data:
cat domains.txt | waybackurls | unfurl domains | sort -u | anew wayback_subs.txt
5. Building the Automated Recon Pipeline
The true power of these tools is realized when they are chained together into an automated pipeline. Here is a step-by-step guide to building a basic yet effective reconnaissance pipeline:
1. Create a working directory:
mkdir -p ~/recon/target && cd ~/recon/target
2. Passive Subdomain Enumeration:
echo "target.com" | subfinder -all -silent > all_subs.txt amass enum -passive -d target.com >> all_subs.txt
3. Remove Duplicates:
sort -u all_subs.txt > unique_subs.txt
4. Live Host Probing:
cat unique_subs.txt | httpx -sc -title -td -cl -o live_hosts.txt
5. Historical URL Discovery:
echo "target.com" | waybackurls > wayback_urls.txt echo "target.com" | gau --threads 10 >> wayback_urls.txt sort -u wayback_urls.txt > final_historical_urls.txt
- Endpoint Fuzzing (Optional – Be Careful): Only run this on targets you have explicit permission to test.
cat live_hosts.txt | awk '{print $1}' | while read url; do ffuf -w /path/to/wordlist.txt:FUZZ -u $url/FUZZ -mc 200,403 -o "ffuf_$url.json" done
6. Cloud & API Security Reconnaissance
Modern attack surfaces are increasingly dominated by cloud services and APIs. Shodan is an indispensable tool for discovering exposed servers, IoT devices, and SSL certificates.
Shodan CLI Setup and Usage:
1. Installation:
pip install shodan
2. Initialize with API Key:
shodan init YOUR_API_KEY
3. Search for Exposed Services:
shodan search product:mongodb country:US
4. Filtered Search:
shodan search product:nginx country:US city:"New York"
5. Host Lookup:
shodan host 1.1.1.1
6. API Query (for Automation):
curl -s "https://api.shodan.io/shodan/host/1.1.1.1?key=YOUR_API_KEY" | jq '.'
What Undercode Say:
- Key Takeaway 1: Reconnaissance is not a one-time activity but a continuous process. Attack surfaces evolve, and regular, automated recon ensures you don’t miss newly exposed assets.
- Key Takeaway 2: The true value of these tools lies not in their individual capabilities but in how effectively they are integrated into a cohesive, automated pipeline that transforms raw data into actionable intelligence. Success in bug bounty is directly proportional to the quality and depth of your reconnaissance.
Prediction:
- +1: The continued democratization of powerful, open-source reconnaissance tools will lower the barrier to entry for bug bounty hunting, leading to a more diverse and skilled security researcher community.
- +1: As automation in reconnaissance becomes more sophisticated, we will see a shift in focus from manual discovery to the intelligent analysis and prioritization of findings, with AI playing a larger role in triaging and exploiting vulnerabilities.
- -1: Organizations will be forced to adopt more aggressive and sophisticated defense-in-depth strategies, including continuous monitoring of their own attack surfaces and the implementation of deception technologies, as attackers leverage these same tools to find and exploit weaknesses faster than ever before.
▶️ Related Video (82% Match):
🎯Let’s Practice For Free:
🎓 Live Courses & Certifications:
Join Undercode Academy for Verified Certifications
🚀 Request a Custom Project:
Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands
IT/Security Reporter URL:
Reported By: Aminul Islam – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


