Reconnaissance is the initial, foundational phase of the Cyber Kill Chain and ethical penetration testing. Over 80% of a penetration tester's time is invested in gathering intelligence about target networks, exposed servers, employee emails, leaked credentials, and third-party SaaS tools. Reconnaissance is divided into Passive Recon (OSINT) and Active Recon.
Search engines continuously index the public internet. Hackers use specialized Google search operators ("Google Dorks") to locate accidentally exposed configuration files, database backups, and unauthenticated administrative portals:
| Google Dork Query | Intelligence Target Uncovered |
|---|---|
filetype:env "DB_PASSWORD" |
Finds accidentally committed .env files containing cleartext database credentials and API keys. |
filetype:sql "INSERT INTO" "password" |
Locates public database dump files left on open web directories. |
inurl:admin "login" site:example.com |
Identifies hidden administrative login portals on the target domain. |
intitle:"index of /" "backup.zip" |
Discovers open Apache/Nginx directory listings hosting compressed site backups. |
filetype:pdf "confidential" site:example.com |
Unearths internal corporate reports, contracts, and confidential strategic memos. |
Unlike Google which indexes HTML web page content, Shodan continuously crawls the internet grabbing service banner responses from public IP addresses across all ports (industrial control systems, IoT webcams, database servers, and routers):
# 1. Locate exposed MongoDB databases with authentication disabled
product:"MongoDB" -authentication
# 2. Find exposed remote desktop (RDP) servers in a specific country
port:3389 country:"IN"
# 3. Find unpatched Apache servers running in a specific subnet
net:198.51.100.0/24 product:"Apache"
# 4. Search for default camera streaming portals
"Server: webcam" title:"Live View"
Attackers uncover forgotten development servers (e.g. dev.example.com, staging-api.example.com) using automated subdomain tools that query Certificate Transparency (CT) logs:
# Query public Certificate Transparency logs via crt.sh
curl -s "https://crt.sh/?q=%25.example.com&output=json" | jq -r '.[].name_value' | sort -u
# Subdomain enumeration using subfinder
subfinder -d example.com -o subdomains.txt
Broaden your defensive and offensive security knowledge across our curriculum:
Transitioning from passive domain intelligence to active network service probing.
Where intelligence gathering fits into the 7 phases of ethical hacking.
Using OSINT employee reconnaissance to craft believable spear phishing lures.
Google Dorks cheat sheet, Shodan search queries, and sub-domain enumeration tools.