Commit Graph

682 Commits

Author SHA1 Message Date
Justin Bollinger 8b58963660 docs: add v2.10.5 version history entry
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 12:02:17 -04:00
Justin Bollinger 013ad55196 fix(pipal): preserve newline on $HEX[...] cracked rows
binascii.unhexlify().decode() returned bytes without the trailing newline
that normal rows inherit from password[-1], so HEX-encoded cracked
passwords concatenated with the next entry in the .passwords file fed to
pipal. Pipal under-counted entries and ranked corrupted mashups as base
words. Re-append \n if missing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 12:02:17 -04:00
Justin Bollinger f52d53a35c Merge branch 'dev' into main v2.10.4 2026-05-28 11:44:46 -04:00
Justin Bollinger 894823c61c Merge branch 'fix/pushover-notification-name-mismatches' into dev 2026-05-28 11:44:43 -04:00
Justin Bollinger 03fdb30cd0 docs: add v2.10.4 version history entry
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 11:44:06 -04:00
Justin Bollinger f0e123ce93 fix(notify): align attack name passed to _should_fire with prompt name (#110)
Pushover notifications were silently dropped for Quick Crack, Loopback,
Combinator, PRINCE-LING and N-gram because the handlers prompted under
one name (e.g. "Quick Crack") while the underlying hashcat wrapper
fired with a different label ("Quick Dictionary"). _should_fire keyed
the per-run consent on the prompt name, so the consent check at fire
time always missed.

Threaded the prompt name down to _run_hcat_cmd by:
- Adding attack_name kwargs to hcatQuickDictionary and hcatPrince, the
  two wrappers shared by multiple user-facing handlers.
- Relabelling hcatCombination/Combinator3/CombinatorX (all reach the
  user via combinator_crack which prompts "Combinator") and hcatNgramX
  (single caller: ngram_attack prompting "N-gram").
- Updating quick_crack, loopback_attack, and hcatPrinceLing to pass the
  matching attack_name override.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 11:40:26 -04:00
Justin Bollinger 111a953340 Merge branch 'dev' into main v2.10.3 2026-05-26 17:06:09 -04:00
Justin Bollinger 030045519b Merge branch 'bugfix/auto-update-branch-switch' into dev 2026-05-26 16:48:48 -04:00
Justin Bollinger b3e0d55719 docs: add v2.10.3 version history entry
Covers the auto-upgrade-loop fix shipping in this patch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:31:22 -04:00
Justin Bollinger 071f0cf868 fix(update): switch to main before pull to stop upgrade loop on dev
Symptom: user on the `dev` branch upgrading from v2.10.0 to v2.10.2 saw
the "Upgrade now? [y/N]" prompt fire on every restart. Accepting it ran
the install pipeline successfully but the next launch re-prompted the
same way.

Root cause: release tags in this repo live on main-side merge commits
(e.g. v2.10.2 is on the `Merge branch 'dev' into main` commit). That
commit is *downstream* of `dev`, so walking back from dev's HEAD,
setuptools-scm finds only v2.10.0 and reports e.g. `2.10.0.post1.dev9`.
After hate_crack/__init__.py strips the post/dev suffix, `__version__`
is `"2.10.0"` again. check_for_updates() sees `2.10.2 > 2.10.0` and
re-prompts forever. `git pull` on dev is a no-op because dev is fully
synced — the tag just isn't on the branch.

Fix: _run_upgrade() now detects the current branch via `git symbolic-ref
--short HEAD`. If it's not `main`, refuse to clobber uncommitted work
(git status --porcelain), then `git checkout main` before running the
existing pull/install pipeline. The release-tagged commit is now on
HEAD, setuptools-scm regenerates a clean version, and the loop ends.

Safety guards:
  - Uncommitted changes: bail with manual-steps message (exit 1) — no
    git checkout attempted.
  - main checked out in another worktree: surface git's stderr and bail
    with manual instructions.
  - Detached HEAD (symbolic-ref returncode != 0): skip the switch and
    let the existing flow run — no regression for users on a tag.
  - Already on main: skip the switch block; behavior unchanged.

Tests (tests/test_version_check.py):
  - test_run_upgrade_switches_from_dev_to_main_then_upgrades
  - test_run_upgrade_bails_when_non_main_branch_is_dirty
  - test_run_upgrade_bails_when_checkout_main_fails
  - test_run_upgrade_skips_switch_when_already_on_main
  - test_run_upgrade_skips_switch_on_detached_head

Four pre-existing tests updated to thread an extra branch_proc mock
through the new symbolic-ref subprocess call.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:31:14 -04:00
Justin Bollinger 89e2d73ceb Merge branch 'dev' into main v2.10.2 2026-05-26 15:10:07 -04:00
Justin Bollinger fb15702be5 docs: add v2.10.2 version history entry
Covers the two fingerprint-attack bugfixes shipping in this patch:
the empty-.expanded guard and the LC_ALL=C sort locale fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 15:09:05 -04:00
Justin Bollinger 42338646b7 Merge branch 'bugfix/sort-illegal-byte-sequence' into dev 2026-05-26 15:04:46 -04:00
Justin Bollinger 4eacf9d9ee fix: force LC_ALL=C for sort -u subprocesses to handle non-UTF-8 bytes
macOS `sort` is locale-strict: under LC_COLLATE=en_US.UTF-8 (the default
on most macOS shells) it errors out with "sort: Illegal byte sequence"
when stdin contains bytes that are not valid UTF-8. Cracked-password
streams routinely contain such bytes - hex-encoded fields, mixed
encodings, binary garbage from poorly-encoded source hashes - so this
fires in real fingerprint runs whenever the pot already has any non-
ASCII output.

Symptom in the fingerprint attack: the expander -> sort pipeline emits
"sort: Illegal byte sequence" and produces an empty .expanded file. The
empty-.expanded guard added in the previous patch then triggers the
"no candidates to expand" skip message - which is misleading, because
the user does have cracks; they just got dropped on the sort step.

Pass env={**os.environ, "LC_ALL": "C"} to all three subprocess.Popen
calls that invoke `sort -u`:
  - _write_field_sorted_unique  (main.py:1163)
  - hcatFingerprint expander    (main.py:1544)
  - hcatLMtoNT combinator dedupe (main.py:2995)

LC_ALL=C makes sort byte-collation only. Dedup correctness is
unaffected (byte equality is locale-independent), and hashcat doesn't
care about wordlist order.

Also adds an AST-level test that fails if any future `sort` Popen lacks
an env kwarg, so the locale fix can't silently regress.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 15:04:42 -04:00
Justin Bollinger 8d044c3967 Merge branch 'bugfix/fingerprint-empty-expanded-guard' into dev 2026-05-26 14:57:33 -04:00
Justin Bollinger 3d79d2d101 test: repair pre-existing flakes in cli_flags, fingerprint iter, submodule
Three unrelated test issues were masking the fingerprint regression
above and need to be green for the suite to be trustworthy:

1. tests/test_cli_flags.py: 7 tests monkeypatched input() to return "5",
   but in the no-hashfile main menu "5" enters the Wordlist Tools
   submenu and then loops forever on "Split by Length" / "File not
   found". Changed to "7" (Exit), the documented exit option.

2. tests/test_fingerprint_expander_and_hybrid.py: the iter-based
   lineCount mock (iter([1,1,1])) raised StopIteration because
   _run_hcat_cmd now also calls lineCount once per invocation when
   notifications fire. Replaced with a constant `lambda _p: 1` so the
   test no longer couples to internal call counts.

3. tests/test_submodule_hashcat_utils.py: `git submodule update --init`
   exits 0 in git worktrees but does not populate submodule
   directories. The test failed environmentally for anyone running it
   from a worktree. After the init attempt, if the dir is still empty,
   pytest.skip with a clear message rather than fail - preserves the
   original intent for normal checkouts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:57:22 -04:00
Justin Bollinger d1b499dd0a fix(fingerprint): skip hashcat when expanded wordlist is empty
When no hashes have been cracked yet, the fingerprint attack's expander
pipeline produces an empty {hash}.expanded file. Previously the function
would still launch a hashcat combinator session against two empty
wordlists (and, when invoked via the menu, six more hashcat sessions
from the secondary hybrid pass) - wasting cycles and creating confusing
empty intermediate files.

Add an early-exit guard after the expander pipeline: if .expanded is
empty, print an informative skip message and break out of the loop
before invoking hashcat or hcatHybrid.

Mirrors the existing "if hcatNewPasswords > 0" guard pattern in
hcatRecycle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:57:11 -04:00
Justin Bollinger 1b28bdbd5c Merge branch 'dev' into main v2.10.1 2026-05-05 19:45:21 -04:00
Justin Bollinger b5a84863c9 docs: add v2.10.1 version history entry 2026-05-05 19:45:14 -04:00
Justin Bollinger dcdae145f9 Merge branch 'chore/bump-hashcatrosetta' into dev 2026-05-05 19:44:02 -04:00
Justin Bollinger b623a0eb6d chore(deps): bump HashcatRosetta to v0.2.0, add click runtime dep
Resolves Dependabot alert #1 — vulnerable pytest tmpdir handling
(< 9.0.3) in HashcatRosetta/requirements.txt. Upstream v0.2.0
drops pytest from runtime requirements and now depends on click
for its CLI/formatting module, so add click>=8.0.0 to hate_crack
runtime deps to keep display_rule_opcodes_summary functional.
2026-05-05 19:41:21 -04:00
Justin Bollinger a881c36537 Merge branch 'dev' into main v2.10.0 2026-05-05 18:51:14 -04:00
Justin Bollinger 3cb40be393 Merge branch 'bugfix/hashview-download' into dev 2026-05-05 18:51:09 -04:00
Justin Bollinger 66e1f3935e test(hashview-download): strengthen assertions, add NTLMv2 rsplit coverage
- Strengthen left-file assertions to verify hash-only lines and exclude passwords
- Add test_download_left_rsplit_ntlmv2 to verify rsplit(":", 1) correctly handles
  multi-colon hashes like NTLMv2 potfile format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 18:36:47 -04:00
Justin Bollinger b7c81a3f36 fix(hashview-download): append found hashes to left file, fix rsplit for NTLMv2 2026-05-05 17:47:52 -04:00
Justin Bollinger 811606e796 feat(wordlist-optimize): accept directories as input, inline tab-completion display, add Wordlist/Rule Tools to main menu
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 15:42:56 -04:00
Justin Bollinger 31c476a7a2 fix(wordlist-optimize): use rli.bin (hash-set) instead of rli2.bin (sorted merge-join)
wordlist_optimize worker called wordlist_subtract_single (rli2.bin), which
requires both files to be lexicographically sorted. splitlen.bin preserves
insertion order, so rli2.bin silently missed duplicates. Switch to
wordlist_subtract (rli.bin), which loads the remove-list into a hash set and
is order-independent. Also add "(comma-separated)" to the input paths prompt.
Update worker tests to patch wordlist_subtract instead of wordlist_subtract_single.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 21:26:47 -04:00
Justin Bollinger 81015787ed fix(wordlist-optimize): remove allow_multiple crash, redundant import, add worker tests
- Remove `allow_multiple=True` from wordlist_optimize handler to avoid
  AttributeError when the return value is a list rather than a str
- Remove redundant `import tempfile` inside wordlist_optimize worker body
  (tempfile is already imported at module level on line 29)
- Add TestWordlistOptimizeWorker with 6 tests covering: fast-path
  (empty outdir), merge-path (subtract+append), new-length copy,
  splitlen failure, subtract failure, and missing-input skip

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 21:20:53 -04:00
Justin Bollinger efd525a4a7 feat(wordlist-tools): add Optimize Wordlists submenu option (8)
Adds wordlist_optimize worker to main.py that consolidates multiple
wordlists into per-length deduplicated files using splitlen.bin and
rli2.bin. Wires handler in attacks.py and registers it as option 8 in
the Wordlist Tools submenu. Adds 16 tests covering happy path, empty
input, missing files, empty outdir, failure path, and submenu dispatch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 21:13:10 -04:00
Justin Bollinger 1282f12e2a fix(menu): plain numbered menu by default with aligned key columns
- Switch default from simple-term-menu (arrow-key) to plain numbered
  input so all keys including 10+ can be selected by typing a number;
  arrow-key mode is now opt-in via HATE_CRACK_ARROW_MENU=1
- Right-align key numbers within brackets so single- and multi-digit
  items line up: [ 1] through [99]
- Use [key] format consistently in both plain and arrow-key modes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 18:38:03 -04:00
Justin Bollinger 17ca2e57b3 refactor(menu): close numbering gap, renumber attacks 13-24 → 10-21
Menu options jumped from 9 to 13 because items 10-12 were removed
historically but remaining items kept their old numbers. Renumbers
the contiguous attack block to 10-21, closing the gap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 18:37:57 -04:00
Justin Bollinger 998e680017 fix(attacks): support range syntax in rule selection (e.g. 138-141)
Rule numbers entered as N-M now expand to all integers in that range
before lookup, matching user expectation that 138-141 selects rules
138 through 141 sequentially. Also catches ValueError alongside
IndexError when a token cannot be converted to int.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 18:37:10 -04:00
Justin Bollinger 59ebf9db7f Merge feature/pcfg-integration: PCFG and PRINCE-LING attacks 2026-05-04 09:18:59 -04:00
Justin Bollinger 4b7ebb53b8 test(pcfg): add UI menu option tests for #23 and #24 2026-05-04 09:11:52 -04:00
Justin Bollinger 1d38a6b939 feat(pcfg): register PCFG attacks in hate_crack.py menu (dual-registration) 2026-05-04 09:10:46 -04:00
Justin Bollinger 085e419604 feat(pcfg): add pcfg_attack and prince_ling_attack handlers in attacks.py 2026-05-04 09:09:39 -04:00
Justin Bollinger a512ff1fdc feat(pcfg): wire menu entries #23 (PCFG) and #24 (PRINCE-LING) in main.py 2026-05-04 09:08:17 -04:00
Justin Bollinger aff0db8540 feat(pcfg): add pcfg and prince_ling dispatchers in main.py 2026-05-04 09:07:07 -04:00
Justin Bollinger 864e67a416 fix(pcfg): catch OSError on cache replace; tighten exception-restore test 2026-05-04 09:06:31 -04:00
Justin Bollinger b2075286c7 feat(pcfg): add hcatPrinceLing attack (mode B — cached wordlist via prince_ling, delegates to hcatPrince)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 09:04:15 -04:00
Justin Bollinger 54d1cfd0ca test(pcfg): tighten hcatPCFG test — patch globals, assert stdin pipe, drop unused 2026-05-04 09:01:57 -04:00
Justin Bollinger ef8af059c5 fix(pcfg): revert generate_session_id signature change, patch in test instead 2026-05-04 08:56:32 -04:00
Justin Bollinger 1963f80e3e feat(pcfg): add hcatPCFG attack (mode A — pcfg_guesser piped to hashcat)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 08:53:12 -04:00
Justin Bollinger fd9732ca57 feat(pcfg): verify pcfg_cracker presence at startup (non-fatal) 2026-05-04 08:48:56 -04:00
Justin Bollinger d673332ccd feat(pcfg): load pcfg config keys with sensible defaults 2026-05-04 08:47:04 -04:00
Justin Bollinger e1ac5eee7d feat(pcfg): add pcfgRuleset, pcfgMaxCandidates, pcfgPrinceLingMaxCandidates config keys 2026-05-04 08:45:09 -04:00
Justin Bollinger 7a768c81b6 feat(pcfg): vendor pcfg_cracker as submodule 2026-05-04 08:43:05 -04:00
Justin Bollinger 1021e84f62 Merge branch 'tui-default-dep' into dev 2026-05-03 14:37:13 -04:00
Justin Bollinger 7d7860d28f build(deps): make simple-term-menu a default dependency
Move simple-term-menu from the [tui] optional extra into the main
dependencies list so arrow-key menu navigation works out of the box.
Users can still opt into the plain numbered menu with
HATE_CRACK_PLAIN_MENU=1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 14:37:08 -04:00
Justin Bollinger 3aa7138c9c fix(docker): fix E2E torrent test and transmission-remote compatibility
- Add transmission-cli package (provides transmission-remote binary)
- Fix SETUPTOOLS_SCM_PRETEND_VERSION placement before RUN make install
- Fix PATH to use /root/.local/bin and include venv bin
- Switch TransmissionSession.add() from watch-dir polling to transmission-remote -a
- Remove --no-auth flag (unrecognized in transmission-remote 4.1.0)
- Add test_docker_torrent_downloads_wordlists E2E test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 22:56:13 -04:00