| name | theharvester |
| description | Auth/lab ref: Harvest emails, subdomains, hostnames, employee names, open ports, and banners for a target domain from public sources. |
| license | GPL-2.0 |
| compatibility | Python 3. |
| metadata | {"author":"AeonDave","version":"1.0"} |
theHarvester
Email, subdomain, and hostname harvester from public OSINT sources.
Quick Start
pip install theHarvester
theHarvester -d target.com -b google,bing
theHarvester -d target.com -b all -l 500
theHarvester -d target.com -b google,bing,linkedin -l 300 -f results
Core Flags
| Flag | Purpose |
|---|
-d <domain> | Target domain |
-b <sources> | Data sources (comma-separated or all) |
-l <n> | Limit results per source (default: 500) |
-f <filename> | Save to HTML/XML (no extension needed) |
-n | DNS lookup on discovered hosts |
-c | DNS brute force (uses built-in wordlist) |
-v | Verify hostnames via DNS resolution |
-e <ip> | Use custom DNS server |
-p | Port scan open ports on discovered hosts |
-s <n> | Start result offset |
--screenshot <dir> | Screenshot discovered web services |
Data Sources
-b google,bing,yahoo,duckduckgo,baidu,crtsh,certspotter,hackertarget,dnsdumpster,rapiddns,sublist3r
-b hunter,securitytrails,shodan,censys,fullhunt,intelx,virustotal,bevigil,binaryedge
-b linkedin,linkedin_links
-b all
Common Workflows
Recon on target company:
theHarvester -d corp.com -b google,bing,duckduckgo,crtsh,certspotter,hackertarget -l 500 -f corp_passive
theHarvester -d corp.com -b all -l 1000 -f corp_full
theHarvester -d corp.com -b google,crtsh -v -p -l 200
Email harvest for phishing prep:
theHarvester -d target.com -b google,bing,linkedin,hunter -l 500 -f emails
grep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' results.xml | sort -u > emails.txt
Subdomain discovery:
theHarvester -d target.com -b crtsh,certspotter,dnsdumpster,sublist3r,hackertarget -l 500 -f subdomains
API Keys Setup
apikeys:
hunter:
key: YOUR_KEY
securitytrails:
key: YOUR_KEY
shodan:
key: YOUR_KEY
virustotal:
key: YOUR_KEY
intelx:
key: YOUR_KEY
Parse Output
grep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' results.xml | sort -u
grep -oE '([a-zA-Z0-9_-]+\.)+target\.com' results.xml | sort -u
while read email; do holehe "$email" --only-used; done < emails.txt
Resources
| File | When to load |
|---|
references/sources.md | Full source list, API key setup, output parsing, integration with amass/holehe |