GO KALI FREE
BeginnerTools

theHarvester Guide: Email and Subdomain Gathering

Learn theHarvester for passive reconnaissance including email harvesting, subdomain discovery, IP enumeration, and virtual host identification.

#theharvester#OSINT#reconnaissance#email harvesting#subdomain enumeration

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

  • Understanding of OSINT concepts
  • Basic knowledge of DNS and web technologies
  • Authorization for target domains
  • 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

  • Recon-ng: Modular reconnaissance framework
  • Maltego: Graphical link analysis
  • Amass: In-depth subdomain enumeration
  • Related Articles

  • OSINT Introduction
  • Gobuster Guide
  • Summary

    theHarvester is an essential OSINT tool for gathering emails, subdomains, and IPs from public sources.

    Knowledge Check

  • What can theHarvester gather?
  • What does -b specify?
  • How to verify discovered hostnames?
  • Why use multiple sources?
  • What does -f do?
  • Frequently Asked Questions

    What is theHarvester?

    theHarvester is an OSINT tool that gathers emails, subdomains, IPs, and virtual hosts from public sources like search engines, PGP key servers, and certificate transparency logs. It is pre-installed on Kali Linux.

    What does the -b flag do in theHarvester?

    The -b flag specifies the data source(s) to query, such as google, bing, crtsh, or dns. Use -b all to query every available source, or combine multiple sources for comprehensive results.

    How do you verify discovered hostnames?

    Use DNS resolution to verify discovered subdomains by checking if they resolve to valid IP addresses. Combine with tools like dnsx or simple dig/ nslookup commands to validate each hostname.

    Why use multiple data sources?

    Different sources return different results. Search engines find indexed pages, crt.sh reveals certificate-registered subdomains, and DNS queries find hidden records. Combining sources maximizes coverage.

    What does the -f flag do?

    The -f flag saves results to an HTML file (e.g., -f report.html). This provides a formatted report of all discovered emails, subdomains, and IPs for documentation and further analysis.

    What does the -l flag control?

    The -l flag limits the number of results per source (e.g., -l 500). Setting this prevents excessive queries and keeps results manageable, especially when using broad sources like Google.

    How does certificate transparency (crtsh) work?

    crt.sh logs all SSL/TLS certificates issued by certificate authorities. By querying crt.sh, theHarvester discovers subdomains from certificate transparency records, which often reveal internal hostnames.

    What does the -v flag do?

    The -v flag enables verbose mode, showing DNS resolution results for discovered hostnames. This helps verify which subdomains are active without running separate DNS checks.

    Continue Learning

    Tools · Beginner

    Nmap Beginner Tutorial: Mastering Network Scanning

    Learn Nmap from scratch covering host discovery, port scanning, service detection, NSE scripts, and practical examples.

    Tools · Beginner

    WhatWeb 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 · Beginner

    Enum4Linux Guide: Windows/Samba Enumeration

    Learn Enum4Linux for enumerating Windows and Samba systems including user lists, shares, groups, and security policy information.

    Tools · Beginner

    How 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

    Information Gathering

    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 Gathering

    Maltego

    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 Gathering

    Recon-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 Gathering

    DMitry

    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.

    Written by GO KALI FREE Team