theHarvester Guide: Email and Subdomain Gathering
Learn theHarvester for passive reconnaissance including email harvesting, subdomain discovery, IP enumeration, and virtual host identification.
Why You Need theHarvester
You need to gather intelligence about a target before launching any active tests — theHarvester collects emails, subdomains, IPs, and virtual hosts from public sources like search engines, PGP servers, and Shodan. It is the first tool to run during passive reconnaissance.
Prerequisites
How theHarvester Works
Search Engines: Google, Bing, Yahoo for email and domain info.
PGP Key Servers: Extract emails from PGP associations.
Certificate Transparency: Use crt.sh for subdomains via SSL logs.
DNS: Query DNS records for subdomain discovery.
Installation
sudo apt install theharvester
Basic Usage
theHarvester -d example.com -b google
theHarvester -d example.com -b google,linkedin,bing
Data Sources
theHarvester -d example.com -b google,bing,crtsh,dns
theHarvester -d example.com -b all -l 1000
Real-World Example
theHarvester -d target.com -b google,bing -l 500 -f target-recon.html
theHarvester -d target.com -b crtsh,dns -l 1000
theHarvester -d target.com -b google,bing,crtsh,dns,pgp -l 500 -v
Common Mistakes
Not using multiple sources. Overlooking rate limits. Trusting unverified results.
Best Practices
Use multiple sources. Save results to file. Verify with -v. Combine with other tools.
Related Tools
Related Articles
Summary
theHarvester is an essential OSINT tool for gathering emails, subdomains, and IPs from public sources.