Skip to content

theHarvester Executor

Category: Discovery and Reconnaissance Script: theharvester.py Integration: CLI Faraday Plugin: Raw JSON Website: laramies/theHarvester

Description

Runs theHarvester against a domain and imports the IP addresses, subdomains and email addresses it discovers into Faraday.

Prerequisites

  • theHarvester installed and available in the agent's PATH
  • Internet access for theHarvester to query its public sources (some sources need API keys configured in theHarvester itself)

Configuration

Environment Variables (Setup)

This executor does not require setup environment variables.

Execution Arguments

Parameter Type Mandatory Description
THEHARVESTER_DOMAIN string Yes Domain to investigate (e.g., example.com)
THEHARVESTER_SOURCES list No Data sources to query (e.g., crtsh, hackertarget). Default: anubis,crtsh,duckduckgo,hackertarget.
THEHARVESTER_LIMIT integer No Maximum number of results to fetch per source (theHarvester -l). Default: theHarvester's own default.
THEHARVESTER_START integer No Result number to start from (theHarvester -S). Default: theHarvester's own default.

YAML Configuration Example

executors:
  theharvester:
    repo_executor: theharvester.py
    max_size: 65536
    varenvs: {}
    params:
      THEHARVESTER_DOMAIN:
        mandatory: true
        type: string
        base: string
      THEHARVESTER_SOURCES:
        mandatory: false
        type: list
        base: list
      THEHARVESTER_LIMIT:
        mandatory: false
        type: integer
        base: integer
      THEHARVESTER_START:
        mandatory: false
        type: integer
        base: integer

How It Works

  1. Runs theHarvester -d <domain> -b <sources> -f <file> and writes the XML report to a temporary directory
  2. Reads the IP addresses and hosts from the XML report. Each unique IP becomes a host, and the subdomains found for it become its hostnames.
  3. Collects the email addresses into one extra host
  4. Sends the hosts to Faraday

Notes

  • Discovered hosts without an IP address are imported using the hostname in place of the IP, so these entries may need cleanup.
  • Email addresses are not vulnerabilities. They are stored as email:<address> tags on a host named emails.
  • No vulnerabilities are created.
  • The run fails if theHarvester produces no XML report.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.