Footprinting & Reconnaissance · Module 02
theHarvester
Gather emails, subdomains and hosts about a target from public (OSINT) sources.
Safe to try on your own machine. Spin up your Kali Linux lab and practice away — on any system you own or have permission to test. That’s exactly how the pros learn.
Definition
theHarvester is an open-source reconnaissance tool that gathers publicly available information about an organization, domain, or target.
Collect emails, subdomains, hostnames, and other publicly indexed assets.
Open-Source Intelligence (OSINT), external attack surface discovery, and authorized penetration testing.
Key features
Finds publicly available email addresses for a domain.
Identifies subdomains reported by supported data sources.
Collects hostnames associated with a target.
Supports many search engines and public datasets.
Can save results in formats such as XML and JSON.
Important commands
theHarvester -hShow command-line help and supported sources.
theHarvester -d example.com -b anubisSearch a domain using a chosen source.
theHarvester -d example.com -b crtshUse the certificate-transparency source.
theHarvester -d example.com -b allTry all supported sources.
theHarvester -d example.com -b anubis -l 100Limit the search to 100 results.
theHarvester -d example.com -b anubis -f resultsSave results to an output file.
Practical examples
theHarvester -d example.com -b anubis
Purpose Collects public info for the domain through the selected source.
theHarvester -d example.com -b anubis -l 100
Purpose Requests up to 100 results, subject to the source.
theHarvester -d example.com -b anubis -f results
Purpose Saves collected results to a file for later use.
Important points
- OSINT: Collects from public sources instead of directly exploiting a target.
- Passive reconnaissance: Many searches use third-party sources, so you rarely touch the target.
- Data-source dependency: Results depend on source availability, indexing and API access.
- API keys: Some sources require an API key or account.
- False positives: Verify collected emails, hosts and subdomains before trusting them.
- Version compatibility: Flags and sources change between releases — check theHarvester -h.
Common use cases
Gather public information about an organization.
Identify publicly indexed organizational emails.
Find subdomains for authorized assessments.
Help spot internet-facing assets that need checking.
Find forgotten or unexpected public-facing assets.
This tool is taught in Module 02
Read the full written notes, with diagrams, defense and detection.