Squashed rework of hackingtool from a tool launcher into an AI-guided operator
console for authorized security testing. 93 commits collapsed into this one;
the pre-rework tree is tagged v2.0.0.
CATALOG & ENGINE
- Data-driven YAML catalog (21 categories, 215 live tools + 59 archived) with a
registry/overlay loader and a fixed 66-tag taxonomy (63 in use). Adding a tool
is one YAML entry, not edits across the codebase.
- Engine honesty: real exit codes, truthful install success/failure, reuse-first
skip, EOF-safe prompts, command audit logging.
- Safe installs: sha256-required safe-fetch (killed `curl | bash` in feroxbuster,
Caido and Sliver), list-form subprocess only, no forced sudo.
AI LAYER (bring-your-own-key or local model; degrades offline, never fabricates)
- AI1 intent -> tools; AI2 tool+goal -> command, curated-first with a grounded
fallback; AI3 findings summary and engagement report; AI4 per-finding impact
and remediation. Prompt-injection hardened per OWASP LLM01.
- /goal plans an objective and runs it one step at a time, showing every command
before it runs, with a plan.json + run.log audit trail.
/find TOOL DISCOVERY (this branch's headline feature)
- Suggests real GitHub projects when the catalog has no tool for a need.
Deterministic: zero model calls, structured API fields only, suggest-only —
it never clones, installs or runs anything.
- A charter filter refuses destructive/DoS/jamming/mass-targeting/evasion asks
before any network I/O, while a defensive-intent guard keeps blue-team and
DFIR phrasing ("detect a SYN flood in a pcap") from being false-refused.
- Query rewriting proved to be the dominant quality lever (the first design
measured 29% precision with no results on 5 of 8 needs): a curated 41-row
intent table maps plain English to canonical jargon plus a GitHub topic, and
a two-arm search unions topic coverage with jargon precision.
- Explainable additive ranking: log-flattened stars, license/age/language,
trusted-author bonus derived from owners we already ship, docs-repo demotion
by name, staleness as a soft demotion rather than a filter (a hard cutoff
would delete THC-Hydan and John the Ripper), and a relevance term weighting
curated topics above free-text description.
- Optional no-scope GitHub token purely as a rate-limit lever (10 -> 30 req/min);
it reaches only an Authorization header, never a cache key, log or output.
- `[a]` saves a pick to ~/.hackingtool/found.yaml as a structurally inert entry,
and the loader strips executable keys from user catalogs at read time so a
hand-edited file cannot become a runnable command.
CONSOLE & PACKAGING
- REPL with a / command palette, @ tool mentions, tag filters, history and
completion; background tmux panes; settings and first-run scaffolding.
- src-layout package with catalog and pipelines as package data, console entry
point, Docker image, signed releases with SBOM and build provenance.
- Health docs (SECURITY, CONTRIBUTING, CHANGELOG, CODE_OF_CONDUCT), a CI gate
(ruff + pytest + catalog/taxonomy conformance) and a pre-push hook.
- README rewritten with a section index, the tool catalog split into
docs/TOOLS.md and a step-by-step docs/HOW-TO-USE.md.
278 tests passing; scripts/check.sh green.
3.8 KiB
Contributing to hackingtool
Thanks for helping. hackingtool serves the whole ethical-hacking spectrum — offensive/red-team, defensive/blue-team, OSINT, bug-bounty, CTF/THM learners, forensics/IR — all working legally and with authorization. Contributions should help each of those users in their own workflow.
Ground rules (non-negotiable)
These are enforced in review and, where possible, by CI:
- Authorized targets only. No feature assumes access to systems the operator doesn't own or isn't explicitly permitted to test.
- No fabrication. AI outputs are validated against closed sets; catalog commands must be real, documented invocations — never invented flags or made-up tools.
- List-form
subprocessonly. Nevershell=Truewith interpolated input. - Pin + verify external downloads. Fetches are pinned and SHA-256 checked.
No
curl | bash, ever. - No forced
sudo. Tools install into~/.hackingtool/, not system paths. - Linux/macOS first. Deprioritize Windows-only
.exetools.
Dev setup
git clone https://github.com/Z4nzu/hackingtool.git
cd hackingtool
make setup # one-time: point git at .githooks (pre-push runs the gate)
uv run hackingtool # run from source (uv provides rich/pyyaml/platformdirs)
The gate — run it before every PR
make check # ruff (must-fix lint) + pytest + catalog/schema validation
This is the exact script CI and the pre-push hook run (scripts/check.sh). A PR is
reviewed as a rubber-stamp of a green gate — so make it green and add a check for
non-trivial logic (an assert-based self-check or a small test_*.py).
Adding a tool
There are two paths. Prefer the catalog — it's data-driven and one entry, no code.
1. Catalog entry (preferred)
Add or extend a YAML file in src/hackingtool/catalog/. You can define a new tool or
overlay guidance onto an existing one (matched by exact title):
overlay:
- title: "Subfinder (Subdomain Enumeration)"
tags: [subdomain-enum, recon, osint, dns] # every tag must be in tags.py TAXONOMY
usage:
- ["passive subdomain enum", "subfinder -d <domain>"]
- ["clean output for pipelines", "subfinder -d <domain> -silent"]
- Tags must all exist in
src/hackingtool/tags.pyTAXONOMY— the single discovery vocabulary. Propose a new tag in that file only when a tool needs it. usageis[description, command]pairs. Commands must be canonical and documented; use placeholders (<domain>,<target>) for operator-supplied values.- Surveillance / C2 / keylogger / RAT tools get tags only — no operational commands.
The gate validates that catalog tags are in the taxonomy and that overlay titles match real tools, so a typo fails CI rather than silently no-op'ing.
2. Python tool class (legacy path)
For tools that need custom install/run logic, add a class to the right tools/*.py
file and follow the pull-request template
checklist (TITLE, DESCRIPTION, INSTALL_COMMANDS, RUN_COMMANDS, PROJECT_URL,
SUPPORTED_OS, and adding it to the collection's TOOLS list). Installers must be
list-form and, for any download, pinned + SHA-256 verified.
Pull requests
- Branch off
master; never commit tomasterdirectly. - Title format:
[New Tool] Name — Category,[Fix] …, or[Improve] …(see the PR template). - Describe what changed and what you tested — every PR carries test notes.
- One logical change per PR.
Reporting bugs & security issues
- Functional bugs → open an issue with the Bug report template.
- Security vulnerabilities → do not open a public issue; follow SECURITY.md.
By contributing you agree your work is licensed under the project's MIT License.