root@sparrow:~/writeups$ cat theharvester.md
// recon
theHarvester
21 Jul 2026
· 3 min read
theHarvester is an OSINT tool that collects emails, employee names, hosts and subdomains for a domain by querying public sources such as search engines, certificates and third-party APIs. It is one of the first pieces of the reconnaissance phase, because it maps out an organization's external attack surface without directly touching its systems. It is run with-dfor the domain and-bto pick the sources.
The key nuance is the difference between passive and active collection. With -b you query third-party sources and leave no trace on the target, but options like -c (DNS brute force) or -p (port scanning) do generate direct traffic against the infrastructure. On top of that, many sources (Shodan, Censys, SecurityTrails, Intelligence X, GitHub) require an API key configured in api-keys.yaml: without one, those sources return little or nothing.
1. Beginner level — sources and basic collection

| Command | What it does |
|---|---|
theHarvester -d dom.com -b all | OSINT from all sources |
theHarvester -d dom.com -b google | Google only |
theHarvester -d dom.com -b bing | Bing only |
theHarvester -d dom.com -b linkedin | Employees on LinkedIn |
theHarvester -d dom.com -b crtsh | Subdomains via crt.sh |
theHarvester -d dom.com -l 500 -b google | Limit the results |
theHarvester -d dom.com -b all -f out | Save to HTML/XML |
theHarvester -d dom.com -b all -S 100 | Start at result N |
theHarvester -d dom.com -b dnsdumpster | Subdomains via DNSdumpster |
theHarvester -h | Show the help |
theHarvester -d dom.com -b hackertarget | HackerTarget source |
theHarvester -d dom.com -b otx | AlienVault OTX |
theHarvester -d dom.com -b duckduckgo | DuckDuckGo source |
theHarvester -d dom.com -b all -v | Verify the hosts (resolve) |
2. Advanced level — active DNS and APIs

| Command | What it does |
|---|---|
theHarvester -d dom.com -b all -f report | Full report (JSON/XML) |
theHarvester -d dom.com -b all -n | Reverse DNS lookup of the range |
theHarvester -d dom.com -b all -c | DNS brute force |
theHarvester -d dom.com -b all -t | Detect typo domains (TLD) |
theHarvester -d dom.com -b shodan | Enrichment with Shodan (API) |
theHarvester -d dom.com -b censys | Data from Censys (API) |
theHarvester -d dom.com -b all -p | Port scan of the found hosts |
theHarvester -d dom.com -b securitytrails | SecurityTrails source (API) |
theHarvester -d dom.com -b all -r | DNS resolution of the results |
cat ~/.theHarvester/api-keys.yaml | Configure the API keys |
theHarvester -d dom.com -b github-code | Search in GitHub code |
theHarvester -d dom.com -b all -e 8.8.8.8 | Specific DNS server |
theHarvester -d dom.com -b all | tee harvest.txt | Save all the output |
theHarvester -d dom.com -b intelx | Intelligence X source (API) |
3. Details people miss
-b allis slow and noisy: it walks through every source and some fail on timeout or rate limit. For quick recon, pick specific sources (-b crtsh,bing,otx) instead of all of them.- Paid sources (Shodan, Censys, SecurityTrails, Intelligence X, GitHub) need an API key in
~/.theHarvester/api-keys.yaml. If you don't set it, those sources are silently skipped and you'll think there's no data. -bis passive (it queries third parties), but-c,-pand-ndirectly touch the target's infrastructure. Don't use them without explicit authorization if you need to stay off the radar.- Always verify subdomains with
-vor-r: many sources return historical or non-existent hosts, and resolving them via DNS leaves you only the ones that are live. - The binary name has an internal capital letter: it's
theHarvester, nottheharvester. It's a very common typo that makes the command fail.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.