Overview
theHarvester is a classic reconnaissance tool for the early stages of an investigation. Give it a domain name and it passively collects emails, subdomains, hostnames, IP addresses and employee names from public sources — search engines, certificate transparency logs, DNS dumps and more.
Security teams run it against their own organisation to map what is exposed before attackers do; investigators run it to expand one domain into a full target list of people, hosts and addresses. Everything it gathers is already public — the skill is in querying broadly and correlating the results, which is exactly what the tool automates.
Key features
- Emails, subdomains, hosts, IPs and employee names per domain
- Passive sources: certificate transparency, DNS dumps, search engines
- XML and JSON output for piping into other tooling
- Screenshot and takeover checks for discovered subdomains
- A standard first step in pentest and red-team recon
- Free and open source (GPL)
Install & first run
# Clone and install (Python 3.9+)
git clone https://github.com/laramies/theHarvester.git
cd theHarvester
pip install -r requirements.txt
## Basic run against a domain
python3 theHarvester.py -d example.com -b all
## Limit sources and save output
python3 theHarvester.py -d example.com -b crtsh,hackertarget -f results
Real-world example
You have just been authorized to test a company's public exposure. Start with theHarvester against their main domain: within minutes you hold a list of employee emails, subdomains and hostnames — the exact raw material an attacker would collect first.
Hand the subdomain list to your DNS checks and the email list to a breach lookup. Every forgotten staging host or exposed webmail login you find becomes a finding in the report, with the remediation advice to inventory subdomains and enforce multi-factor authentication on everything public.
Common questions
Is every result accurate?
No. Sources may be incomplete or stale, so validate findings before reporting them.
Which sources need API keys?
crtsh, certspotter, otx, rapiddns and urlscan need none. Shodan, Hunter, SecurityTrails and similar read keys from api-keys.yaml.
Why does Google return nothing?
Google blocks automated queries quickly. Use bing, duckduckgo or crtsh instead, and keep -l modest.
Is this active scanning?
No - it queries third-party indexes and public sources. Nothing is sent to the target, which is why it is safe at the recon stage.
Related tools
Censys
Search internet-facing hosts and TLS certificates by IP, organisation or domain, then monitor what changes. Freemium web app and API.
dnstwist
Generate look-alike domains - typos, homoglyphs, bitsquatting and TLD swaps - and check which ones are already registered. Free, Python.
Shodan
The search engine for internet-connected devices, services and exposures. Freemium web app plus API.
Keep exploring: browse every investigation type in the OSINT Hub.
Use OSINT tools responsibly — only investigate accounts, people or systems you have a legitimate reason to look into.
