Information Gathering
theHarvester is a comprehensive OSINT tool for gathering email addresses, subdomains, employee names, open ports, and banners from public sources including search engines, PGP key servers, Shodan, and DNS databases for passive reconnaissance and attack surface mapping.
sudo apt install theharvester
theHarvester -d <domain> -b <source> [options]
theHarvester is a Python-based OSINT tool designed for passive reconnaissance. It gathers publicly available information about a target domain including email addresses, subdomains, employee names, open ports, and service banners from multiple public sources without directly interacting with the target infrastructure.
The tool queries search engines (Google, Bing, Yahoo, DuckDuckGo), certificate transparency logs (crt.sh), DNS databases (DNSDumpster, PassiveTotal), and specialized APIs (Shodan, Hunter, SecurityTrails) to compile a comprehensive intelligence report. This passive approach makes theHarvester ideal for early-stage reconnaissance where minimal detection risk is required.
theHarvester is essential for penetration testers, red teamers, bug bounty hunters, and security auditors who need to map an organization's external attack surface before launching active scanning. The discovered emails feed into phishing campaigns, subdomains reveal forgotten infrastructure, and employee names enable social engineering attacks.
theHarvester -d example.com -b googleGoogle search — Gather emails and subdomains using Google search enginetheHarvester -d example.com -b bingBing search — Discover emails and subdomains via Bing search enginetheHarvester -d example.com -b allAll sources — Run enumeration across all supported public engines and APIstheHarvester -d example.com -b linkedinLinkedIn search — Find employee names and professional profilestheHarvester -d example.com -b bing -l 200Limit results — Restrict Bing search to first 200 resultstheHarvester -d example.com -b google -f report.htmlHTML output — Save results to an HTML report filetheHarvester -d example.com -b all -sDNS brute-force — Enable DNS brute-force subdomain enumerationtheHarvester -d example.com -b crtshCertificate transparency — Query crt.sh for subdomains via CT logstheHarvester -d example.com -b shodanShodan search — Query Shodan for open ports and banners (requires API key)theHarvester -d example.com -b hunterHunter search — Query Hunter.io for corporate email patterns (requires API key)theHarvester -d example.com -b securitytrailsSecurityTrails — Query SecurityTrails for historical DNS and subdomain data (requires API key)theHarvester -d example.com -b dnsdumpsterDNSDumpster — Query DNSDumpster for DNS reconnaissance and subdomain discoverytheHarvester -d example.com -b bing -l 500 -f report.html -sCombined scan — Bing search with 500 limit, DNS brute-force, and HTML outputtheHarvester -d example.com -b all -s -f output.html -nFull scan — All sources with DNS brute-force, HTML output, and DNS resolutiontheHarvester -d example.com -b google -cVirtual hosts — Discover virtual hosts hosting the target domainMap the target's external attack surface before active scanning. Discover subdomains, email patterns, and exposed services to identify potential vulnerabilities.
Identify all public-facing assets including subdomains, email infrastructure, and open services for comprehensive security assessments.
Gather intelligence on organizational structure, employee emails, and technology stack from public sources for penetration testing engagements.
Extract employee names and email patterns from LinkedIn and search engines to build credential lists for brute-force or phishing attacks.
Discover forgotten subdomains, staging environments, and internal applications exposed to the internet through certificate transparency logs.
Build targeted email lists and understand corporate email naming patterns for realistic phishing simulations during authorized engagements.
| Feature | theHarvester | Amass | Subfinder |
|---|---|---|---|
| Primary Focus | Emails + subdomains + OSINT | Attack-surface mapping | Subdomains only |
| Email Discovery | Yes (core feature) | No | No |
| Subdomain Sources | 20+ mixed sources | 40+ (deepest) | 40+ passive |
| Open Ports / Banners | Yes (via Shodan) | Limited | No |
| Employee Names | Yes (search engines) | No | No |
| Speed | Fast | Slow (thorough) | Very fast |
| Best For | Broad OSINT footprint | Enterprise mapping | Quick subdomain lists |
| Feature | theHarvester | DNSenum | Nmap |
|---|---|---|---|
| Approach | Passive (third-party) | Active (queries target DNS) | Active (probes hosts) |
| Detection Risk | Very low | Medium | High |
| Touches Target? | No (queries public sources) | Yes (DNS servers) | Yes (ports/services) |
| Data Returned | Emails, subdomains, names | DNS records, subdomains | Ports, services, OS |
| Recon Phase | First (footprinting) | Second (DNS mapping) | Third (scanning) |
| Feature | Search Engines | Certificate Logs | Security APIs |
|---|---|---|---|
| Examples | google, bing, yahoo, duckduckgo | crtsh, certspotter | shodan, hunter, securitytrails |
| Best For | Emails + employee names | Reliable subdomains | Ports, patterns, history |
| API Key Needed | No | No | Yes (most) |
| Rate-Limit Risk | High (429/CAPTCHA) | Low | Depends on tier |
| Reliability | Variable | High | High |
theHarvester is a broad OSINT collector that gathers emails, employee names, subdomains, ports, and banners from search engines and public APIs. Subfinder is a specialized subdomain-discovery tool that pulls from far more certificate transparency and DNS sources. Use theHarvester for people-and-email intelligence; use Subfinder for exhaustive subdomain enumeration.
Free sources that need no key include crtsh (certificate transparency), duckduckgo, bing, otx, rapiddns, and threatminer. Sources that require an API key include shodan, hunter, securitytrails, censys, and github. Add keys to the api-keys.yaml file; most providers offer a limited free tier.
Yes. theHarvester discovers emails passively through search engines (Google, Bing), LinkedIn, and Hunter.io without any DNS brute-force. The -s flag enables DNS brute-force for subdomains, not emails. For email-only discovery, omit -s and use -b google,bing,hunter.
Use the -f flag to write output to a file: theHarvester -d example.com -b all -f report. Modern versions produce an HTML report plus a JSON file. For CSV, parse the JSON output. Store one report per engagement with a dated filename and sanitize before sharing.
Yes. theHarvester is actively maintained by Christian Martorella (laramies) and contributors on GitHub, with regular releases that add new data sources and fix broken scrapers. Keep it updated with apt upgrade, pipx upgrade, or pulling the latest Docker image for reliable results.
theHarvester focuses on email and subdomain discovery from search engines and public APIs with a simple single-command interface. Recon-ng is a full-featured reconnaissance framework with modules for multiple OSINT tasks, database storage, and reporting. Use theHarvester for quick email discovery; Recon-ng for structured multi-phase campaigns.
Subdomain Discovery
OWASP subdomain discovery tool combining passive and active techniques with 40+ data sources for enterprise-level attack surface mapping.
Subdomain Discovery
Fast passive subdomain discovery tool using 40+ public data sources without querying the target directly.
Network Scanner
Network scanner for port discovery, service detection, and OS fingerprinting across networks.
DNS Enumeration
DNS enumeration tool for zone transfers, subdomain brute-force, and DNS record analysis.
Domain Intelligence
Query domain registration data including registrar, owner, creation date, and name servers.
DNS Analysis
DNS query tool for detailed record lookups, zone transfers, and DNS troubleshooting.
theHarvester output is organized into structured blocks: Emails (discovered email addresses with source attribution), Subdomains (DNS-resolved subdomains with IP addresses), Hosts (resolved IP addresses and open ports), Virtual Hosts (web servers hosting the domain), Banners (service banners from Shodan), and Employee Names (LinkedIn and social media profiles). Focus on email addresses for phishing campaigns, subdomains for attack surface mapping, and open ports for service enumeration.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.