Skip to content

Add --no-hosts result filtering#2401

Open
warpedatom wants to merge 1 commit into
laramies:masterfrom
warpedatom:feature/no-hosts
Open

Add --no-hosts result filtering#2401
warpedatom wants to merge 1 commit into
laramies:masterfrom
warpedatom:feature/no-hosts

Conversation

@warpedatom

@warpedatom warpedatom commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Adds a global --no-hosts option that disables hostname retrieval,
processing, storage, display, enrichment, and report export while
preserving non-host result types.

Closes #2400

Changes

  • Adds the --no-hosts CLI argument.
  • Adds no_hosts=true support to the REST /query endpoint.
  • Prevents hostname retrieval when a source exposes hostname results
    separately.
  • Filters hostname artifacts from mixed-result sources while retaining
    their non-host results.
  • Skips host-only sources when hostname collection is disabled.
  • Preserves emails, people, URLs, ASNs, interesting URLs, and IP
    addresses returned directly by a source.
  • Omits hostname and virtual-host records from JSON and XML reports.
  • Rejects incompatible DNS, Shodan, takeover, and screenshot options.
  • Adds automated tests, README documentation, and a changelog entry.

Validation

  • Feature tests: 13 passed
  • Full test suite: 133 passed
  • Ruff linting: passed
  • Ruff formatting: passed
  • mypy: no issues found in 83 source files
  • git diff --check: passed

The pytest run produced dependency deprecation warnings from Starlette
and aiosqlite, but no test failures.

Notes

This option controls hostname collection and processing within
theHarvester. Some upstream services may include hostname data in a
mixed API response. In those cases, hostname results are discarded
before storage, enrichment, display, or report export.

@NotoriousRebel

Copy link
Copy Markdown
Collaborator

There are major refactors coming to the tool, this will be reviewed thoroughly after.

@warpedatom

Copy link
Copy Markdown
Author

Understood, thank you for the heads-up. I’ll keep an eye on the upcoming refactors and update/rebase the PR as needed once they land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add --no-hosts option to disable hostname processing

2 participants