> How to use theHarvester to gather a domain's published emails, subdomains, IPs and URLs: installing it on Kali or with uv, the commands that matter, passive and active sources, and the law.

Blog · [Domain and IP recon](https://pandorasearch.com/blog/topic/domain-ip-recon/)

# How to use theHarvester: commands, examples and sources

By [Hugo Leal](https://pandorasearch.com/blog/authors/hugo-leal/), Digital Infrastructure & Company Records 17 November 2026 · 9 min read

theHarvester is an open-source tool for the first stage of reconnaissance on a domain or an organisation. You give it a domain and it queries search engines, Certificate Transparency logs, DNS datasets, code repositories and threat intelligence platforms, and returns what has been published: hostnames, email addresses, IPs, URLs, ASNs, people and breach names. You run it from the command line with something like `theHarvester -d example.com -b crtsh,certspotter`.

This guide follows the README of the official repository and the package page on Kali Linux, as we read them on 17 November 2026. It explains what each option does, which ones are passive and which ones touch the target, and what to do with the results. At the end we cover which part of that work Pandora, the tool we build, does in the browser.

## The short answer

- **What it is.** A command-line harvester of published information about a domain, licensed under GPL-2.0 and maintained on GitHub; the latest change on its main branch is from 13 November 2026.
- **What it is for.** Getting a quick picture of an organisation's public footprint: its subdomains, its IPs, the email addresses that appear on the web and the known URLs.
- **How you use it.** `theHarvester -d <domain> -b <sources or selectors>`, plus options to save, resolve and compare.
- **Where it runs.** There are packages for Kali Linux, BlackArch and Homebrew (macOS and Linux); otherwise, you clone the repository and use `uv`. Docker Compose brings up its local web app, HarvestView, not the command line.
- **Passive or active.** Class P0 sources send no traffic to the target; P1 (DNS) and P2 (direct contact) only run if you select them.

## Before you start: what you can run, and against what

The README is clear: theHarvester is meant for the early reconnaissance stage of an authorised assessment, and it says to run it only against targets you own or have explicit permission to test. To see why, you need to know its three activity classes:

- **P0.** Queries providers or datasets that already hold the information, without directing traffic at the target. Note that the provider does receive the domain you search for.
- **P1.** Makes DNS queries about names and addresses: resolution, brute force, recursive DNS and reverse lookups.
- **P2.** Contacts the target directly: HTTP, TLS, screenshots, takeover checks, virtual hosts, ports and API paths.

P1 and P2 only run when you select them. The practical rule: passive sources to learn what has been published; active options only on your own infrastructure or within an engagement with written permission.

## How to install it

**On Kali Linux.** The package is called theharvester and installs with `sudo apt install theharvester`. The command is `theHarvester`, with capitals; the lowercase version is deprecated and tells you so when you run it. The package also ships `restfulHarvest`, a web server with its API that listens on 127.0.0.1, port 5000, by default. Kali's page lists version 4.11.1, the same as the latest release on GitHub, from 3 June 2026.

**With Homebrew or on BlackArch.** On macOS and Linux, Homebrew has a theharvester formula, also at 4.11.1, which installs with `brew install theharvester`. BlackArch packages it under the same name. The project's installation guide warns that distribution packages can lag behind the current stable release or the development branch.

**From the repository.** The README asks for Python 3.14 and the `uv` package manager:

```
git clone https://github.com/laramies/theHarvester
cd theHarvester
uv sync
uv run theHarvester -h
```

**With Docker.** The repository includes a Docker Compose setup that you start with `docker compose up --build -d`. According to the README, the service runs as an unprivileged user, binds only to the host's loopback interface and reads the API key from a file secret. Note that, according to the installation guide, the image starts HarvestView, the local web app, and does not open an interactive theHarvester command line. With Docker you work from the browser on your machine, not with the commands in this guide. For Windows, neither the README nor the installation guide gives instructions of its own.

**A note on versions.** The README on the main branch describes the latest state of the project, and some options in this guide may not be in the version you have installed. If one does not show up in your `theHarvester -h`, your version is probably older. In Kali's 4.11.1, for example, the help says `-f` saves the results to XML and JSON, and `-b` takes source names.

## The commands you will use most

These examples come from the README itself. If you installed from the repository, prefix them with `uv run`; on Kali, `theHarvester` on its own is enough.

```
uv run theHarvester -d example.com -b crtsh,certspotter
uv run theHarvester -d example.com -b subdomains
uv run theHarvester -d example.com -b emails,urls,certspotter
uv run theHarvester -d example.com -b crtsh,certspotter -f report
uv run theHarvester -d "$AUTHORIZED_DOMAIN" -b crtsh,certspotter -r
```

The first looks for subdomains in two Certificate Transparency logs. The second uses a selector: instead of naming sources, you ask for a type of result and theHarvester picks the sources that provide it. The selectors are `subdomains`, `emails`, `ips`, `asns`, `urls`, `people` and `breaches`, and you can combine them with specific sources, as in the third. The fourth saves a report. The fifth resolves the names it finds (`-r`), which is already P1 activity: that is why the README writes it with a variable called "authorized domain".

Kali's page gives another example, `theHarvester -d kali.org -l 500 -b duckduckgo`, which searches DuckDuckGo for a domain's email addresses with a limit of 500 results.

The options, as a cheat sheet:

| Option | What it does | Class |
| --- | --- | --- |
| `-d` | The target domain |  |
| `-b` | Sources or selectors; `all` runs every P0 source | Depends on the source |
| `-l` | Limits the number of results (500 by default in Kali's version) |  |
| `-f` | Base name for the report (JSONL, JSON and XML) |  |
| `--no-hosts` | Leaves hostnames out |  |
| `-p` | Uses the proxies in `proxies.yaml` |  |
| `-r` | Resolves the names it finds | P1 |
| `-n` | Reverse DNS | P1 |
| `-c` | DNS brute force | P1 |
| `--dns-recursive-depth` | Recursive DNS depth | P1 |
| `-t` | Checks for possible subdomain takeovers | P2 |
| `-a` | Scans for API paths | P2 |
| `--screenshot` | Takes screenshots of the websites it finds | P2 |

## The sources: which ones need no key

The README lists 66 sources. Of the P0 sources, 23 work without a key, among them crtsh, certspotter, commoncrawl, duckduckgo, waybackarchive, urlscan, otx, rapiddns and robtex; 3 take an optional key, and 35 require one, such as censys, securityTrails, virustotal or hunter. There are 4 P1 sources (shodanInternetDB and subdomainfinderc99 without a key, pentesttools and shodan with one) and one P2 source, criminalip.

Keys go in `~/.theHarvester/api-keys.yaml`, which theHarvester creates by default alongside `proxies.yaml`, the file for HTTP and SOCKS5 proxies. The README warns you not to commit those files, or provider responses, to a repository.

A word on the `breaches` selector: it draws on breach sources. The legitimate use is knowing which breaches your organisation's addresses appear in, not handling what was leaked; we explain how in [checking breach exposure without touching passwords](https://pandorasearch.com/blog/check-breach-exposure-without-touching-passwords/).

## What to do with the results

**Save them properly.** With `-f`, theHarvester writes three files. JSONL is the main one: the first line summarises the run and each following line is one finding with its provenance. JSON and XML group the results by type, without full provenance. Every completed run is also stored in an SQLite database at `~/.local/share/theHarvester/stash.sqlite`.

**Compare them over time.** `harvest-report` lists saved targets, counts each source's contribution and compares hostname evidence between runs: `uv run harvest-report hostname-changes --target example.test` shows the hostnames that changed from one run to another. It is useful for watching your own domain's footprint.

**View them in a local web app.** `uv run harvestview` starts HarvestView, a web application with run history, evidence review, hostname changes and schedules, at `127.0.0.1:5000`. The README says to keep it on loopback unless you add TLS and network access controls.

**Check them.** What theHarvester returns is what its sources say, and it is not always current. A subdomain that appears in a certificate may no longer exist; an address that showed up on a web page years ago may have been closed. Before you assert anything, corroborate it with another independent source: the method is in our guide to [domain and IP reconnaissance](https://pandorasearch.com/blog/domain-and-ip-reconnaissance/), and if what you want is who is behind the domain, in [how to find who owns a domain](https://pandorasearch.com/blog/how-to-find-who-owns-a-domain/).

## Is there a theHarvester online?

Not from the project. The README links to no hosted version: HarvestView and the API run on your machine. People who search for "theHarvester online" usually want the same thing without installing Python or managing keys, and for the passive part there is another route.

## The passive part, in the browser: Pandora

Pandora is the tool we build: an OSINT link analysis search engine that runs in the browser. It is not theHarvester, but it reproduces its method, as we note in the site credits alongside its GPL-2.0 licence, and it covers part of the same ground from the browser.

**What it does with a domain.** From a domain, Pandora can gather its DNS over HTTPS, its RDAP and WHOIS data, and its subdomains from Certificate Transparency, from the same two sources as the README's examples, crt.sh and Certspotter. It can also add passive and reverse DNS, other sites that share the IP or the analytics ID, the open ports and known vulnerabilities published by Shodan InternetDB, the network and its owner according to RIPEstat, registered look-alike domains and URLs archived in Common Crawl and the Wayback Machine. Some sources run on their own in the first round and others are launched from the entity, with a right click.

*A domain's infrastructure in Pandora: subdomains from certificates and passive DNS, its IP, its autonomous system and the reputation flags. Example data. [Try it with your own data](https://pandorasearch.com/login/)*

**How you read it.** Everything appears on a graph that grows live, with the source of every data point and the case's audit trail, and you can also read it as a table or a timeline. Collection is passive: Pandora reads what other sources have already observed and scans nothing.

**Where theHarvester is better.** At pulling the list of an organisation's published email addresses from dozens of sources, and at the active options for your own infrastructure. In Pandora, an email is above all a starting point: you enter an address and see which services it is registered with and which breaches it appears in, without passwords.

**What it costs.** The plans are on the [pricing page](https://pandorasearch.com/pricing/). A free account gets one trial search with the findings masked: you see what kind of findings appear and how many, but not which ones. If you are looking for more reconnaissance tools, we compare them in [SpiderFoot alternatives](https://pandorasearch.com/blog/spiderfoot-alternatives/), and if you prefer a console where you chain modules by hand, see [how to use recon-ng](https://pandorasearch.com/blog/how-to-use-recon-ng/). All three, head to head, are in [SpiderFoot vs theHarvester vs recon-ng](https://pandorasearch.com/blog/spiderfoot-vs-theharvester/).

## The legal side

theHarvester is legal, and its README draws the line: only against targets you own or have explicit permission to test. Running active options against other people's systems without authorisation can be a criminal offence. And even when everything is passive, the email addresses of an organisation's people are personal data: you need a legitimate purpose and a lawful basis under the GDPR or its local equivalent, and you keep no more of them than the engagement needs. Our article on [OSINT and the GDPR](https://pandorasearch.com/blog/osint-and-gdpr-investigating-within-the-law/) explains this in detail.

This article is not legal advice.

## Frequently asked questions

**What is theHarvester?**

An open-source tool, licensed under GPL-2.0, for the first stage of reconnaissance on a domain or an organisation. It queries search engines, Certificate Transparency logs, DNS datasets, code repositories and threat intelligence platforms, and returns hostnames, email addresses, IPs, URLs, ASNs, people and breach names.

**How do you use theHarvester?**

With a domain (-d) and the sources or selectors you want to query (-b). For example, theHarvester -d example.com -b crtsh,certspotter looks for subdomains in two certificate logs, and -f report saves the output. If you installed it from the repository, prefix the command with uv run.

**Is theHarvester on Kali Linux?**

It is in Kali's repositories: the package is called theharvester, it installs with sudo apt install theharvester and the command is theHarvester, with capitals. Kali's page does not say whether it is installed by default.

**Is there an online version of theHarvester?**

The README does not link to any hosted version. The closest thing is HarvestView, a web application that runs on your own machine at 127.0.0.1:5000, and which the README says to keep on loopback unless you add TLS and network access controls.

**Is theHarvester passive?**

Its P0 sources are: they query providers that already hold the data, without sending traffic to the target, although the provider does receive the domain you search for. P1 sources make DNS queries and P2 sources contact the target, and they only run if you select them.

**Is it legal to use theHarvester?**

The tool is legal. Its README says to run it only against targets you own or have explicit permission to test. And if you collect people's email addresses, you are processing personal data: you need a legitimate purpose and a lawful basis under the GDPR or its local equivalent.

Written by

[Hugo Leal](https://pandorasearch.com/blog/authors/hugo-leal/)

Digital Infrastructure & Company Records

Domains, IPs, certificates and DNS, and who is behind a company according to the official registers.

[Articles by Hugo Leal](https://pandorasearch.com/blog/authors/hugo-leal/)

**See the passive side of reconnaissance in your browser: enter a domain in Pandora and its certificate subdomains, DNS and IP appear on a graph, with the source of every data point.**

Every new account gets one trial search, with no card.

[See plans and pricing](https://pandorasearch.com/pricing/)

Tags: tools theHarvester reconnaissance subdomains

## Keep reading

- [Domain and IP reconnaissance with open sources](https://pandorasearch.com/blog/domain-and-ip-reconnaissance/): DNS, RDAP, Certificate Transparency, passive DNS, exposed services and reputation feeds: a passive method for analysing a domain or IP.
- [SpiderFoot alternatives: free, open-source and online options](https://pandorasearch.com/blog/spiderfoot-alternatives/): SpiderFoot alternatives compared: BBOT, theHarvester, recon-ng and Maltego, what each one does, which ones you install, and when Pandora in the browser is the better fit.
- [How to find who owns a domain name, even when WHOIS is private](https://pandorasearch.com/blog/how-to-find-who-owns-a-domain/): How to find who owns a domain name: what RDAP and WHOIS still show, how to reach a hidden owner, and the legal notice, certificates and records that name them.

[All articles on Domain and IP recon](https://pandorasearch.com/blog/topic/domain-ip-recon/)

---
Page: https://pandorasearch.com/blog/how-to-use-theharvester/
