mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-03-12 21:23:05 -07:00
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>
This commit is contained in:
9
Makefile
9
Makefile
@@ -24,6 +24,7 @@ submodules-pre:
|
||||
@# Ensure required directories exist (whether as submodules or vendored copies).
|
||||
@test -d hashcat-utils || { echo "Error: missing required directory: hashcat-utils"; exit 1; }
|
||||
@test -d princeprocessor || { echo "Error: missing required directory: princeprocessor"; exit 1; }
|
||||
@test -d omen || { echo "Warning: missing directory: omen (OMEN attacks will not be available)"; }
|
||||
@# Keep per-length expander sources in sync (expander8.c..expander24.c).
|
||||
@# Patch hashcat-utils/src/Makefile so these new expanders are compiled by default.
|
||||
@bases="hashcat-utils hate_crack/hashcat-utils"; for base in $$bases; do src="$$base/src/expander.c"; test -f "$$src" || continue; for i in $$(seq 8 36); do dst="$$base/src/expander$$i.c"; if [ ! -f "$$dst" ]; then cp "$$src" "$$dst"; perl -pi -e "s/#define LEN_MAX 7/#define LEN_MAX $$i/g" "$$dst"; fi; done; mk="$$base/src/Makefile"; test -f "$$mk" || continue; exp_bins=""; exp_exes=""; for i in $$(seq 8 36); do exp_bins="$$exp_bins expander$$i.bin"; exp_exes="$$exp_exes expander$$i.exe"; done; EXP_BINS="$$exp_bins" perl -pi -e 'if(/^native:/ && index($$_, "expander8.bin") < 0){chomp; $$_ .= "$$ENV{EXP_BINS}"; $$_ .= "\n";}' "$$mk"; EXP_EXES="$$exp_exes" perl -pi -e 'if(/^windows:/ && index($$_, "expander8.exe") < 0){chomp; $$_ .= "$$ENV{EXP_EXES}"; $$_ .= "\n";}' "$$mk"; perl -0777 -pi -e 's/\n# Auto-added by hate_crack \\(submodules-pre\\)\n.*\z/\n/s' "$$mk"; printf '%s\n' '' '# Auto-added by hate_crack (submodules-pre)' 'expander%.bin: src/expander%.c' >> "$$mk"; printf '\t%s\n' '$${CC_NATIVE} $${CFLAGS_NATIVE} $${LDFLAGS_NATIVE} -o bin/$$@ $$<' >> "$$mk"; printf '%s\n' '' 'expander%.exe: src/expander%.c' >> "$$mk"; printf '\t%s\n' '$${CC_WINDOWS} $${CFLAGS_WINDOWS} -o bin/$$@ $$<' >> "$$mk"; done
|
||||
@@ -34,14 +35,18 @@ vendor-assets:
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "Syncing assets into package for uv tool install..."
|
||||
@rm -rf hate_crack/hashcat-utils hate_crack/princeprocessor
|
||||
@rm -rf hate_crack/hashcat-utils hate_crack/princeprocessor hate_crack/omen
|
||||
@cp -R hashcat-utils hate_crack/
|
||||
@cp -R princeprocessor hate_crack/
|
||||
@if [ -d omen ]; then \
|
||||
cp -R omen hate_crack/; \
|
||||
rm -rf hate_crack/omen/.git; \
|
||||
fi
|
||||
@rm -rf hate_crack/hashcat-utils/.git hate_crack/princeprocessor/.git
|
||||
|
||||
clean-vendor:
|
||||
@echo "Cleaning up vendored assets from working tree..."
|
||||
@rm -rf hate_crack/hashcat-utils hate_crack/princeprocessor
|
||||
@rm -rf hate_crack/hashcat-utils hate_crack/princeprocessor hate_crack/omen
|
||||
|
||||
install: submodules vendor-assets
|
||||
@echo "Detecting OS and installing dependencies..."
|
||||
|
||||
Reference in New Issue
Block a user