Commit Graph

463 Commits

Author SHA1 Message Date
Justin Bollinger
aa9d326e2d chore: remove GitHub Actions workflows
Quality checks run locally via prek pre-push hooks. CI workflows
(ruff, ty, pytest, lint-infra, version-bump) are no longer needed.
Updated docs to remove all GitHub Actions references.
v2.1.0
2026-03-03 14:42:57 -05:00
Justin Bollinger
613c16e567 refactor: remove PassGPT attack (option 17)
Remove the ML-based PassGPT password generation feature entirely:
modules, config keys, [ml] optional dependency group, menu entries,
tests, and documentation.
2026-03-03 14:31:41 -05:00
Justin Bollinger
63c3ab93d2 test: add 23 unit tests for all CLI flags and argparse errors
Cover --weakpass, --hashmob, --rules, --cleanup, --download-torrent,
--download-all-torrents, --hashview, --download-hashview, --rank,
--potfile-path, --no-potfile-path, --debug, positional hashfile/hashtype
args, hashview download-hashes subcommand, upload-hashfile-job with
--limit-recovered/--no-notify-email, and argparse error cases.
2026-03-02 21:23:28 -05:00
Justin Bollinger
3b2778026c docs: rewrite TESTING.md and update README git hooks section 2026-03-02 17:41:56 -05:00
Justin Bollinger
83e22769b5 fix: remove forced HATE_CRACK_RUN_LIMA_TESTS=1 from pytest-lima hook
The hook was forcing Lima VM tests on every push, causing 5-minute timeouts
when limactl has to download the Ubuntu cloud image. The test already has a
skip guard - remove the env var from the hook entry so it stays opt-in.
2026-03-02 17:24:41 -05:00
Justin Bollinger
978a24a7c2 test: add 150 tests for attacks, wrappers, utils, api, and proxy
- tests/test_attacks_behavior.py: 29 tests for attack handler logic
  (loopback, extensive, top_mask, combinator, hybrid, ollama, simple pass-throughs)
- tests/test_hashcat_wrappers.py: 33 tests for hashcat subprocess wrappers
  (brute force, quick dict, combination, hybrid, prince, recycle, good measure, etc.)
- tests/test_main_utils.py: 44 tests for utility functions
  (_append_potfile_arg, generate_session_id, _ensure_hashfile_in_cwd,
  _run_hashcat_show, _dedup_netntlm_by_username, path resolution, cleanup)
- tests/test_api_downloads.py: 25 tests for api.py functions
  (sanitize_filename, check_7z, potfile config, hashmob key, extract_with_7z, download)
- tests/test_proxy.py: 18 tests for root module proxy mechanism
  (__getattr__, _sync_globals_to_main, _sync_callables_to_main, symbol re-export)

Also fix combinator_crack to abort gracefully when hcatCombinationWordlist is
a single string (only 1 wordlist configured) instead of crashing with IndexError.
2026-03-02 17:16:54 -05:00
Justin Bollinger
c60668fb06 fix: handle KeyboardInterrupt in hashview_api without crashing
Ctrl+C at the hashview customer ID prompt called quit_hc(), which calls
cleanup(), but cleanup() assumed hcatHashFileOrig was set. When no hash
file is loaded yet, this caused a TypeError. Now hashview_api returns to
the main menu on KeyboardInterrupt (matching hashmob/weakpass behavior),
and cleanup() guards against None hcatHashFileOrig defensively.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:21:42 -05:00
Justin Bollinger
4bd77905b2 docs: document prek 0.3.3 config format in CLAUDE.md
Note the repos-based TOML schema, correct install command, and the
breaking change from the old commands = [...] format.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 21:38:32 -05:00
Justin Bollinger
405629ce4e fix: migrate prek.toml to repos format compatible with prek 0.3.3
The old commands = [...] format was a custom schema prek no longer
supports. Rewrite as local-repo hooks (language: system, always_run:
true) matching the pre-commit config schema prek 0.3.3 expects.
Hooks are identical: ruff, ty, pytest, pytest-lima (pre-push) and
audit-docs (post-commit).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 21:34:39 -05:00
Justin Bollinger
21580eefee fix: suppress invalid-method-override on LazyPasswordDataset.__getitem__
The return type dict[str, object] is intentionally more specific than
the generic Dataset[_T_co] base. Suppress the override check; the
class already uses type: ignore[type-arg] for the same reason.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 18:55:59 -05:00
Justin Bollinger
e599f8d53a fix: remove persist-credentials: false so version-bump push succeeds
The git push in the Bump version step was failing because
persist-credentials: false strips the GITHUB_TOKEN from the git config.
The existing permissions: contents: write grant is sufficient; restoring
the default (persist-credentials: true) lets the push authenticate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 18:48:13 -05:00
Justin Bollinger
ddcccd2809 Merge pull request #79 from trustedsec/dev/fresh-install-fixes
Fresh install fixes, Lima VM E2E tests, princeprocessor submodule
2026-02-20 18:39:22 -05:00
Justin Bollinger
a4f50100d8 fix: add 'repository directory' to README hcatPath note
Satisfies test_readme_documents_correct_usage assertion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 18:35:12 -05:00
Justin Bollinger
6b6c2f8b4b feat: add Lima VM E2E tests and fix princeprocessor build
Add Ubuntu 24.04 Lima VM test track that runs hate_crack installation
end-to-end in a real VM, giving higher confidence than Docker-based tests.

- Add lima/hate-crack-test.yaml: Ubuntu 24.04 VM config with hashcat and
  build deps pre-installed via apt; uv installed via official installer
- Add tests/test_lima_vm_install.py: mirrors Docker E2E test structure;
  uses rsync with targeted excludes (wordlists, compiled host binaries)
  and builds wheel directly to avoid setuptools-scm sdist file filtering
- Fix Makefile: add princeprocessor build step with aarch64-compatible
  CFLAGS (drops -m64); copy binary to submodule root for vendor-assets
- Add Lima tests to prek.toml pre-push hook
- Document Lima VM tests in TESTING.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 18:27:09 -05:00
Justin Bollinger
858d343e44 chore: add readme-documentarian agent to project
Copies the global readme-documentarian agent definition into
.claude/agents/ so it is available project-locally and committed
with the repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 16:36:09 -05:00
Justin Bollinger
61494c2721 feat: add PostToolUse hook to auto-trigger readme-documentarian
Adds a Bash PostToolUse hook that detects the prek documentation audit
warning and injects additionalContext into Claude's session, prompting
it to invoke the readme-documentarian agent automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 16:33:12 -05:00
Justin Bollinger
d51158c1d3 fix: Docker build now compiles submodules correctly
- Remove .gitmodules from .dockerignore so the build loop can discover
  which directories to compile
- Add git to Dockerfile apt installs (needed for git config --file parsing)
- Gate git submodule update --init on .git presence, not .gitmodules;
  the compile loop still runs in Docker since .gitmodules is now present
- hashcat skipped in Docker build loop since system hashcat is in PATH

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 16:25:48 -05:00
Justin Bollinger
67ed8c1ee3 fix: make test auto-sets HATE_CRACK_SKIP_INIT when binaries not built
Removes the need to manually prefix HATE_CRACK_SKIP_INIT=1 when running
make test or make coverage in a dev environment without compiled submodules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 16:22:29 -05:00
Justin Bollinger
15b3ab77fd feat: add hashcat/princeprocessor submodules, fix fresh-install setup
- Add hashcat as git submodule; compile with make, skip if already in PATH
- Convert princeprocessor from tracked files to git submodule
- Change .DEFAULT_GOAL to install so plain `make` does a full install
- Install uv, Xcode CLT (macOS), build-essential (Debian) if missing
- vendor-assets falls back to system hashcat if submodule not compiled
- Remove hcatOptimizedWordlists; all attacks now use hcatWordlists
- Default hcatWordlists to ./wordlists, rules_directory to ./hashcat/rules
- Default hcatTuning to empty string (no --force --remove)
- Backfill missing config.json keys from config.json.example at startup
- Wrap hcatBin/hcatTuning/hcatWordlists loading in try/except with defaults
- Fall back to vendored hashcat binary at hate_path/hashcat/hashcat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 16:19:07 -05:00
Justin Bollinger
fed5da12a3 fix: pin actionlint to v1.7.11 release URL
The /latest/download/ URL redirects to the newest release, but the
filename was hardcoded to 1.7.7. Pin both tag and filename to avoid
breakage on future releases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:51:01 -05:00
Justin Bollinger
34867d2be3 chore: ignore dirty submodule working trees in git status
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:48:40 -05:00
Justin Bollinger
e33f2dcb3a Merge pull request #78 from trustedsec/dev/align-global-standards
Align CI and tooling with global development standards
2026-02-19 12:44:36 -05:00
Justin Bollinger
de2b400f6d chore: align CI and tooling with global development standards
- Remove 6 duplicate per-version pytest workflows (matrix build covers all)
- Pin GitHub Actions to SHA hashes with version comments
- Add persist-credentials: false to checkout steps
- Replace mypy with ty for type checking (faster, stricter)
- Pin dev deps to exact versions (ty==0.0.17, ruff==0.15.1, pytest==9.0.2, pytest-cov==7.0.0)
- Remove types-* stub packages (ty doesn't need them)
- Remove stale [dependency-groups] section from pyproject.toml
- Update shell scripts to use set -euo pipefail
- Add prek.toml for git hook management (pre-push, post-commit)
- Add lint-infra.yml workflow (shellcheck + actionlint)
- Fix actionlint warning: pass github.head_ref through env var
- Track CLAUDE.md and .claude/ scripts in git
- Update README.md and Makefile references from mypy to ty

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:42:51 -05:00
Justin Bollinger
e7f4ed815b fix: exclude omen directory from mypy checking
Vendored third-party OMEN utils were also failing mypy on push.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 11:43:22 -05:00
Justin Bollinger
2142732bfa fix: exclude omen directory from ruff linting
Vendored third-party OMEN utils were failing ruff checks on push.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 11:43:04 -05:00
Justin Bollinger
f0bba73225 fix: auto-detect training device instead of defaulting to CUDA
The PassGPT training device menu now uses _detect_device() to default
to the best available device (CUDA > MPS > CPU) rather than always
defaulting to CUDA, which fails on systems without NVIDIA GPUs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:47:41 -05:00
Justin Bollinger
00a60af9a6 Merge pull request #77 from trustedsec/bug/debug-flag-show-http-requests
fix: set HF_HUB_DISABLE_TELEMETRY before HuggingFace imports
v2.0.2
2026-02-18 15:36:24 -05:00
Justin Bollinger
893533c200 fix: set HF_HUB_DISABLE_TELEMETRY before HuggingFace imports in main.py
The env var was only set in the subprocess scripts (passgpt_generate.py,
passgpt_train.py) but not in main.py, where torch/transformers are imported
at module level. This ensures telemetry is disabled before any HF-related
imports and is inherited by spawned subprocesses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 15:34:11 -05:00
Justin Bollinger
546c608c33 fix: pass --debug flag to PassGPT subprocesses and create GitHub Releases on version bump
PassGPT generate/train scripts now accept --debug to log HuggingFace HTTP
requests. Version-bump workflow creates a GitHub Release (not just a tag)
so check_for_updates can find /releases/latest. Bump logic now uses minor
for feat/ branches and patch for everything else.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 15:26:53 -05:00
Justin Bollinger
446fbd6d95 fix: --debug flag now outputs HTTP requests to screen
Enable urllib3 debug logging when --debug is active so all requests
made via the requests library are visible on stderr.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 15:17:36 -05:00
Justin Bollinger
c67a2f6800 Merge pull request #76 from trustedsec/feat/passgpt-attack
feat: add PassGPT attack, version bump workflow, and editable install
v2.0.1
2026-02-18 15:00:16 -05:00
Justin Bollinger
41b51818c1 feat: auto-bump patch version on PR merge to main
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:58:47 -05:00
Justin Bollinger
c0d2cad2c1 fix: skip ML-dependent tests in CI and mock version in version check test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:52:16 -05:00
Justin Bollinger
603375d83f fix: use editable install so updates apply to the repo directory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:47:15 -05:00
Justin Bollinger
b6524cbdc4 feat: add training time estimates and device selection to PassGPT menu
Show estimated training times for CUDA/MPS/CPU before starting a
training run. Add device selection prompt with cuda as the default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 11:27:09 -05:00
Justin Bollinger
cda9364071 fix: add accelerate to ml optional dependencies
Trainer from transformers requires accelerate>=1.1.0 at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 10:51:51 -05:00
Justin Bollinger
fcfe6890f6 feat: add memory pre-checks and optimize PassGPT training for large wordlists
Training previously loaded entire wordlists into RAM and tokenized all at
once, causing OOM on large files like rockyou.txt. This adds memory
estimation, lazy dataset loading, and training optimizations.

- Add _get_available_memory_mb() for cross-platform RAM detection
- Add _estimate_training_memory_mb() to predict peak usage before loading
- Replace bulk tokenization with LazyPasswordDataset (file offset index + on-the-fly tokenization)
- Add --max-lines flag to limit training to first N lines
- Add --memory-limit flag to auto-tune --max-lines based on available RAM
- Enable gradient checkpointing and gradient accumulation (steps=4)
- Enable fp16 on CUDA devices

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 10:47:44 -05:00
Justin Bollinger
56aaa9b47d feat: add PassGPT model fine-tuning and training menu integration
Add ability to fine-tune PassGPT models on custom password wordlists.
Models save locally to ~/.hate_crack/passgpt/ with no data uploaded to
HuggingFace (push_to_hub=False, HF_HUB_DISABLE_TELEMETRY=1). The
PassGPT menu now shows available models (default + local fine-tuned)
and a training option. Adds datasets to [ml] deps and passgptTrainingList
config key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 09:51:06 -05:00
Justin Bollinger
4a7f0724d9 feat: add startup version check, fix PassGPT MPS/output issues, hide menu without ML deps
- Add optional startup version check against GitHub releases (check_for_updates config option)
- Add packaging dependency for version comparison
- Fix PassGPT OOM on MPS by capping batch size to 64 and setting memory watermark limits
- Fix PassGPT output having spaces between every character
- Hide PassGPT menu item (17) unless torch/transformers are installed
- Fix mypy errors in passgpt_generate.py with type: ignore comments
- Update README with version check docs, optional ML deps section, and PassGPT CLI options
- Add test_version_check.py with 8 tests covering update check behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 09:32:40 -05:00
Justin Bollinger
87535b9828 feat: add PassGPT attack (#17) - GPT-2 based ML password generator
Add PassGPT as attack mode 17, using a GPT-2 model trained on leaked
password datasets to generate candidate passwords. The generator pipes
candidates to hashcat via stdin, matching the existing OMEN pipe pattern.

- Add standalone generator module (python -m hate_crack.passgpt_generate)
- Add [ml] optional dependency group (torch, transformers)
- Add config keys: passgptModel, passgptMaxCandidates, passgptBatchSize
- Wire up menu entries in main.py, attacks.py, and hate_crack.py
- Auto-detect GPU (CUDA/MPS) with CPU fallback
- Add unit tests for pipe construction, handler, and ML deps check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 08:41:22 -05:00
Justin Bollinger
ae47d453c0 docs: add OMEN attack documentation to README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:44:31 -05:00
Justin Bollinger
169d945546 Merge pull request #75 from trustedsec/feat/omen-attack
feat: add OMEN attack as menu option 16
2026-02-17 15:38:35 -05:00
Justin Bollinger
0c27b8fb28 chore: add generated file patterns to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:36:33 -05:00
Justin Bollinger
a53ed293b6 fix: add types-requests dev dependency to resolve mypy import-untyped error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:21:07 -05:00
Justin Bollinger
79e3c0f6e9 fix: detect lowercase makefile in submodule build loop
OMEN uses lowercase `makefile` which was missed by the capital-M check.
On case-sensitive filesystems (Linux) this meant OMEN wouldn't be built
during `make submodules`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:04:11 -05:00
Justin Bollinger
61ef838673 fix: bail out early in omen_attack handler when binaries are missing
The handler was prompting for training source and max candidates even
when the OMEN binaries weren't built, leading to confusing error output.
Now checks for createNG and enumNG up front and returns with a build
instruction if either is missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:03:39 -05:00
Justin Bollinger
0991701024 feat: add OMEN attack as menu option 16
Add OMEN (Ordered Markov ENumerator) as a probability-ordered password
candidate generator. Trains n-gram models on leaked passwords via
createNG, then pipes candidates from enumNG into hashcat.

Also fix a pre-existing bug where ensure_binary() used quit(1) instead
of sys.exit(1) - quit() closes stdin before raising SystemExit, which
caused "ValueError: I/O operation on closed file" when any optional
binary check failed and the program continued to use input().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:01:58 -05:00
Justin Bollinger
5c3eee9f04 Merge pull request #74 from trustedsec/feat/netntlm-computer-filter
feat: NetNTLM computer account filtering
2026-02-17 13:24:02 -05:00
Justin Bollinger
97997daf15 feat: add computer account filtering for NetNTLM hash types (5500/5600)
Reuses existing _count_computer_accounts() and _filter_computer_accounts()
to optionally strip computer accounts before NetNTLM deduplication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 13:23:36 -05:00
Justin Bollinger
4ae7a2b94e test: add E2E preprocessing flow tests for computer account filtering
Add TestE2EPreprocessingFlow class that simulates the exact main()
preprocessing logic (format detection, filtering, NT/LM extraction)
with realistic secretsdump.py output. Covers: filter accept/decline,
no computers, all computers, LM hash detection, domain\computer$
format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 13:10:38 -05:00