Commit Graph
428 Commits
Author SHA1 Message Date
Justin BollingerandClaude Opus 4.6 e1d6922edc 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 BollingerandClaude Opus 4.6 b4bfba5fed 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 BollingerandClaude Opus 4.6 c3c4d9da60 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 BollingerandClaude Opus 4.6 f0b512a079 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 BollingerandClaude Opus 4.6 39970b41c4 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 BollingerandClaude Opus 4.6 2446ef3ed1 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 BollingerandGitHub 9a969813cb 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 BollingerandClaude Opus 4.6 b474cd23f6 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 BollingerandClaude Opus 4.6 8423491124 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 BollingerandClaude Opus 4.6 b7d44f7c65 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 BollingerandClaude Opus 4.6 1fa8b61d82 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 BollingerandClaude Opus 4.6 6fb261d76f 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 BollingerandGitHub 939995ce63 Merge pull request #74 from trustedsec/feat/netntlm-computer-filter
feat: NetNTLM computer account filtering
2026-02-17 13:24:02 -05:00
Justin BollingerandClaude Opus 4.6 b34c254a5f 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 BollingerandClaude Opus 4.6 c45acdaaa1 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
Justin BollingerandGitHub 91a7cf5310 Merge pull request #73 from trustedsec/feat/ntlm-preprocessing
Add NTLM computer account filtering and NetNTLM dedup
2026-02-17 13:00:33 -05:00
Justin BollingerandClaude Opus 4.6 89bcc6d74a fix: QA hardening for NTLM preprocessing
- Catch PermissionError/OSError in file operations (not just FileNotFoundError)
- Refactor _dedup_netntlm_by_username to two-pass streaming (memory safe)
- Handle CRLF line endings in filter and dedup functions
- Add KeyboardInterrupt handling with temp file cleanup during preprocessing
- Track .filtered/.dedup temp files for cleanup on interruption
- Add CRLF line ending tests for both filter and dedup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:59:09 -05:00
Justin BollingerandClaude Opus 4.6 31b6a2f6b1 test: add comprehensive pwdump filter pipeline and edge case tests
Add TestWriteFieldSortedUnique (7 tests) and TestPwdumpFilterPipeline
(8 tests) covering the full filter -> extract NT/LM pipeline. Add
edge case tests for unicode, BOM, long lines, permissions, and
delimiter handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:53:20 -05:00
Justin BollingerandClaude Opus 4.6 3550838064 fix: address QA review issues for NTLM preprocessing (#27, #28)
- Add type hints to _filter_computer_accounts and _dedup_netntlm_by_username
- Fix unclosed file handle when reading hash file for format detection
- Extract _count_computer_accounts helper to eliminate duplicate file reads
- Stream _filter_computer_accounts output instead of collecting in memory
- Only write .dedup file when duplicates actually exist
- Add tests for _count_computer_accounts, malformed lines, and no-file-on-zero-dupes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:46:48 -05:00
Justin BollingerandClaude Opus 4.6 ffbc41f3ca feat: add computer account filtering and NetNTLM dedup
- Detect and optionally filter Windows computer accounts (username
  ending with $) from pwdump-format NTLM hash files (type 1000)
- Detect and optionally deduplicate NetNTLMv1/v2 hashes (types
  5500/5600) by username, keeping first occurrence
- Add 10 tests covering both features

Fixes #27
Fixes #28

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:43:22 -05:00
Justin BollingerandClaude Opus 4.6 43adce1f4f fix: remove unnecessary submodule checkout from CI workflows
Tests use HATE_CRACK_SKIP_INIT=1 and don't need submodules.
Shallow submodule clones caused flaky CI failures on PR events.

Fixes #72

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:42:42 -05:00
Justin BollingerandGitHub 3ce39f1b3b Merge pull request #71 from trustedsec/fix/70-hashview-download-path
Fix Hashview wordlist download saving to cwd instead of configured directory
2026-02-17 11:20:21 -05:00
Justin BollingerandClaude Opus 4.6 aaaa185432 docs: update README Ollama defaults to match config
Update ollamaModel from qwen2.5 to mistral and ollamaNumCtx from
8192 to 2048 to reflect recent config changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:13:47 -05:00
Justin BollingerandClaude Opus 4.6 70b21d04a8 fix: resolve Hashview wordlist downloads to configured directory
download_wordlist() now resolves relative filenames against
get_hcat_wordlists_dir() instead of saving to cwd. Also ensures
the parent directory exists before writing.

Fixes #70

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:05:23 -05:00
Justin BollingerandClaude Opus 4.6 aa58cceb8d Add openpyxl to project dependencies
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 13:36:12 -05:00
Justin Bollinger 6ddc072049 update to ollama_benchmark.py 2026-02-14 13:27:23 -05:00
Justin BollingerandClaude Opus 4.6 6fa506fc6a feat: change default Ollama model to mistral and context to 2048
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:06:45 -05:00
Justin BollingerandClaude Opus 4.6 48e8cb3f7d feat: default to mistral model only in benchmark
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:00:21 -05:00
Justin BollingerandClaude Opus 4.6 3b50f9907d feat: update LLM attack prompt to CTF-style framing
Replace the denylist-oriented prompt with a capture-the-flag scenario
prompt that focuses on recovering passwords using industry terms and
company name permutations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:36:45 -05:00
Justin BollingerandClaude Opus 4.6 55b10670e1 feat: add --stdout flag to toggle printing model responses
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:27:05 -05:00
Justin BollingerandClaude Opus 4.6 a8982fcd9e feat: include candidates and response in benchmark JSON output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:25:48 -05:00
Justin BollingerandGitHub bebf008a40 Merge pull request #69 from trustedsec/ollama
Add LLM Attack via Ollama integration
2026-02-13 22:31:09 -05:00
Justin BollingerandClaude Opus 4.6 36b2687de5 fix: add --force --reinstall to uv tool install and add make update target
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:30:38 -05:00
Justin BollingerandClaude Opus 4.6 fda6289fb7 fix: add missing rulesDirectory mock in ollama 404 retry test
The test built its own mock context instead of using the shared
ollama_globals helper, missing the rulesDirectory and hcatPotfilePath
patches. This caused FileNotFoundError on CI where /path/to/hashcat/rules
doesn't exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:25:48 -05:00
Justin BollingerandClaude Opus 4.6 386d08c765 docs: update README for LLM attack, Ollama config, and accuracy fixes
Add LLM Attack (option 15) to menu listing and attack descriptions,
document Ollama config keys, fix broken code block, update pre-push
hook example, add make update target, and correct CI Python versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:20:19 -05:00
Justin BollingerandClaude Opus 4.6 fe467c1d34 fix: resolve CI test failures in ollama and hashview tests
- Mock rulesDirectory in ollama test fixture so hcatOllama doesn't
  fail with FileNotFoundError on CI where /path/to/hashcat/rules
  doesn't exist
- Mock potfile path in hashview auto-merge test so found file cleanup
  isn't blocked by missing ~/.hashcat directory
- Update pre-push hook to match CI env vars (HATE_CRACK_SKIP_INIT=1)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v2.0
2026-02-13 22:15:48 -05:00
Justin BollingerandClaude Opus 4.6 c01601cf67 fix: clean version string to show 2.0+g<hash> format
Strip .postN.devN and .dYYYYMMDD suffixes from setuptools-scm version
in __init__.py so the banner displays a clean version like 2.0+g05b5d6dc7.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:11:31 -05:00
Justin BollingerandClaude Opus 4.6 bfcaed3d5e fix: use no-guess-dev version scheme to keep 2.0 base version
Prevents setuptools-scm from bumping to 2.1 on dirty builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:06:53 -05:00
Justin BollingerandClaude Opus 4.6 243fdd305e fix: update ollama tests to match refactored target-only handler
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:01:33 -05:00
Justin BollingerandClaude Opus 4.6 8d45881c7e feat: auto-derive version from git tags using setuptools-scm
Replace hardcoded version with setuptools-scm so the version updates
automatically from git tags. The ASCII banner strips the dirty date
suffix but preserves the git node hash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:58:17 -05:00
Justin BollingerandClaude Opus 4.6 a5e3b65030 chore: update default Ollama model to qwen2.5 with num_ctx 8192
Benchmarking showed qwen2.5 at 8192 context is the best default for
speed/quality balance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:04:43 -05:00
Justin BollingerandClaude Opus 4.6 762dede867 feat: add Ollama model benchmark script with context window tuning
Standalone tool to compare multiple Ollama models for password candidate
generation. Tests each model at multiple num_ctx values (default: 2048,
8192, 32768) to find the speed/quality sweet spot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:01:19 -05:00
Justin BollingerandClaude Opus 4.6 6fdc485a6d refactor: simplify Ollama attack to target-based generation only
Remove wordlist-based generation option and menu selection. The LLM
attack now goes directly to target-based prompts (company, industry,
location).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 20:28:26 -05:00
Justin BollingerandClaude Opus 4.6 f3daff4bdf refactor: use cracked .out file as sole wordlist source for Ollama attack
Remove ollamaWordlist config key and all references. Wordlist mode now
requires the cracked hashes .out file to exist and extracts passwords
by splitting on the first colon. Detect Ollama refusal responses and
abort gracefully. Update tests accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 20:04:11 -05:00
Justin BollingerandClaude Opus 4.6 a967ba60cd feat: send full wordlist to Ollama with configurable num_ctx
Remove 500-line wordlist cap and send the entire file to Ollama.
Add ollamaNumCtx config key (default 32768) to control the context
window size. Invert wordlist prompt to default-yes, remove unused
ollamaCandidateCount config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:33:23 -05:00
Justin BollingerandClaude Opus 4.6 31c1dbbe35 refactor: rename Markov LLM attack to Ollama attack and simplify interface
Rename markov_attack → ollama_attack and hcatMarkov → hcatOllama across
menu, attacks, and tests. Remove candidate count prompts and cracked-output
default wordlist logic. Rename config keys (markov* → ollama*) and drop
ollamaUrl. Fix Dockerfile.test to use granular build steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:17:50 -05:00
Justin BollingerandClaude Opus 4.6 f9db54e84c fix: overhaul Hashview download flow and fix hashcat --show stderr pollution
- Merge download_left and download_found into single "Download Hashes" menu option
- Append found hash:clear pairs to potfile instead of running broken hashcat re-crack
- Append found hashes to left file so hashcat --show returns full results
- Clean up found_ temp files after merge
- Split found file on first colon (not last) to handle passwords containing colons
- Filter hashcat parse errors from --show stdout in _run_hashcat_show
- Add get_hcat_potfile_path() helper to api.py for potfile resolution
- Remove obsolete download_found_hashes API method and CLI subcommand
- Fix ollama tests to match current 4-arg hcatOllama signature and rule loop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:11:51 -05:00
Justin BollingerandClaude Opus 4.6 ca1d71da6c feat: add --debug logging for Ollama request/response in hcatMarkov
Log the API URL, request payload, raw response JSON, and filtered
candidate counts when debug_mode is active.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:52:00 -05:00
Justin BollingerandClaude Opus 4.6 1af4c74065 feat: default Markov LLM wordlist to cracked hashes output
When the cracked hashes output file (.out) exists, use it as the default
wordlist for the LLM Markov attack instead of the generic markovWordlist
config. This makes the attack learn from already-cracked passwords for
the current engagement, falling back to config when no cracked output
exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:01:44 -05:00
Justin BollingerandClaude Opus 4.6 e205e6e886 feat: add LLM Markov Attack (menu option 15)
Add a new attack mode that uses a local LLM via Ollama to generate
password candidates, converts them into hashcat .hcstat2 Markov
statistics via hcstat2gen, and runs a Markov-enhanced mask attack.

Two generation sub-modes:
- Wordlist-based: feeds sample from an existing wordlist to the LLM
  as pattern context (config-selectable default with Y/N override)
- Target-based: prompts for company name, industry, and location
  for contextual password generation

Pipeline: Ollama API -> candidate file -> hcstat2gen -> LZMA compress
-> hashcat -a 3 --markov-hcstat2

Config additions: ollamaUrl, ollamaModel, markovCandidateCount,
markovWordlist. No new pip dependencies (uses stdlib urllib/lzma).

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