Legal Disclaimer: Ye guide sirf authorized Bug Bounty programs (HackerOne, Bugcrowd, Intigriti) aur personal labs ke liye hai. Kisi bhi target par recon chalane se pehle uska In-Scope list zaroor check karein.
Bug Hunting me Recon sabse zaroori kyun hai?
90% beginners seedha main website (example.com) par bugs dhundhne lagte hain, jahan security sabse strong hoti hai. Pro bug hunters pehle Reconnaissance (Recon) karke target ke chhupe hue subdomains (jaise dev.example.com, staging.example.com, old-api.example.com) nikalte hain — kyunki wahin par misconfigurations, forgotten login panels aur high-severity bugs milte hain.
Phase 1: Passive Subdomain Enumeration (Bina Target ko Touch Kiye)
Passive recon me aap target server ko direct traffic nahi bhejte, balki public sources aur certificate logs se subdomains nikalte hain.
1. Subfinder (Fast & Clean)
# Single domain ke subdomains nikalna
subfinder -d target.com -all -silent -o subs_subfinder.txt
2. Assetfinder
assetfinder --subs-only target.com | tee subs_assetfinder.txt
3. Certificate Transparency (crt.sh) — Terminal Trick
Bina kisi extra tool ke SSL certificate logs se subdomains nikalne ke liye:
curl -s "[https://crt.sh/?q=%25.target.com&output=json](https://crt.sh/?q=%25.target.com&output=json)" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u > subs_crt.txt
4. Sabhi lists ko merge aur deduplicate karein
cat subs_*.txt | sort -u > all_subdomains.txt
wc -l all_subdomains.txt
Phase 2: Live Hosts aur Tech Stack Check Karna (httpx)
Subdomain list me bahut se domains dead ya parked hote hain. httpx aapko sirf chalte hue web servers, unke status code (200, 403, 302), page title aur technology stack dikha deta hai:
cat all_subdomains.txt | httpx -silent -status-code -title -tech-detect -o live_hosts.txt
Pro Tip: Sirf
200 OKmat dekhein —403 Forbiddenaur401 Unauthorizedsubdomains par aksar internal admin panels milte hain jahan 403 bypass ya default credentials try kiye ja sakte hain.
Phase 3: Directory & Hidden File Fuzzing (ffuf)
Live host milne ke baad uspar chhupe hue endpoints (jaise /backup.zip, /.env, /admin, /api/v1) dhundhne ke liye ffuf sabse fast tool hai:
# Common wordlist ke saath directory fuzzing
ffuf -u [https://sub.target.com/FUZZ](https://sub.target.com/FUZZ) -w /usr/share/wordlists/dirb/common.txt -mc 200,204,301,302,403 -t 50
# Specific extensions (.bak, .zip, .env, .php) check karna
ffuf -u [https://sub.target.com/FUZZ](https://sub.target.com/FUZZ) -w /usr/share/wordlists/seclists/Discovery/Web-Content/raft-medium-files.txt -e .php,.bak,.zip,.env,.txt -mc 200,403
Phase 4: Historical URLs aur Parameters Nikalna (XSS / SQLi / SSRF ke liye)
Purane archived URLs me aksar aise parameters (?id=, ?redirect=, ?file=, ?url=) mil jaate hain jinhe developers patch karna bhool gaye hote hain:
# Wayback Machine aur AlienVault se purane URLs nikalna
echo "target.com" | gau --threads 5 | sort -u > all_urls.txt
# Sirf parameter wale URLs filter karna (XSS / SQLi / Open Redirect targets)
cat all_urls.txt | grep "=" | sort -u > params.txt
# Sensitive files (.env, .sql, .log, .json, .js) filter karna
cat all_urls.txt | grep -Ei "\.(env|sql|bak|zip|log|json|config)$"
Pro Bug Hunter One-Liner Automation Pipeline
Agar aapko 2 minute me clean recon shortlist chahiye, to ye chain chalayein:
subfinder -d target.com -silent | httpx -silent -status-code -title -tech-detect | tee recon_summary.txt
Quick Revision Cheatsheet
| Stage | Tool | Command |
|---|---|---|
| Passive Subdomains | Subfinder | subfinder -d target.com -all -silent -o subs.txt |
| SSL Logs Recon | curl + jq | curl -s "https://crt.sh/?q=%25.target.com&output=json" | jq -r '.[].name_value' | sort -u |
| Live Probing | httpx | cat subs.txt | httpx -silent -status-code -title -tech-detect |
| Directory Fuzzing | ffuf | ffuf -u https://target.com/FUZZ -w common.txt -mc 200,301,302,403 |
| Archive URLs | gau | echo "target.com" | gau | grep "=" | sort -u |