mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-04-28 12:03:11 -07:00
- Add _omen_model_is_valid() checking all 5 required model files - Add _omen_model_info() reading model_info.json metadata - hcatOmenTrain returns bool and writes training metadata - Capture enumNG stderr and report errors instead of silent failure - Rewrite omen_attack with train/use/cancel menu and wordlist picker
1.9 KiB
1.9 KiB
OMEN Training Fix + Wordlist Picker
Problem
OMEN attack (menu option 16) fails silently - hashcat exits immediately without candidates. Root causes:
- Model validation only checks
createConfigexists, not the 4.levelfiles - No way to retrain once a model exists (training permanently skipped)
enumNGstderr/exit code not captured - failures are invisible- Training uses raw path input instead of the wordlist picker menu
Design
Bug fixes (main.py)
Model validation - Add _omen_model_is_valid(model_dir) that checks all 5 required files exist and are non-empty: createConfig, CP.level, IP.level, EP.level, LN.level.
enumNG error handling - Capture stderr from enumNG subprocess. If it exits non-zero or stderr has content, print the error and return early instead of letting hashcat sit on empty stdin.
Training return value - hcatOmenTrain returns bool (True on success) so callers can abort if training fails.
Model metadata - Write model_info.json alongside model files with {"training_file": "...", "trained_at": "..."}. Add _omen_model_info(model_dir) to read it.
Menu flow (attacks.py: omen_attack)
- Check OMEN binaries exist (unchanged)
- Call
_omen_model_is_valid()to check model - If valid, show status and prompt: Use existing / Train new / Cancel
- If invalid/missing, go straight to training
- Training wordlist picker: numbered list from
list_wordlist_files()+ custom path option - If training returns False, abort
- Prompt for max candidates, run
hcatOmen
Files modified
hate_crack/main.py-_omen_model_is_valid,_omen_model_info,hcatOmenTrainreturn bool + write metadata,hcatOmencapture enumNG stderrhate_crack/attacks.py- Rewriteomen_attack()with train/use/cancel + wordlist pickertests/test_main_utils.py- Model validation, training return value, enumNG error teststests/test_attacks_behavior.py- omen_attack menu flow tests