Commit Graph
687 Commits
Author SHA1 Message Date
Justin Bollinger d8c009c334 fix: pass configured rules_directory to all rule download and listing callers
api.py's get_rules_dir() independently re-parsed config.json and could
resolve a different rules path than main.py's rulesDirectory global.
Thread the already-resolved rulesDirectory through download_hashmob_rules
and list_and_download_hashmob_rules so all callers (menu option 90,
--rules flag, quick_crack, loopback_attack) use the same path from config.
2026-03-16 14:44:28 -04:00
Justin Bollinger 83491ea17d docs: update README with recent bug fixes in version history 2026-03-16 14:33:43 -04:00
Justin Bollinger 6df74f7969 fix: use os.path.join for rule paths in quick_crack and loopback_attack
Replace 6 instances of f-string slash concatenation with os.path.join()
for building rule file paths, consistent with get_rule_path() in main.py.
2026-03-16 14:32:14 -04:00
Justin Bollinger 79cb290c11 fix: skip leading blank lines in hash format detection
A blank first line caused the format detection regex chain to fall
through to the error exit. Read lines in a loop and skip empty ones
before matching. Add tests for blank lines with LF, CRLF, whitespace,
and BOM variations.
2026-03-16 14:23:09 -04:00
Justin Bollinger f2572d0a80 fix: handle bare NTLM hash detection with BOM, null bytes, and encoding artifacts
Use utf-8-sig encoding to natively strip BOM and remove null bytes from
UTF-16 artifacts so the bare hash regex matches correctly. Replace the
unhelpful "unknown format" error with a diagnostic message showing the
actual first-line content and expected formats.
2026-03-16 14:17:37 -04:00
Justin Bollinger 83f63ddf23 test: add menu test module 2026-03-16 13:08:59 -04:00
Justin Bollinger 22d8858825 feat: default wordlist autocomplete to hcatWordlists dir and add TUI extra 2026-03-16 12:48:45 -04:00
Justin Bollinger ab11985022 fix: ensure potfile exists before passing --potfile-path to hashcat
When running as root, ~/.hashcat/ exists but hashcat.potfile does not.
Hashcat refuses to create the file when given an explicit --potfile-path.
Create the parent directory and touch the file in _append_potfile_arg()
before appending the flag.
2026-03-16 12:37:36 -04:00
Justin Bollinger e0a79d7c7b refactor: remove vendor-assets wheel build flow, use editable install
- Remove vendor-assets and clean-vendor Makefile targets
- Lima VM test and Dockerfile.test now use make install (editable)
- Remove hate_crack/hashcat-utils from submodules-pre expander generation
- Update README to reflect no-vendoring install
2026-03-16 11:50:32 -04:00
Justin Bollinger a3059c1dd2 fix: fall back to cwd for potfile when ~/.hashcat does not exist
When hashcat is not installed via the standard method, ~/.hashcat/
does not exist. Fall back to hashcat.potfile in the current working
directory instead of referencing a path that does not exist.
2026-03-16 11:42:18 -04:00
Justin Bollinger f51d13c29a refactor: make install target truly idempotent
- Skip hashcat-utils build when bin/expander.bin already exists
- Skip princeprocessor build when pp64.bin already exists
- Skip expander source generation when expander8.c already exists
- Skip OS dependency installs when 7z/transmission-cli already present
- Break up submodules-pre one-liner into readable multi-line script
2026-03-16 11:40:41 -04:00
Justin Bollinger b8aebbc65e fix: add missing menu.py module to tracked files
hate_crack/menu.py was imported by main.py but never committed,
causing ModuleNotFoundError on fresh installs.
2026-03-16 11:38:05 -04:00
Justin Bollinger f529667201 fix: resolve uv binary path after fresh install in Makefile
The uv installer adds ~/.local/bin/uv but does not update the current
shell PATH. Use the discovered path or fall back to ~/.local/bin/uv
so the subsequent uv tool install succeeds on first run.
2026-03-16 11:36:17 -04:00
Justin Bollinger 74dd294b38 fix: fall back to ~/.hate_crack for config instead of cwd
When no candidate directory has hate_crack assets, config destination
fell back to cwd which fails on read-only filesystems like /.
2026-03-16 11:33:47 -04:00
Justin Bollinger 5dbd5bfd6f fix: use .get() with defaults for ollama/omen/update config keys
Config keys added after initial release (ollamaModel, ollamaNumCtx,
omenTrainingList, omenMaxCandidates, check_for_updates) raised KeyError
when config.json.example was not found for auto-injection.
2026-03-16 11:33:05 -04:00
Justin Bollinger 2be067df30 docs: add troubleshooting for master-to-main branch rename error 2026-03-16 11:25:51 -04:00
Justin Bollinger 4df759be3b fix: graceful config loading with auto-inject for missing keys
- Add JSON parsing error handling with user-friendly messages for
  malformed config.json (shows line/column and fix instructions)
- Handle corrupt config.json.example with package reinstall guidance
- Consolidate auto-inject messaging to single summary line instead
  of one message per missing key
- Remove ~20 redundant KeyError handlers since auto-inject ensures
  all keys exist before they're read
2026-03-13 21:21:25 -04:00
Justin Bollinger 7f3f33e0bf feat: return to main menu on double Ctrl+C within 2 seconds
Install a custom SIGINT handler that tracks interrupt timing. A single
Ctrl+C raises KeyboardInterrupt as before (kills the current subprocess
and continues). A second Ctrl+C within 2 seconds raises DoubleInterrupt,
which bypasses all existing per-subprocess handlers and is caught at the
main menu loop, printing "[!] Returning to main menu..." and resuming
the menu.

Preprocessing and cleanup sections also catch DoubleInterrupt to ensure
temp file cleanup runs before re-raising.
2026-03-10 14:03:30 -04:00
Justin Bollinger 984bc23f21 test: increase hashcat timeout to 300s for slow GPU init 2026-03-10 12:32:42 -04:00
Justin Bollinger 17f7fb6463 fix: resolve OMEN binary path from repo root as fallback
In dev checkouts where submodules are built in the repo root rather than
vendored into hate_path, OMEN binaries were not found. Introduces _omen_dir
that checks hate_path/omen first and falls back to the repo root omen dir.
Also removes vendor-assets from install/update targets and drops vendored
submodule paths from pyproject.toml package data.
2026-03-10 12:28:14 -04:00
Justin Bollinger c85808e5c3 fix: handle Hashview create_job error response correctly
When the Hashview server returns HTTP 200 with an error message and no
job_id (due to its internal notify_email bug), the CLI and interactive
paths now:
- exit 1 (not 0) in the CLI path
- print "✗ Error" instead of "✓ Success"
- print a hint to check the Hashview UI before retrying, preventing
  duplicate job creation

Adds test for the error response path in test_cli_flags.py.
2026-03-09 13:17:50 -04:00
Justin Bollinger 1244cb1e29 fix: stop sending notify_email in create_job, clarify format override prompt
notify_email is not supported by all Hashview servers and caused job
creation to fail. Changed default to None so it is omitted from the
request unless explicitly passed.

Also reworded the file format override prompt so the detected name does
not appear twice in the output.
2026-03-09 12:39:10 -04:00
Justin Bollinger 0a8cf98869 fix: allow format override in interactive hashview upload hashfile job
Auto-detection still runs but the user can now confirm or change the
detected file format before the upload is sent.
2026-03-09 12:22:11 -04:00
Justin Bollinger d166e9b0ac chore: remove hashcat submodule
hashcat is now a system dependency (installed via apt/brew or PATH) rather
than a compiled submodule. The Lima VM provision script installs it via apt,
and local installs are expected to have hashcat available in PATH.

- Remove hashcat entry from .gitmodules
- Remove hashcat/ submodule checkout
- Remove hashcat submodule skip logic from Makefile submodules target
- Simplify submodules-pre hashcat check to PATH-only
- Update vendor-assets and clean targets to remove submodule references
- Update README: hashcat is now a required prerequisite, not optional
- Document Lima VM E2E prerequisites (lima, rsync) and list all packages
  provisioned automatically by the test VM
2026-03-06 15:51:10 -05:00
Justin Bollinger 9485be4a38 test: harden Lima VM E2E tests
- Add rsync to _require_lima() prerequisite check; missing rsync now
  skips cleanly instead of failing with an opaque command-not-found
- Add _truncate_output() helper and apply to all assertion messages to
  keep failure output readable when make/install emits thousands of lines
- Increase limactl start timeout from 300s to 600s to accommodate slow
  Ubuntu image downloads
- Add limactl stop before delete in cleanup for more reliable teardown
- Add flag verification to test_lima_vm_install_and_run: checks 10 CLI
  flags in --help output, matching the local install test pattern
- Add 3 unit tests: test_truncate_output_trims_long_text,
  test_truncate_output_short_text_unchanged,
  test_require_lima_skips_without_rsync
2026-03-06 15:28:53 -05:00
Justin Bollinger 5a62b40b94 fix: skip hashcat rule tests on OpenCL device build failures
OpenCL/device build errors are environment-specific issues, not code
bugs. Detect clCreateProgramWithBinary and kernel build failures in
stderr and pytest.skip instead of pytest.fail.
2026-03-03 15:00:52 -05:00
Justin Bollinger 39522f5d75 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 102facf42a 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 8222e0a29e 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 fe7b9def34 docs: rewrite TESTING.md and update README git hooks section 2026-03-02 17:41:56 -05:00
Justin Bollinger b269c56d91 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 2f6e6350c3 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 BollingerandClaude Opus 4.6 2d5df403d3 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 BollingerandClaude Sonnet 4.6 9db50a2bae 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 BollingerandClaude Sonnet 4.6 01a55e52ff 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 BollingerandClaude Sonnet 4.6 4c3e1d9a6e 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 BollingerandGitHub 21c72818e3 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 BollingerandClaude Sonnet 4.6 eb7bd87f4b 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 BollingerandClaude Sonnet 4.6 4a7b12adbb 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 BollingerandClaude Sonnet 4.6 8469f5338c 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 BollingerandClaude Sonnet 4.6 a633bdecca 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 BollingerandClaude Sonnet 4.6 3c50355d44 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 BollingerandClaude Opus 4.6 7aa77f8540 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 BollingerandClaude Opus 4.6 e6bb432473 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 BollingerandGitHub 17f80dc29e 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 BollingerandClaude Opus 4.6 a3a8951c6f 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 BollingerandClaude Opus 4.6 f11fd19d35 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 BollingerandClaude Opus 4.6 e3645c0913 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 BollingerandClaude Opus 4.6 302b99716f fix: use tab-completion file selector for analyze hashcat rules
The analyze_rules() function used plain input() instead of
select_file_with_autocomplete(), making it the only file-input
prompt without tab-completion support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 22:48:11 -05:00
Justin BollingerandClaude Opus 4.6 14f5b36382 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