Skip to content

Fix ghunt creds loading, -o md/pdf export, CLI poll timeout, account_discovery noise - #5

Open
memmmmike wants to merge 4 commits into
KatrielMoses:mainfrom
memmmmike:fix/ghunt-cli-export-bugs
Open

Fix ghunt creds loading, -o md/pdf export, CLI poll timeout, account_discovery noise#5
memmmmike wants to merge 4 commits into
KatrielMoses:mainfrom
memmmmike:fix/ghunt-cli-export-bugs

Conversation

@memmmmike

Copy link
Copy Markdown

Summary

Fixes four bugs surfaced while wiring up GHunt and running full investigations, each as its own commit with a regression test.

Commit Fix
fix(ghunt) _load_creds called the removed ghunt.helpers.auth.load_creds(creds, file=), then fell back to json.loads on the base64 creds.m, failing with Expecting value: line 1 column 1. Now loads via GHuntCreds(creds_path).load_creds(), keeping the old paths as version fallbacks.
fix(cli) export -o report.md / .mtgx derived the format as ext.lstrip("."), sending format=md/mtgx which no exporter registers (markdown/maltego) → 422, no file written, no visible error. Adds an explicit extension→format map.
fix(cli) poll The completion poll capped at 60×2s=120s then returned exit code 3 ("server unavailable"), misreporting any full investigation that ran longer than 120s as a failure even though the backend completed. Replaced the two duplicated loops with one _poll_report_until_done helper (600s, final fetch before giving up, timeout only when genuinely still running).
fix(account_discovery) Per-site Holehe probe exceptions were dumped as bare strings ("", "'found'", "'NoneType' object has no attribute 'get'") and dragged the module to PARTIAL/FAILED. Now attributed per-platform, summarized in one error line, and treated as expected noise: SUCCESS whenever any probe returned a definitive result, FAILED only on a total washout.

Also corrects docs/ghunt-setup.md (creds live at ~/.malfrats/ghunt/creds.m as base64, not ghunt_creds.json).

Testing

Four new test modules (8 tests), all green:

  • tests/modules/test_ghunt_module.py — loader uses the GHuntCreds object API
  • tests/test_export_extension_mapping.py — every -o extension maps to a registered exporter
  • tests/test_investigate_poll.py — slow-but-successful run is not a timeout; timeout only when still running
  • tests/modules/test_account_discovery.py — probe failures attributed and non-fatal; total washout → FAILED

Notes

  • GHunt requires the [ghunt] extra; ghunt 2.3.x pins pillow<11, which has no cp314 wheel, so the extra needs Python ≤3.13.
  • -o .pdf still requires weasyprint (mailaccess[pdf]); unchanged, that path degrades gracefully.

🤖 Generated with Claude Code

memmmmike and others added 4 commits August 18, 2026 18:49
_load_creds called the removed ghunt.helpers.auth.load_creds(creds, file=),
falling back to json.loads on the base64 creds.m and failing with
"Expecting value: line 1 column 1". Load via GHuntCreds(creds_path).load_creds()
first; keep the old helpers.auth call and JSON read as version fallbacks.
Fix the setup doc (creds.m in ~/.malfrats, base64 not JSON) and add a
regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CLI derived the export format as ext.lstrip("."), sending format=md for
-o report.md and format=mtgx for -o report.mtgx. Neither matches a registered
exporter (markdown/maltego), so the export endpoint returned 422 and no file
was written (silently, since the error printed to redirected stdout). Add an
explicit extension->format map and use it. Add a regression test pinning every
supported extension to a registered exporter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ailable"

The completion poll capped at 60 x 2s = 120s and then returned exit code 3
("server unavailable"), so any full investigation running longer than 120s
was misreported as a failure even though the backend completed and persisted
the report. Replace the two duplicated 120s poll loops with a single
_poll_report_until_done helper that waits up to 600s, does a final fetch
before giving up, and only signals timeout when the server is still running.
A completed-but-slow run now returns its real status. Add regression tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ARTIAL

Individual Holehe site probes raise as sites change; the module dumped bare
exception strings ("", "'found'", "'NoneType' object has no attribute 'get'")
into errors and let a few broken sites drag the whole module to PARTIAL/FAILED.
Attribute each probe failure to its platform, summarize them in one error line,
and treat per-site failures as expected noise: status is SUCCESS whenever any
probe returned a definitive result, FAILED only on a total washout. Add tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant