Commit Graph
382 Commits
Author SHA1 Message Date
L1ghtn1ng e719f56ad4 perf(discovery): own one provider session per paginated conversation
wayback, arquivo, certspotter, gitlab, hunter, tomba, mojeek, windvane,
yahoo, pentest-tools, and commoncrawl each built and tore down a fresh
ClientSession (connector, TLS context, proxy resolution) for every page,
poll, or README request. Each adapter now opens one session for its whole
conversation and passes session= to the shared fetchers, matching the
open_session pattern already used by the other paginating providers.

Also removes yahoo's unreachable empty-response guard, collects pages in
a list instead of O(n^2) string concatenation, and strips padded email
local parts with lstrip instead of per-character slicing. Contract tests
assert the proxy selection and session identity at the session owner.
2026-09-17 02:16:29 +01:00
L1ghtn1ng 55c83df0ef fix(api): harden run worker recovery, child exit codes, and run-now errors
- _child_execute now returns an exit code and the module entry maps it
  to the process status, so a child terminated by an external signal
  exits nonzero; the parent records the run as failed with the partial
  checkpoint attached instead of mistaking leftover evidence for
  terminal completion
- recover_orphans isolates each orphaned run: one unreadable checkpoint
  (schema-passing but structurally broken) no longer aborts recovery of
  the remaining runs or crashes every future startup - the affected run
  is failed without evidence and recovery continues
- _process_output drains child streams to EOF but retains only a
  bounded tail, so a verbose child cannot grow API memory unboundedly
- the execution poll reads the lifecycle row instead of the full detail
  projection every 50 ms
- run-now maps a stale stored run template to a sanitized 503 instead
  of leaking a raw pydantic ValidationError as a 500
2026-09-17 02:05:21 +01:00
L1ghtn1ng 90e5fd9119 fix(dns): skip wordlist labels that validation would reject
A label such as _dmarc passes the recursive-DNS label normalizer (which
allows underscores) but is rejected by the shared hostname normalizer
inside validate_dns_candidates, whose empty result then crashed the
whole dns-recursive action with an unhandled ValueError from the strict
tuple unpack. Check the candidate with the same normalize_scoped_hostname
helper before querying and skip it, so one unusable wordlist entry no
longer aborts the action.
2026-09-17 01:55:53 +01:00
L1ghtn1ng 0d2bbb9662 fix(core): correct shared transport ssl, header, and body handling
- _create_connector: an explicit ssl=False (verification disabled) was
  silently replaced with a verifying context by 'ssl_context or default';
  only an unset context now falls back to the certifi default
- fetch/post_fetch/fetch_all: caller-supplied headers were silently
  dropped when a caller-owned session was passed; they are now forwarded
  per request, matching _open_get_response and aiohttp merge semantics
  (sessions that bake the same headers are unaffected)
- fetch: a borrowed session with default verification no longer rebuilds
  a certifi SSL context on every request; it defers to the connector
  context the session already owns
- _normalize_data: the post_fetch data='' default raised JSONDecodeError
  internally and silently returned without sending any request; empty
  bodies now send, and non-JSON strings pass through as raw bodies

Traced every owned-versus-borrowed branch; all post_fetch callers pass
json_body or valid JSON strings, and the only verify=False caller
(api_endpoints) supplies its own connector.
2026-09-17 01:51:15 +01:00
L1ghtn1ng 61657c2f74 fix(discovery): enforce scoped hostnames and credential presence
- hunter/tomba: replace the substring source-domain check that admitted
  out-of-scope hosts (notexample.test, example.test.evil.net) with
  normalize_scoped_hostname; tomba also tolerates full website URLs
- arquivo: a repeated page with zero collected hosts now reports failed
  instead of partial, matching the module's own outcome convention
- pentesttools, rocketreach, shodan: blank or whitespace-only API keys
  now raise MissingKey like peer providers instead of starting a doomed
  authenticated run
2026-09-17 01:43:19 +01:00
L1ghtn1ng 2ee9b557e5 fix(discovery): correct criminalip, hudsonrock, mojeek, githubcode error handling
- criminalip: inspect HTTP status via provider_http_error instead of
  only the provider's embedded status field, so 401/403/429 with
  non-JSON bodies are classified correctly; build the scan request with
  json_body instead of an f-string that produced invalid JSON for
  targets containing quotes or backslashes
- hudsonrock: remove the dead transport-error retry loop (the shared
  transport already swallows those exceptions and returns None), drop a
  redundant isinstance check, and describe the real 429-only retry
- mojeek: fix the finite API path off-by-one that fetched zero pages
  for --limit 1 and dropped the final partial page, and request pages
  sequentially instead of one concurrent burst
- githubcode: only HTTP 429 responses retry; a 403 now fails
  immediately as access-denied instead of stalling ~3 minutes and being
  mislabeled rate-limited
2026-09-17 01:38:23 +01:00
L1ghtn1ng 4f60fc9e8b fix(discovery): report hunter, tomba, gitlab, wayback, certspotter failures correctly
Transport errors, non-2xx responses, and malformed bodies were returned
as None, which the shared source runner maps to a completed run. Classify
them with the shared provider_http_error convention so failures surface
as failed/rate-limited outcomes and partial data is preserved:

- hunter/tomba: _fetch_json returns dict or SourceExecutionReport;
  malformed-dict shapes still map to invalid-response
- gitlab: unreachable 'if not response' guard replaced; [None] transport
  failures report transport-error instead of invalid-response
- waybackarchive: transport errors no longer masquerade as end-of-data;
  _search_pattern returns explicit SourceExecutionReport outcomes and
  HTTP failures use provider_http_error
- certspotter: transport failures distinguished from invalid responses;
  HTTP failures classified per the shared convention

Contract tests updated to assert the resulting reports and to mock the
metadata-shaped responses the shared transport actually delivers.
2026-09-17 01:30:55 +01:00
NotoriousRebel ea5db87915 Merge master into dev to resolve PR #2607 conflicts
Preserve provider outcome release notes alongside the HTTP proxy wording. Keep the dev domain glossary and carry the master HTTP-only proxy policy into its relocated architecture guide. Retain RocketReach cancellation coverage while removing the obsolete global dependency stub.

Align provider lifecycle regressions with the master session-construction boundary: construction ValueError is normalized to transport-error, while cancellation, lifecycle RuntimeError, and teardown ValueError still propagate.
2026-09-09 21:41:46 -04:00
MattandGitHub b2db23a89b fix: preserve provider outcomes and session state for 5.0 (#2604)
* fix: preserve provider failures and decode POST evidence

Keep failed, rate-limited, malformed, and partial outcomes visible across ten provider adapters so saved hostname comparisons do not infer reliable absence. Restore DeHashed and Leak-Lookup JSON response decoding.

Refs #358, #359

* docs: document released 4.11 automation migrations

Address #361 with launcher, route, request, response, source, and DNS resolver migrations verified against the 4.11.1 tag.

* fix: own provider sessions across related requests
2026-09-09 15:51:58 -04:00
MattandGitHub 1e9efc6118 feat: add JSMON passive subdomain discovery (#2605)
* Add JSMON passive subdomain discovery source

* docs: complete JSMON setup and credential readiness

* fix: read JSMON credentials only from api-keys.yaml
2026-09-09 14:12:07 -04:00
MattandGitHub 3b01d7f172 feat: clarify saved-run reporting before 5.0 (#2599)
Provide harvest-report targets, contributions, and hostname-changes with consistent saved-evidence terminology across the CLI, REST API, and HarvestView. Preserve target scope, source-outcome handling, JSONL, and the stored evidence schema.

Update onboarding and operator documentation, keep the domain glossary in CONTEXT.md, record behavior rules in docs/architecture.md, and consolidate release preparation in CONTRIBUTING.md.

Validation: all eight GitHub checks passed at ed54542a; focused reporting and documentation checks passed. Tracks https://github.com/NotoriousRebel/theHarvester/issues/349.
2026-09-07 16:48:20 -04:00
BenzizaandGitHub dc9ffa5740 fix: validate HarvestView log levels before startup (#2602) 2026-09-06 20:59:04 -04:00
MattandGitHub 8a6875ccf2 fix: package license and guard schedule controls (#2598)
* docs: refresh readme architecture diagrams

* fix: ship release licenses and local UI assets

* fix: fail closed when schedule prerequisites fail

* docs: refresh release-facing operator guide

* fix: keep HarvestView on pinned CDN assets

* docs: apply HarvestView theme to architecture diagrams

* docs: simplify README and clarify diagram labels
2026-09-04 18:20:21 -04:00
MattandGitHub e8bab9ebcc refactor: centralize target identity semantics (#2597)
* refactor: own enumeration target identity

* refactor: clarify target identity policies
2026-09-04 18:02:48 -04:00
NotoriousRebel 0756ffc049 fix: fail closed on unreliable tracking baselines 2026-08-29 17:21:53 -04:00
NotoriousRebel d181c42601 fix: harden hostname tracking release behavior 2026-08-29 17:16:17 -04:00
NotoriousRebel 7800737d96 fix: fail closed on incomplete DNS evidence 2026-08-29 16:42:31 -04:00
NotoriousRebel 6b7852f7ef feat: track hostname changes across runs 2026-08-29 16:38:25 -04:00
NotoriousRebel e06392bb53 feat: require explicit all-target yield reports 2026-08-29 16:08:20 -04:00
NotoriousRebel a23298ea48 feat: make source yield reports target-aware 2026-08-29 16:06:07 -04:00
NotoriousRebel 9d362e0032 feat: list canonical harvest yield targets (#333) 2026-08-29 13:51:46 -04:00
NotoriousRebel 2440b2b932 refactor: own API runtime state in app lifespan 2026-08-27 15:42:00 -04:00
NotoriousRebel 8ead90f7a9 fix: scope proxy mode to HTTP transport 2026-08-26 22:53:21 -04:00
NotoriousRebel 0e4324f2cb fix: centralize discovery transport handling 2026-08-26 18:38:56 -04:00
NotoriousRebel fabaea3886 fix: classify proxied response stream failures 2026-08-26 16:33:58 -04:00
NotoriousRebel 227d189d7e fix: reuse proxied routeviews session 2026-08-26 16:31:46 -04:00
NotoriousRebel 74282f279b fix: preserve proxy transport failures across tasks 2026-08-26 16:27:29 -04:00
NotoriousRebel ad28a87111 fix: reject direct DNS in proxy mode 2026-08-26 16:17:51 -04:00
NotoriousRebel bf2d34ff09 fix: keep direct actions on configured proxy transport 2026-08-26 11:55:21 -04:00
NotoriousRebel 22dc7b4cfd refactor: remove confirmed dead code 2026-08-26 10:58:40 -04:00
NotoriousRebel 786c3b015a fix: reject missing proxy configuration at startup 2026-08-26 00:58:54 -04:00
NotoriousRebel 8889ddca9c fix: pin proxy identity per execution 2026-08-26 00:38:46 -04:00
NotoriousRebel f9c363a77c test: align proxy help contract 2026-08-25 23:13:15 -04:00
NotoriousRebel 50669f2704 docs: align fail-closed proxy contract 2026-08-25 23:11:03 -04:00
NotoriousRebel 414276e330 fix: fail closed when required proxies are unavailable 2026-08-25 22:59:06 -04:00
MattandGitHub 7cc7e3abc6 Merge pull request #2586 from laramies/fix/review-security-boundaries
fix: enforce discovery security boundaries
2026-08-25 22:58:40 -04:00
L1ghtn1ng f2efcb5b99 fix: canonicalize hostname scope and IP results in one helper
Put IDNA and label validation in normalize_scoped_hostname so the
runner, parser, and storage path share one authorized-target boundary.
Drop IPv6 zone identifiers at collection instead of failing finish(),
and remove leftover BuiltWith and Shodan aliases now that www. is part
of the explicit target.
2026-08-25 02:02:35 +01:00
NotoriousRebel cfbcb19386 fix: complete ty CI migration 2026-08-24 20:31:32 -04:00
L1ghtn1ng 86c2c5f979 fix: enforce discovery security boundaries
Keep proxy identities stable across provider conversations, preserve exact target scope, canonicalize evidence, secure first-run config creation, and retain legacy source-name compatibility.
2026-08-25 01:29:05 +01:00
NotoriousRebel c3ec07b593 Clarify partial source outcomes 2026-08-23 18:00:26 -04:00
NotoriousRebel 85db8bda8f Improve source yield reporting 2026-08-23 17:39:55 -04:00
NotoriousRebel 5c74e1a03d Allow uncapped discovery and report source yield 2026-08-23 17:24:08 -04:00
NotoriousRebel 03a349430f Fix Baidu browser user agent 2026-08-21 13:05:16 -04:00
NotoriousRebel 2c6c5bff4a refactor: use SQLAlchemy for HarvestView schedules 2026-08-20 16:01:55 -04:00
NotoriousRebel d875f3ac21 fix: recover persisted run evidence idempotently 2026-08-20 12:28:30 -04:00
NotoriousRebel 8bdbca217c feat: extend HarvestView schedule management 2026-08-20 11:11:25 -04:00
NotoriousRebel ca1cb72ec6 fix: reconcile superseded schedule reservations 2026-08-20 10:02:40 -04:00
NotoriousRebel a1d794d5af feat: add persistent HarvestView scheduling 2026-08-20 01:21:09 -04:00
NotoriousRebel 416c4bf828 Preserve winloop outside Playwright paths 2026-08-20 00:45:03 -04:00
NotoriousRebel f626b72748 Fix Playwright startup on Windows
Use the standard asyncio event loop on Windows because winloop rejects the startupinfo argument Playwright passes when launching its driver subprocess. Remove the now-unused winloop dependency and cover the loop selection with a regression test.
2026-08-18 13:17:13 -04:00