Lab 14: Advanced Reconnaissance

Objective

Perform systematic black-box reconnaissance against a target web application from Kali Linux:

  1. Active port and service scanning — nmap fingerprinting to identify what's running

  2. Directory brute-force — gobuster to discover hidden endpoints (/_internal/debug, /.env, /backup.zip)

  3. Technology fingerprinting — whatweb to identify frameworks, versions, and server headers

  4. Sensitive file discovery — find exposed credentials, config files, and backup archives

  5. Build a recon report — synthesise findings into an attack-surface map


Background

Reconnaissance is the first phase of every engagement. The goal is maximum information with minimum noise — understanding what the target runs, what's exposed, and where the attack surface is before touching any vulnerability.

Real-world examples:

  • 2020 SolarWinds — attackers spent weeks in the reconnaissance phase mapping internal network topology via Orion before deploying SUNBURST. Deep recon enabled surgical targeting.

  • 2021 Accellion FTA — attackers used automated recon to identify Accellion FTA instances (outdated file transfer appliance); .env files exposed via directory traversal revealed DB credentials.

  • 2022 Twilio breach — attacker reconnaissance on GitHub found Twilio employee credentials in public commit history before launching phishing; recon reduced the attack to a single targeted SMS.

  • Everyday bug bounty — ~60% of valid P1 bugs start with directory/subdomain brute-force finding hidden admin panels, backup files (db.sql.gz), or exposed .git directories.

OWASP: A05:2021 Security Misconfiguration, A06:2021 Vulnerable/Outdated Components


Architecture

Time

45 minutes


Lab Instructions

Step 1: Setup — Target with Hidden Surface


Step 2: Launch Kali — Port Scan + Service Fingerprint

📸 Verified Output:

📸 Verified Output:


Step 3: robots.txt — Recon Gift

📸 Verified Output:


Step 4: Directory Brute-Force with gobuster

📸 Verified Output:

📸 Verified Output:


Step 5: Harvest Credentials

📸 Verified Output:


Step 6: Headers Analysis + Info Leakage


Steps 7–8: Recon Report + Cleanup


Remediation

  • Never serve .env, backup.zip, or any config file via the web server

  • Bind internal endpoints to 127.0.0.1 only — never 0.0.0.0

  • Remove debug/verbose endpoints before deploying to production

  • Add X-Frame-Options, X-Content-Type-Options, Content-Security-Policy headers

  • Set Server: header to a generic value or remove it entirely

  • robots.txt should not list security-sensitive paths (it's public!)

  • Remove all legacy API versions (/api/v0/) from production

Further Reading

Last updated