Most penetration testers and bug bounty hunters fail before they ever send an exploit payload. The reason is predictable: they run the exact same noisy, default scans against the exact same main domain (www.target.com) that thousands of other researchers and automated bots have already hammered.
Real vulnerabilities rarely live on hardened, front-facing production servers. They live on forgotten staging environments, misconfigured cloud buckets, undocumented API versions, and legacy microservices exposed during rushed deployments.
This tutorial walks through a complete, end-to-end reconnaissance pipeline—moving from silent infrastructure mapping to deep application-layer enumeration—along with practical field tricks to bypass basic defenses and filter out noise.
Legal Disclaimer: Every technique, command, and workflow demonstrated in this guide is strictly for authorized security assessments, private lab environments, and sanctioned bug bounty programs. Never run active enumeration tools against infrastructure you do not own or have explicit written permission to test.
Phase 1: Recursive Subdomain & Infrastructure Discovery
Standard subdomain enumeration stops at level one (sub.target.com). In enterprise environments, internal tools and staging clusters almost always sit on deeper levels (api-v2.dev.us-east.target.com).
1. Chaining Passive Sources Without API Burnout
Instead of running a single tool and trusting its output, aggregate results from Certificate Transparency (CT) logs, passive DNS databases, and search engine caches, then deduplicate them immediately.
# Create a clean workspace for the target
mkdir -p ~/recon/target.com && cd ~/recon/target.com
# Aggregate passive sources
subfinder -d target.com -all -silent > subs_subfinder.txt
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' > subs_crt.txt
# Merge, normalize, and remove wildcard artifacts
cat subs_*.txt | tr '[:upper:]' '[:lower:]' | sort -u > all_passive_subs.txt
2. Permutation Scanning (Catching Naming Patterns)
Organizations follow predictable naming conventions. If you discover dev-billing.target.com, there is a high probability that staging-billing.target.com, qa-billing.target.com, or dev-billing-v2.target.com also exist—even if they never appeared in public CT logs.
Use permutation tools like alterx combined with a fast DNS resolver like dnsx to generate and validate these patterns:
cat all_passive_subs.txt | alterx -silent | dnsx -silent -a -resp -o resolved_permutations.txt
Pro Tip — Watch Out for Wildcard DNS:
Many targets configure a catch-all wildcard record (*.target.com -> 192.0.2.1) that resolves every random subdomain query to a generic landing page. Before running brute-force or permutation scans, test a guaranteed non-existent subdomain:
dig +short randomstring998877.target.com
If it returns an IP address, filter out responses matching that IP or page size during your HTTP probing phase; otherwise, your dataset will be flooded with false positives.
Phase 2: Intelligent HTTP Probing & Tech Fingerprinting
A list of 5,000 resolved domains is useless until you know which ones are serving HTTP applications, what technology stack they run, and which ones are hiding behind reverse proxies.
Beyond Port 80 and 443
Developers frequently spin up administrative panels, Prometheus metrics, or internal dashboards on alternative HTTP ports. Always probe non-standard web ports alongside standard ones:
cat all_passive_subs.txt | httpx -silent \
-ports 80,443,8080,8443,8000,8888,3000,5000,9000 \
-status-code -title -tech-detect -server -content-length \
-o live_web_assets.txt
Field Tricks for Triaging httpx Output
Once live_web_assets.txt is populated, do not read it line by line. Filter for high-signal anomalies first:
- 403 Forbidden / 401 Unauthorized Targets: These indicate active applications enforcing access controls—prime candidates for path normalization bypasses or default credential testing.
grep -E "\[(401|403)\]" live_web_assets.txt > restricted_assets.txt - 500 / 502 / 503 Server Errors: A
502 Bad Gatewayoften means a reverse proxy (like Nginx or Cloudflare) is routed to an internal backend service that is currently misconfigured or crashing. Keep these on a watchlist. - Unusual Content Lengths: Sort by content length to spot outlier pages (e.g., an exposed debug console or raw JSON response amidst hundreds of identical marketing redirects).
Phase 3: Mining JavaScript Files for Hidden Attack Surface
Modern single-page applications (SPAs) built with React, Vue, or Angular bundle their entire routing table, API endpoints, and occasionally hardcoded secrets directly into client-side .js files.
1. Crawling and Extracting JS URLs
Use katana to crawl live hosts with headless browser rendering enabled so dynamically loaded chunks (chunk-vendors.js, main.hash.js) are captured:
cat live_web_assets.txt | awk '{print $1}' | katana -silent -jc -d 3 -kf all | grep -E "\.js(\?|$)" | sort -u > js_files.txt
2. Extracting Relative Paths & API Routes
Download the discovered JavaScript files locally so you can grep and analyze them offline without triggering rate limits:
mkdir -p js_dump && cd js_dump
cat ../js_files.txt | xargs -P 10 -I {} curl -s -L -O "{}"
Now run regex extraction across the local dump to uncover hidden API routes (/api/v1/internal/..., /graphql, /admin/export):
grep -RhoE "(['\"])/[a-zA-Z0-9_/?=&.-]+\1" . | tr -d "'\"" | sort -u > extracted_endpoints.txt
3. Hunting for Leaked Tokens and Cloud Keys
Before moving on, scan the exact same local JS dump for high-entropy strings, AWS credentials, Firebase configs, or internal staging URLs:
grep -rnE "(AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z\-_]{35}|eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}|s3\.amazonaws\.com|internal\.|staging\.)" .
Phase 4: Parameter Discovery & WAF-Safe Fuzzing
Finding an endpoint like /api/v1/user/profile is only half the battle. If the endpoint expects a hidden query parameter or JSON key (such as ?debug=true, ?role=admin, or ?id=1001), standard directory brute-forcing will never trigger it.
1. Hidden Parameter Mining
Use arjun to test thousands of common parameter names against an endpoint by observing subtle changes in HTTP response size, status codes, or reflection behavior:
arjun -u [https://api.target.com/v1/user/profile](https://api.target.com/v1/user/profile) -m GET -t 10 --rate-limit 5
2. Bypassing Basic Rate Limits & WAF Blocks During Fuzzing
Running ffuf at default speed (-t 40 with no delay) against a target protected by Cloudflare, Akamai, or AWS WAF will get your IP banned within seconds—and worse, every subsequent request will return a fake 403 or 429, corrupting your scan results.
Use these adjustments to stay under threshold:
- Throttle Threads and Inject Jitter: Drop concurrency to 5–10 threads and add a randomized delay (
-p "0.1-0.4"). - Spoof Realistic Headers: Default tool User-Agents (
Fuzz Faster U Fool) are blocked at the edge by signature rules. - Auto-Calibrate Noise (
-ac): Always pass-acinffufso it automatically detects and filters out dynamic custom 404 pages.
ffuf -u [https://staging.target.com/FUZZ](https://staging.target.com/FUZZ) \
-w /usr/share/wordlists/seclists/Discovery/Web-Content/raft-medium-directories.txt \
-H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" \
-H "X-Forwarded-For: 127.0.0.1" \
-t 8 -p "0.1-0.3" -ac \
-mc 200,204,301,302,307,401,403,405
3. Quick 403 Bypass Checks on Restricted Paths
When your fuzzer uncovers an intriguing 403 Forbidden path (like /admin or /metrics), test whether the restriction is enforced at the reverse proxy layer rather than the backend application:
| Technique | Example Request / Header | Why It Works |
|---|---|---|
| Path Normalization | GET /admin/..;/ HTTP/1.1 or GET /%2e/admin |
Reverse proxy fails to match /admin, while backend normalizes path to /admin. |
| Header Override | X-Original-URL: /admin or X-Rewrite-URL: /admin |
Legacy frameworks (Symfony, IIS, older Nginx configs) trust internal rewrite headers. |
| IP Spoofing Headers | X-Forwarded-For: 127.0.0.1 or X-Real-IP: 127.0.0.1 |
ACL rules restrict access to localhost without stripping untrusted client headers. |
| HTTP Method Switching | POST /admin or HEAD /admin instead of GET |
Access control rules are explicitly bound only to GET requests. |
Putting It All Together: A Reusable Bash Wrapper
Manual execution works for learning, but consistency comes from scripting your baseline workflow so every new target goes through the exact same funnel:
#!/usr/bin/env bash
set -euo pipefail
DOMAIN="${1:?Usage: $0 <domain>}"
WORKDIR="recon_${DOMAIN}_$(date +%Y%m%d)"
mkdir -p "$WORKDIR" && cd "$WORKDIR"
echo "[*] Step 1: Passive Subdomain Enumeration for $DOMAIN"
subfinder -d "$DOMAIN" -all -silent | sort -u > subs.txt
echo "[+] Found $(wc -l < subs.txt) unique subdomains."
echo "[*] Step 2: Probing Live Web Services"
httpx -l subs.txt -silent -ports 80,443,8080,8443,3000,8000 \
-status-code -title -tech-detect -o httpx_full.txt
awk '{print $1}' httpx_full.txt > live_urls.txt
echo "[+] Identified $(wc -l < live_urls.txt) live HTTP endpoints."
echo "[*] Step 3: Crawling & Extracting JavaScript Files"
katana -list live_urls.txt -silent -jc -d 2 | grep -E "\.js(\?|$)" | sort -u > js_urls.txt
echo "[+] Collected $(wc -l < js_urls.txt) JavaScript files for offline analysis."
Save this script as recon.sh, make it executable (chmod +x recon.sh), and run ./recon.sh example.com against your lab environment to generate a structured baseline before touching any manual exploitation tools.
