National Cyber Warfare Foundation (NCWF)

theHarvester for OSINT reconnaissance during authorized assessments


0 user ratings
2026-09-15 13:26:57
milo
Red Team (CNA)
"theHarvester

theHarvester aggregates emails, subdomains, hosts, and people data from dozens of public sources into normalized evidence for the reconnaissance phase of authorized security assessments.








Toollaramies/theHarvester — Python OSINT aggregation framework pulling emails, subdomains, IPs, ASNs, URLs, people, and breach names from ~59 public sources
CategoryPassive and semi-active reconnaissance / OSINT aggregation
Primary UseEarly-stage external recon in scoped engagements: enumerating subdomains, emails, and ips from certificate transparency logs, DNS datasets, and threat-intel platforms, exported as JSONL or SQLite evidence
Safe UseRun only against domains you own or have explicit written permission to test; the README's scope model (P0/P1/P2) and its Responsible Use guide are designed for authorized assessments and blue-team attack-surface review
Telemetry NoteP0 sources are passive and leave traces only at third-party providers (query logs, API usage); P1 DNS resolution and P2 HTTP/TLS/screenshot actions generate observable DNS queries and connection logs on target infrastructure — visible to defenders as enumeration patterns from your resolver and egress IPs

theHarvester is one of the longest-lived open-source reconnaissance frameworks in the offensive-security ecosystem, and this repository at laramies/theHarvester shows a project that has matured well past its script-kiddie reputation. With roughly seventeen thousand stars and a Python codebase, it aggregates open-source intelligence about a domain from search engines, certificate transparency logs, DNS datasets, code repositories, and threat-intelligence platforms, then normalizes the output into structured evidence. The framing throughout the README is explicitly scoped: use it during early reconnaissance of an authorized security assessment, against targets you own or have explicit permission to test. That framing is reinforced by a technical scope model rather than mere disclaimer language, which is what makes this tool interesting from a governance perspective as well as a technical one.


The core value proposition is normalization across heterogeneity. Each discovery source — crtsh, certspotter, commoncrawl, censys, hunter, intelx, and dozens more, with 59 cataloged in the README's table — has its own availability, quotas, and response format. theHarvester absorbs that variance and emits unified result types in a fixed order: subdomains, emails, ips, asns, urls, people, and breaches. The README is candid that providers control their own behavior, so individual sources may change independently of the tool. This is the correct architectural humility for anything scraping third-party APIs, and it explains why the project leans on capability selectors rather than brittle per-source promises.


The most thoughtfully designed part of the interface is the activity-tier model. Passive sources are classified P0 — pure third-party queries that never touch the target's infrastructure. DNS resolution, brute force, recursive DNS, and reverse lookup are P1. HTTP, TLS, screenshot, takeover, virtual-host, port, and endpoint actions are P2. Critically, P1 and P2 activity runs only when explicitly selected via flags like -r for resolution, -c for DNS brute force, -n for reverse DNS, -t for takeover checks, and --screenshot. A consultant can therefore run an entirely passive engagement phase, or escalate to active work only after scope conversations justify it. This maps directly onto how real engagement rules-of-engagement documents are written, and it gives defenders a clean mental model for what traffic the tool can generate.


Source selection is handled through the -b flag, which accepts either explicit source names or capability selectors that union across all sources contributing a given result type. Available selectors are subdomains, emails, ips, asns, urls, people, and breaches, and -b all runs every cataloged P0 passive source. The selectors choose which sources run but do not discard other result types those sources happen to return, which avoids the classic footgun of silent data loss during filtering. For operators who want non-hostname artifacts only, --no-hosts skips hostname-only sources and omits hostname results while preserving everything else — though it cannot be combined with hostname-dependent actions like takeover checks or virtual-host enumeration.


Getting started is deliberately minimal. The project requires Python 3.14, with the repository's .python-version letting uv select the interpreter automatically. A basic passive run looks like uv run theHarvester -d example.com -b crtsh,certspotter,commoncrawl, which queries three passive sources and normalizes their yields. Three discovery sources run concurrently by default, tunable with -j or --source-workers, and the REST API exposes the same setting. Passing --limit 0 removes the shared per-source result cap so each adapter runs until its provider is exhausted, subject to provider quotas and runtime safeguards — and if a provider or safety limit halts a source mid-run, retained results are kept and the source is recorded as partial with the stop reason. That partial-with-reason accounting is exactly the provenance discipline you want in evidence destined for a report.


Evidence handling is where this codebase shows its age in the best way: the formats have multiplied to serve real workflows. JSONL and SQLite are the primary structured-evidence stores, preserving provenance per artifact, while legacy JSON and XML output remain available for existing integrations. A run with -f report writes report.jsonl alongside the compatibility report.json and report.xml. This is a pragmatic acknowledgment that a decade of tooling — from homegrown parsers to commercial report generators — already consumes the old formats, and ripping them out would break more than it cleans.


Beyond the CLI, the project ships HarvestView, a local browser-based run desk served on 127.0.0.1:5000. It is not a thin dashboard bolted on for marketing; the security posture described in the README is unusually careful. Authentication uses an API key sent via the X-API-Key header, set through THEHARVESTER_API_KEY, and the browser receives only a derived HttpOnly session cookie — the API key never reaches client-side storage. Schedule control state lives in a separate mode-0600 SQLite database using SQLAlchemy, deliberately excluded from portable run exports so operator scheduling metadata does not leak into shared evidence bundles. Scheduling is timezone-aware, executes runs serially through a single local worker, and each occurrence produces an ordinary finite run per target rather than some persistent daemon.


The REST API is fully documented via Swagger and ReDoc endpoints, and the route table in the README reads like a small product spec: GET /api/v1/sources for capability discovery, POST /api/v1/runs for submitting runs, cancellation via POST /api/v1/runs/{run_id}/cancel, and — notably — import routes such as POST /api/v1/runs/import and POST /api/v1/runs/import-database that ingest JSONL evidence or completed-run databases without executing any discovery. That import path means an analyst can collect evidence in one environment, air-gapped or otherwise constrained, and review it in HarvestView elsewhere. Export symmetry exists through GET /api/v1/runs/export-database and per-run JSONL export.


Deployment hardening extends to Docker Compose: the service runs as an unprivileged user, binds only to host loopback, stores runs in a named volume, and reads the operator key from a file secret generated with openssl rand -hex 32. Provider API keys configured in api-keys.yaml stay server-side, never transiting to the browser. The README explicitly warns to keep the service on localhost unless you add TLS and network access controls — sensible advice for a tool whose entire purpose is accumulating reconnaissance data on your own organization's exposure.


For defenders, theHarvester is as useful from the blue side as the red. Running it against your own domains is one of the cheapest attack-surface audits available: certificate transparency leaks subdomains you forgot existed, haveibeenpwned-sourced breach names and email exposure surface in the normalized output, and takeover indicators from -t — which the README carefully frames as evidence for review, not proof a resource is claimable — highlight dangling DNS entries. Because P0 runs never touch your infrastructure, blue-team usage carries zero operational risk, and the JSONL provenance trail makes the findings straightforward to diff over time through scheduled HarvestView runs. Whether you approach it as an operator scoping an engagement or an analyst measuring external exposure, the tool's discipline around scope tiers, evidence provenance, and service hardening makes it a reference implementation worth studying on its architecture alone.



Official project repository for laramies/theHarvester.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/09/theharvester-for-osint-reconnaissance.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.