Information Gathering
Learn how to use theHarvester in Kali Linux: gather emails, subdomains, employee names, open ports, and banners from public sources with a step-by-step first scan, API keys, and worked examples for authorized OSINT recon.
sudo apt install theharvester
theHarvester -d <domain> -b <source> [options]
theHarvester is a free, open-source Python OSINT tool from the laramies/theHarvester project on GitHub, and it comes pre-installed on Kali Linux. You use it by supplying a domain and one or more sources — for example, `theHarvester -d example.com -b crtsh,certspotter` — then reviewing the returned emails, subdomains, IPs, URLs, and ASNs. Current releases are roughly versions 4.6–4.9.
A beginner's first-run loop is simple: verify the Kali installation with `theHarvester -h`, or install it with `sudo apt install theharvester` if needed. Run a no-API-key scan with crtsh and certspotter, then read the Emails, Subdomains/Hosts, IPs, URLs, and ASNs sections and note each source tag. Next, add the needed credentials to `api-keys.yaml`, rerun with API-backed sources, and save a report with `-f`. Finally, copy the discovered subdomains into a clean list, verify which ones resolve or respond, and hand the live hosts to httpx or Nmap for the next authorized inventory step.
For an illustrative first scan, run `theHarvester -d example.com -b crtsh,certspotter -l 500 -f first-scan`. In Subdomains/Hosts, `[crtsh] api.example.com` means the crtsh source found a certificate-derived hostname; `[crtsh] mail.example.com` is a second candidate, not proof of a live mail service. Resolve or validate both before passing them onward. These certificate sources may leave Emails and IPs empty. In a broader follow-up, the Emails line `[bing] admin@example.com` means Bing returned that address from indexed data, not that the mailbox is valid; the IPs line `[dnsdumpster] 93.184.216.34` means DNSDumpster linked that IP to the domain. The bracketed label provides source attribution. Check scope, deduplicate results, use `-v` or `-n` to verify hosts, and open `first-scan.html` to review the saved report.
By default, theHarvester is passive: it queries third-party sources and never touches the target's servers. Adding `-s` enables active DNS brute-force, so use it only for a domain you own or have written authorization to test. The Google source is deprecated in newer releases; start with crtsh and certspotter instead. If a search returns nothing, check for source rate limits, retry later, and try other sources. Consider `-s` only when active testing is in scope, not as a routine workaround.
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.
| Command | Purpose |
|---|---|
uv run theHarvester -d <authorized-domain> -b crtsh,certspotter | Use passive certificate sources. |
uv run theHarvester -d <authorized-domain> -b subdomains | Run the current subdomain source category. |
uv run theHarvester -d <authorized-domain> -b emails,urls,certspotter | Collect email, URL, and certificate-source results. |
uv run theHarvester -d <authorized-domain> -b crtsh,certspotter -f <report-basename> | Save results under the specified basename. |
uv run theHarvester -d <authorized-domain> -b emails,ips,urls --no-hosts -f <report-basename> | Collect non-host result categories and write reports. |
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 domaintheHarvester -d example.com -b duckduckgoDuckDuckGo search — Gather emails and subdomains without an API keytheHarvester -d example.com -b certspotterCertSpotter — Discover subdomains from certificate transparency logs, no API key neededtheHarvester -d example.com -b hackertargetHackertarget — Query Hackertarget for subdomains and DNS datatheHarvester -d example.com -b otxAlienVault OTX — Query OTX threat intelligence for subdomains and IPstheHarvester -d example.com -b githubGitHub search — Find emails and code references in public repositories (requires API key)theHarvester -d example.com -b crtsh -e 8.8.8.8Custom DNS server — Resolve discovered subdomains using Google DNS (8.8.8.8)Map 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.
Information Gathering
Learn how to use Subfinder in this beginner tutorial, from installing ProjectDiscovery's passive subdomain tool to running and reading your first authorised scan. Add API keys for wider coverage, save clean results, and chain Subfinder into httpx to validate live web hosts before further testing.
Information Gathering
OWASP Amass is the industry-standard in-depth network mapping and attack surface discovery tool. It uses active and passive techniques, scraping 20+ public data feeds, DNS enumeration, and certificate transparency logs to discover subdomains, IP addresses, and ASN data — making it essential for penetration testing, bug bounty hunting, and enterprise security assessments.
Information Gathering
DNSenum is a multithreaded Perl script for DNS enumeration that discovers DNS records, attempts zone transfers, brute-forces subdomains, and performs reverse lookups. It is a foundational reconnaissance tool in Kali Linux for mapping a target domain's DNS infrastructure.
Information Gathering
Learn how to use Nmap, the free open-source network scanner: run your first port scan, discover live hosts, detect services and operating systems, and check for vulnerabilities with NSE scripts — a beginner tutorial for Kali Linux.
Information Gathering
Whois is a query and response protocol used for querying databases that store registered users of Internet resources. It provides information about domain registration, ownership, registrar details, name servers, and expiration dates for any domain or IP address block.
Information Gathering
dig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s).
Learn a complete reconnaissance workflow combining OSINT, DNS enumeration, subdomain discovery, and active scanning for comprehensive target profiling.
Tools · BeginnerLearn theHarvester for passive reconnaissance including email harvesting, subdomain discovery, IP enumeration, and virtual host identification.
OSINT · IntermediateMaster email enumeration techniques using theHarvester, search engines, and certificate transparency logs. Learn corporate email pattern discovery, employee identification, and attack surface mapping.
OSINT · IntermediateMaster passive reconnaissance techniques for stealthy information gathering. Learn to use OSINT tools without direct target interaction for penetration testing and security assessments.
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). A first scan such as `theHarvester -d example.com -b crtsh,certspotter -l 500 -f first-scan` prints lines like `[crtsh] api.example.com` and `[crtsh] mail.example.com` under Subdomains/Hosts — each line is a certificate-derived candidate hostname, not proof the host is live, so verify it with `-v` or `-n` before passing it on. An Emails line such as `[bing] admin@example.com` means Bing returned that address from indexed data, not that the mailbox is valid. Focus on email addresses for phishing-campaign planning, subdomains for attack surface mapping, and open ports for service enumeration, and open the saved `first-scan.html` report to review everything in one place.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.