theHarvester Guide: Email and Subdomain Gathering
Learn theHarvester for passive reconnaissance including email harvesting, subdomain discovery, IP enumeration, and virtual host identification.
Why You Need theHarvester
You need to gather intelligence about a target before launching any active tests — theHarvester collects emails, subdomains, IPs, and virtual hosts from public sources like search engines, PGP servers, and Shodan. It is the first tool to run during passive reconnaissance.
Prerequisites
How theHarvester Works
Search Engines: Google, Bing, Yahoo for email and domain info.
PGP Key Servers: Extract emails from PGP associations.
Certificate Transparency: Use crt.sh for subdomains via SSL logs.
DNS: Query DNS records for subdomain discovery.
Installation
sudo apt install theharvester
Basic Usage
theHarvester -d example.com -b google
theHarvester -d example.com -b google,linkedin,bing
Data Sources
theHarvester -d example.com -b google,bing,crtsh,dns
theHarvester -d example.com -b all -l 1000
Real-World Example
theHarvester -d target.com -b google,bing -l 500 -f target-recon.html
theHarvester -d target.com -b crtsh,dns -l 1000
theHarvester -d target.com -b google,bing,crtsh,dns,pgp -l 500 -v
Common Mistakes
Not using multiple sources. Overlooking rate limits. Trusting unverified results.
Best Practices
Use multiple sources. Save results to file. Verify with -v. Combine with other tools.
Related Tools
Related Articles
Summary
theHarvester is an essential OSINT tool for gathering emails, subdomains, and IPs from public sources.
Knowledge Check
-b specify?-f do?Frequently Asked Questions
Continue Learning
Nmap Beginner Tutorial: Mastering Network Scanning
Learn Nmap from scratch covering host discovery, port scanning, service detection, NSE scripts, and practical examples.
Tools · BeginnerWhatWeb Guide: Website Fingerprinting & Technology Detection
Complete WhatWeb guide for website fingerprinting and technology detection. Learn CMS identification, version detection, plugin usage, aggression levels, and practical reconnaissance techniques.
Tools · BeginnerEnum4Linux Guide: Windows/Samba Enumeration
Learn Enum4Linux for enumerating Windows and Samba systems including user lists, shares, groups, and security policy information.
Tools · BeginnerHow to Use FFUF: Beginner's Guide to Fast Web Fuzzing in Kali Linux
Learn how to use FFUF in Kali Linux — directory, subdomain and vhost fuzzing, parameter testing, filters and a worked DVWA example, with a cheat sheet.
Related Security Tools
theHarvester
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.
Information GatheringMaltego
Learn how to use Maltego, the graphical OSINT and link analysis tool: install the free Community Edition, add entities to a graph, run transforms and read the relationships between domains, IP addresses, organizations, people, and other entities.
Information GatheringRecon-ng
Recon-ng is a full-featured Web Reconnaissance Framework focused on open source intelligence. It provides a powerful environment to conduct web-based reconnaissance quickly and thoroughly via community modules.
Information GatheringDMitry
DMitry (Deepmagic Information Gathering Tool) is a command-line application that can gather as much information as possible about a host, including subdomains, email addresses, uptime information, and TCP port scans.