Commit Graph

21 Commits

Author SHA1 Message Date
Justin Bollinger
2f73289737 fix: remove symlink/copy from _ensure_hashfile_in_cwd
Output files now land next to the original hashfile. resolve_path()
already resolves relative paths against HATE_CRACK_ORIG_CWD, so
relocating the hashfile into CWD was unnecessary and created
confusing symlinks in the working directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 13:02:26 -04:00
Justin Bollinger
e7a4f3d441 fix: write output files to user's CWD, not install directory
The bash shim uses `uv run --directory <install_dir>` which changes the
process CWD to the install directory. _ensure_hashfile_in_cwd() and the
Hashview download path used os.getcwd() to determine the target directory
for output files (.out, .nt, etc.), causing them to land in the install
directory instead of where the user ran the command.

Add orig_cwd() helper that reads HATE_CRACK_ORIG_CWD (set by the shim)
and use it in _ensure_hashfile_in_cwd(), the Hashview download path, and
the potfile fallback path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 11:43:51 -04:00
Justin Bollinger
a014af5871 fix: correct download_left_hashes potfile merge bugs
- Delete block that wrongly appended found hashes back into the left
  (unsolved) file - found hashes belong only in the potfile
- Fix get_hcat_potfile_path() to return "" when config key is
  explicitly set to "", respecting user intent to disable potfile override
- Fix get_hcat_potfile_path() to resolve relative paths relative to the
  config file directory, matching main.py's hate_path resolution
- Add potfile_path parameter to download_left_hashes() and
  download_hashes_from_hashview() so CLI --potfile-path and
  --no-potfile-path overrides propagate to the API merge step
- Update main.py call sites to pass hcatPotfilePath through
- Add tests covering all four bug fixes
2026-03-19 19:13:41 -04:00
Justin Bollinger
7a56c7f506 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 Bollinger
abe8f2ae73 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>
2026-02-13 22:15:48 -05:00
Justin Bollinger
2cb54beecb 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 Bollinger
efc25c335a Apply ruff formatting fixes
- Fix line length and formatting in hate_crack/api.py
- Fix line wrapping and f-string formatting in hate_crack/attacks.py
- Apply code style improvements in hate_crack/main.py
- Format test files for consistency
- All changes applied via 'ruff check --fix'
2026-02-09 20:08:51 -05:00
Justin Bollinger
210a4006f5 removed extended expander 2026-02-06 19:37:39 -05:00
Justin Bollinger
59cbad7890 working loopback mode with tests 2026-02-06 15:06:25 -05:00
Justin Bollinger
742529962a test: improve live test to skip gracefully when server unavailable
- Add server reachability check before attempting connection
- Test skips if Hashview server is not available on localhost:5000
- Prevents test failures when HASHVIEW_TEST_REAL env var is set but server isn't running
- Allows test to succeed when Docker/server is available and configured
2026-02-06 09:43:23 -05:00
Justin Bollinger
b52d856d7b download wordlists testing 2026-02-05 17:36:46 -05:00
Justin Bollinger
b16c3a1d26 fixed wordlist download and unit testing for live api 2026-02-05 16:32:17 -05:00
Justin Bollinger
092b63f82c automatic hash_id detection via api for hashview hashes 2026-02-05 14:56:27 -05:00
Justin Bollinger
0c0690e2ef lots of refactoring around the menues and building out test cases 2026-02-05 13:52:06 -05:00
Justin Bollinger
c049065924 Update hashview API flow and tests 2026-02-04 15:48:19 -05:00
Justin Bollinger
f33ca19107 expanded tests and hashview menu changes 2026-02-03 19:28:45 -05:00
Justin Bollinger
c45b30e9bb updated tests 2026-01-27 20:04:45 -05:00
Justin Bollinger
19c6651868 updated pytests for hashview 2026-01-27 13:24:38 -05:00
Justin Bollinger
092d72f0cd updated pytests for hashview 2026-01-27 13:22:55 -05:00
Justin Bollinger
5c9ed38f75 cleanup of modules 2026-01-26 14:29:39 -05:00
Justin Bollinger
01f4e55e85 major refactor and version change to 2.0 2026-01-26 13:32:37 -05:00