theHarvester

August 20, 2026 ยท View on GitHub

theHarvester logo

Python CI Docker CI

theHarvester gathers open-source intelligence about a domain or organization from search engines, certificate transparency logs, DNS datasets, code repositories, threat-intelligence platforms, and other public sources.

Use theHarvester during the early reconnaissance stage of an authorized security assessment. Run it only against targets you own or have explicit permission to test.

What it does

theHarvester combines many public data sources in one run and normalizes their results. It can collect hostnames, email addresses, IP addresses, URLs, ASNs, people, and breach names. Optional actions cover DNS, RouteViews, Shodan, takeover checks, virtual hosts, API paths, and screenshots.

Use the CLI for one-off work or HarvestView for a local browser workflow. JSONL and SQLite retain structured evidence and provenance. JSON and XML remain available for existing integrations.

Providers control their own availability, quotas, and response formats, so individual sources may change independently of theHarvester.

Package versions

Packaging status

Architecture at a glance

Discovery routes and enrichment

theHarvester discovery routes and enrichment

HarvestView run desk

HarvestView run desk architecture

Quick start

theHarvester requires Python 3.14. The repository's .python-version lets uv select it automatically:

git clone https://github.com/laramies/theHarvester.git
cd theHarvester
uv sync
uv run theHarvester -d example.com -b crtsh,certspotter

See the installation guide for platform-specific setup and packaged distributions.

Common workflows

Query several passive sources:

uv run theHarvester -d example.com -b crtsh,certspotter,commoncrawl

Three discovery sources run at once by default. Use -j or --source-workers to change the worker count. The REST API and HarvestView expose the same setting.

Run every source that can contribute subdomains:

uv run theHarvester -d example.com -b subdomains

Combine capability selectors, or mix them with explicit source names:

uv run theHarvester -d example.com -b emails,urls,certspotter

Capability selectors form a union and choose which sources run. They do not discard other result types returned by those sources. Available selectors are subdomains, emails, ips, asns, urls, people, and breaches. -b all runs every cataloged P0 passive source. P1 DNS and P2 direct sources require explicit selection.

Exclude hostname results while retaining other result types:

uv run theHarvester -d example.com -b emails,ips,urls --no-hosts -f non-host-results

--no-hosts skips hostname-only sources and omits hostname results while keeping other result types. It cannot be combined with actions that depend on hostnames. HarvestView and the REST API expose the same option as no_hosts.

Save results as JSONL:

uv run theHarvester -d example.com -b crtsh,certspotter -f report

This writes report.jsonl for automation and interchange. The same command also writes legacy report.json and report.xml compatibility reports.

Resolve discovered hosts for an authorized domain with the default resolver list:

AUTHORIZED_DOMAIN='replace-with-a-domain-you-control'
uv run theHarvester -d "$AUTHORIZED_DOMAIN" -b crtsh,certspotter -r

List every option and its current behavior:

uv run theHarvester -h

Activity and scope

Passive sources are P0. DNS resolution, brute force, recursive DNS, and reverse lookup are P1. HTTP, TLS, screenshot, takeover, virtual-host, port, and endpoint actions are P2. P1 and P2 activity runs only when you select it.

Common active options include DNS resolution (-r), DNS brute force (-c), reverse DNS (-n), recursive DNS (--dns-recursive-depth), takeover checks (-t), API path scanning (-a), and screenshots (--screenshot). A takeover indicator is evidence for review, not proof that a provider resource can be claimed.

Read Responsible use and scope before active work. Operator workflows covers limits, resolvers, proxies, and action-specific behavior. Screenshot capture requires a Playwright-compatible browser; Baidu uses it when available and otherwise falls back to HTTP.

HarvestView and REST API

harvestview starts the local web application and API on 127.0.0.1:5000 by default:

export THEHARVESTER_API_KEY='replace-with-a-long-random-value'
uv run harvestview

Open HarvestView to start runs and inspect their results, or Schedules to persist timezone-aware run schedules across one or many authorized targets. Each occurrence creates an ordinary finite run per target, and the single local worker executes them serially. SQLAlchemy stores schedule control state in a separate mode-0600 SQLite database that is excluded from portable SQLite run exports. The browser receives a derived HttpOnly session cookie and never stores the API key. See the installation guide for local assets, screenshots, and isolated deployments.

Open Swagger or ReDoc for the automation contract.

Docker Compose

The Compose service runs as an unprivileged user and binds only to host loopback. It stores runs in a named volume and reads the operator key from a file secret:

install -d -m 0700 .secrets
openssl rand -hex 32 > .secrets/operator-api-key
chmod 0444 .secrets/operator-api-key
docker compose up --build -d
docker compose ps
docker compose logs -f theharvester.svc.local
docker compose down
RoutePurpose
GET /api/v1/sourcesList registered discovery sources and capabilities.
POST /api/v1/runsSubmit a finite enumeration run.
GET /api/v1/runsList durable run records.
GET /api/v1/runs/{run_id}Retrieve lifecycle state, normalized results, and source outcomes.
POST /api/v1/runs/{run_id}/cancelCancel queued or running work.
POST /api/v1/runs/importImport JSONL evidence without executing discovery.
POST /api/v1/runs/import-databaseImport completed runs from a theHarvester SQLite database.
GET /api/v1/runs/export-databaseExport all completed run evidence as a portable SQLite database.
GET /api/v1/runs/{run_id}/exportExport normalized evidence as JSONL.
GET/POST /api/v1/schedulesList or create persistent local schedules.
GET /api/v1/schedules/healthReport scheduler and execution-worker availability.
GET/PUT/DELETE /api/v1/schedules/{schedule_id}Read, replace, or delete a schedule without deleting its runs.
POST /api/v1/schedules/{schedule_id}/pausePause future occurrences without cancelling queued or running work.
POST /api/v1/schedules/{schedule_id}/resumeResume future occurrences.
POST /api/v1/schedules/{schedule_id}/run-nowQueue one extra occurrence without changing recurrence timing.
GET /api/v1/schedules/{schedule_id}/dispatchesList per-target dispatch history.

HarvestView can start screenshot and DNS brute-force runs from a hostname result. Each action creates its own run and leaves the original evidence unchanged.

API clients send THEHARVESTER_API_KEY in the X-API-Key header. Provider API settings stay on the server. Keep the service on localhost unless you add TLS and network access controls. The REST API guide documents requests, imports, exports, and authentication.

Discovery sources

Select sources by name or by a result route listed below. -b all runs the P0 sources. P1 and P2 sources require explicit selection.

Result types in this table always appear in this order: subdomains, emails, ips, asns, urls, people, breaches. A result followed by only means the source contributes no other result type. The API key column refers to provider settings in api-keys.yaml; some providers require more than one value. Optional means the source can run without a key.

The shodan source contributes subdomains. Shodan host enrichment through -s or --shodan is a separate action and is not a source result route.

View all 58 discovery sources
SourceReturnsActivityAPI key
apis-gurusubdomains, emails, urlsP0No
arquivosubdomains onlyP0No
baidusubdomains, emailsP0No
bevigilsubdomains, urlsP0Required
bravesubdomains, emailsP0Required
bufferoverunsubdomains, ipsP0Required
builtwithsubdomains, urlsP0Required
censyssubdomains, emailsP0Required
certspottersubdomains onlyP0No
commoncrawlsubdomains onlyP0No
criminalipsubdomains, ips, asnsP2Required
crt-namesubdomains onlyP0No
crtshsubdomains onlyP0No
dehashedemails, ipsP0Required
dnsdbsubdomains onlyP0Required
dnsdumpstersubdomains, ipsP0Required
duckduckgosubdomains, emailsP0No
dymosubdomains onlyP0Required
fofasubdomains, ipsP0Required
fullhuntsubdomains onlyP0Required
github-codesubdomains, emailsP0Required
gitlabsubdomains, emails, urlsP0No
hackertargetsubdomains, ipsP0Optional
haveibeenpwnedbreaches onlyP0No
hibpverifiedemails, breachesP0Required
hudsonrocksubdomains, emails, ipsP0No
huntersubdomains, emailsP0Required
hunterhowsubdomains onlyP0Required
intelxsubdomains, emails, urlsP0Required
leakixsubdomains onlyP0Required
leaklookupemails, breachesP0Required
mojeeksubdomains, emailsP0Optional
netlassubdomains onlyP0Required
onyphesubdomains, ips, asnsP0Required
otxsubdomains, ipsP0No
pentesttoolssubdomains, ipsP1Required
projectdiscoverysubdomains onlyP0Required
rapiddnssubdomains, ipsP0No
robtexips onlyP0No
rocketreachemails, urlsP0Required
securityscorecardsubdomains, ipsP0Required
securityTrailssubdomains, ipsP0Required
sherlockeyesubdomains, emails, ipsP0Required
shodansubdomains onlyP1Required
shodanctsubdomains onlyP0No
shodanInternetDBsubdomains, ipsP1No
sourcegraphsubdomains onlyP0No
subdomaincentersubdomains onlyP0No
subdomainfinderc99subdomains onlyP1No
thcsubdomains onlyP0No
tombasubdomains, emailsP0Required
urlscansubdomains, ips, asns, urlsP0No
virustotalsubdomains onlyP0Required
waybackarchivesubdomains onlyP0No
whoisxmlsubdomains onlyP0Required
windvanesubdomains, emails, ipsP0Optional
yahoosubdomains, emailsP0No
zoomeyesubdomains, emails, ips, asns, urlsP0Required

Each source name links to its provider's site or documentation for current plans, quotas, and terms. See Configuration and API keys for the required fields and setup instructions. Contributors can add a provider through the module guide. The CLI and API read their source inventory from the source catalog.

Configuration

On first use, theHarvester creates default configuration files under ~/.theHarvester/. It also reads system configuration from /etc/theHarvester/ and /usr/local/etc/theHarvester/.

  • api-keys.yaml stores provider API keys and related values such as organization IDs.
  • proxies.yaml configures HTTP and SOCKS5 proxies used with -p.
  • The shodan source and -s / --shodan enrichment use Shodan's Host REST API. When -p is enabled, both send those requests through proxies.yaml.
  • routeviews.key is optional and enables authenticated RouteViews access for PeeringDB-verified users.

Never commit populated configuration files, API keys, account details, or provider responses.

Output and local data

Terminal output is intended for interactive use. -f NAME also writes NAME.jsonl, NAME.json, and NAME.xml. Screenshots go to the directory passed to --screenshot, and completed runs are stored in ~/.local/share/theHarvester/stash.sqlite.

Treat collected OSINT as potentially sensitive. Keep report files, screenshots, and the local database out of source control and share them only within the authorized engagement.

JSONL

JSONL is the primary format for automation and one-run interchange. The first line describes the run. Each remaining line is one sorted, deduplicated finding with its source and action provenance.

This example contains six findings from two sources. The counts object summarizes the result lines that follow it.

{"action_executions":[],"artifacts":[],"completed_at":"2026-08-17T12:01:00Z","counts":{"asn":1,"breach":1,"email":1,"hostname":1,"ip":1,"url":1},"evidence_status":"complete","result_count":6,"run_id":"123e4567-e89b-12d3-a456-426614174000","source_executions":[{"duration_ms":127.4,"error_type":null,"result_count":1,"source":"haveibeenpwned","status":"completed","stop_reason":null},{"duration_ms":482.3,"error_type":null,"result_count":5,"source":"zoomeye","status":"completed","stop_reason":null}],"started_at":"2026-08-17T12:00:00Z","target":"example.com","type":"summary"}
{"sources":["zoomeye"],"type":"asn","value":"AS64500"}
{"sources":["haveibeenpwned"],"type":"breach","value":"Example breach"}
{"sources":["zoomeye"],"type":"email","value":"security@example.com"}
{"sources":["zoomeye"],"type":"hostname","value":"api.example.com"}
{"sources":["zoomeye"],"type":"ip","value":"192.0.2.10"}
{"sources":["zoomeye"],"type":"url","value":"https://api.example.com/login"}

Extract common result types with jq:

jq -r 'select(.type == "hostname") | .value' report.jsonl
jq -r 'select(.type == "ip") | .value' report.jsonl
jq -r 'select(.type == "asn") | .value' report.jsonl
jq -r 'select(.type == "email") | .value' report.jsonl
jq -r 'select(.type == "url") | .value' report.jsonl
jq -c 'select(.type == "person") | .value | fromjson' report.jsonl
jq -r 'select(.type == "breach") | .value' report.jsonl

Some result types carry structured evidence. person, infostealer, and recursive DNS values contain JSON strings and need a second fromjson step. Shodan hosts use details; virtual hosts, network prefixes, and ASN attribution use native observations. Takeover results keep the hostname in value and their DNS, wildcard, HTTP, rule, status, and error evidence in details.

jq -c 'select(.type == "dns-recursive-finding") | .value | fromjson' report.jsonl
jq -c 'select(.type == "shodan-host") | {ip: .value, services: .details.services}' report.jsonl
jq -c 'select(.type == "hostname" and .observations) | {hostname: .value, observations}' report.jsonl
jq -c 'select(.type == "asn" and .observations) | {asn: .value, observations}' report.jsonl

List every finding as tab-separated type and value columns:

jq -r 'select(.type != "summary") | [.type, .value] | @tsv' report.jsonl

The subdomains capability produces hostname records because a result can be the target hostname itself. Read Results and local data for the complete JSONL and evidence contract.

SQLite, JSON, and XML

CLI and API runs use the same SQLite evidence model. JSONL moves one run at a time. SQLite import and export handle completed runs in bulk but exclude queue and worker state. Screenshot files remain separate from their metadata.

JSON and XML are compatibility reports grouped by result type. They do not include the full provenance, lifecycle outcomes, or structured action evidence available in JSONL, SQLite, the API, and HarvestView.

Development and contributing

Read CONTRIBUTING.md for the development setup, required checks, testing expectations, and pull-request process.

Support and credits