From 9d7ca3b3956d9d695b04bda4654019b9eaeb782c Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:26:26 +0200 Subject: [PATCH 01/13] Move CHANGES and LICENSE into docs/changes.txt and docs/license.txt --- CHANGES => docs/changes.txt | 0 LICENSE => docs/license.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename CHANGES => docs/changes.txt (100%) rename LICENSE => docs/license.txt (100%) diff --git a/CHANGES b/docs/changes.txt similarity index 100% rename from CHANGES rename to docs/changes.txt diff --git a/LICENSE b/docs/license.txt similarity index 100% rename from LICENSE rename to docs/license.txt From 891e510d283956ce2eaf2de940385a33b5441bbb Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:27:33 +0200 Subject: [PATCH 02/13] Updated combinatorX: using LEN_MAX from Makefile instead of hardcoded MAX_LEN --- src/combinatorX.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/combinatorX.c b/src/combinatorX.c index 98c4e36..4c01bd0 100644 --- a/src/combinatorX.c +++ b/src/combinatorX.c @@ -26,11 +26,10 @@ #include #include -#define PROG_VERSION "1.2" +#define PROG_VERSION "1.3" #define PROG_RELEASE_DATE "Wed Aug 25 19:42:17 CEST 2021" -#define MAX_LEN 64 -#define SEGMENT_SIZE (MAX_LEN * 1024 * 1024) +#define SEGMENT_SIZE (LEN_MAX * 1024 * 1024) #define SEGMENT_ALIGN (8 * 1024) // lightweight dolphin macro @@ -1267,7 +1266,7 @@ int main (int argc, char *argv[]) vir_in[0]--; } - if (vir_in[0] > MAX_LEN) continue; + if (vir_in[0] > LEN_MAX) continue; if (maxLen_isSet && vir_in[0] > main_ctx.maxLen) continue; // restore 1 if needed @@ -1296,7 +1295,7 @@ int main (int argc, char *argv[]) vir_in[1]--; } - if (vir_in[1] > MAX_LEN) continue; + if (vir_in[1] > LEN_MAX) continue; if (maxLen_isSet && (vir_in[0]+vir_in[1]) > main_ctx.maxLen) continue; // restore 2 if needed @@ -1336,7 +1335,7 @@ int main (int argc, char *argv[]) vir_in[2]--; } - if (vir_in[2] > MAX_LEN) continue; + if (vir_in[2] > LEN_MAX) continue; if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]) > main_ctx.maxLen) continue; // restore 3 if needed @@ -1377,7 +1376,7 @@ int main (int argc, char *argv[]) vir_in[3]--; } - if (vir_in[3] > MAX_LEN) continue; + if (vir_in[3] > LEN_MAX) continue; if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]) > main_ctx.maxLen) continue; // restore 4 if needed @@ -1419,7 +1418,7 @@ int main (int argc, char *argv[]) vir_in[4]--; } - if (vir_in[4] > MAX_LEN) continue; + if (vir_in[4] > LEN_MAX) continue; if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]) > main_ctx.maxLen) continue; // restore 5 if needed @@ -1462,7 +1461,7 @@ int main (int argc, char *argv[]) vir_in[5]--; } - if (vir_in[5] > MAX_LEN) continue; + if (vir_in[5] > LEN_MAX) continue; if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]+vir_in[5]) > main_ctx.maxLen) continue; // restore 6 if needed @@ -1506,7 +1505,7 @@ int main (int argc, char *argv[]) vir_in[6]--; } - if (vir_in[6] > MAX_LEN) continue; + if (vir_in[6] > LEN_MAX) continue; if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]+vir_in[5]+vir_in[6]) > main_ctx.maxLen) continue; // restore 7 if needed @@ -1551,7 +1550,7 @@ int main (int argc, char *argv[]) vir_in[7]--; } - if (vir_in[7] > MAX_LEN) continue; + if (vir_in[7] > LEN_MAX) continue; if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]+vir_in[5]+vir_in[6]+vir_in[7]) > main_ctx.maxLen) continue; // restore 8 if needed From d183dd52dadf36ed13264b2ebd6dd50caa81e2d3 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:28:18 +0200 Subject: [PATCH 03/13] Updated Makefile --- src/Makefile | 87 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index d816dd4..78bf322 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,58 @@ ## DEBUG := 0 -CFLAGS += -Wall -W -pipe -std=gnu99 +MAINTAINER_MODE ?= 0 + +BUILD_MODE := native + +ifneq ($(filter windows release,$(MAKECMDGOALS)),) + BUILD_MODE := cross +endif + +## +## Detect Operating System +## + +UNAME := $(shell uname -s) + +# we need to strip the windows version number to be able to build hashcat on cygwin hosts +UNAME := $(patsubst CYGWIN_NT-%,CYGWIN,$(UNAME)) + +# same for msys +UNAME := $(patsubst MSYS_NT-%,MSYS2,$(UNAME)) +UNAME := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME)) +UNAME := $(patsubst MINGW64_NT-%,MSYS2,$(UNAME)) + +ifneq ($(BUILD_MODE),native) +ifeq ($(UNAME),Darwin) +BREW_MINGW_PREFIX := $(shell brew --prefix mingw-w64) +endif +endif + +ifneq ($(DEBUG),0) +$(info "## Detected Operating System : $(UNAME)") +$(info "## Detected Build Mode: $(BUILD_MODE)") +$(info "## Detected CC : $(CC)") +ifneq ($(BUILD_MODE),native) +$(info "## Detected CC_WINDOWS : $(CC_WINDOWS)") +ifeq ($(UNAME),Darwin) +$(info "## Detected Brew MinGW Prefix: $(BREW_MINGW_PREFIX)") +endif +endif +endif + +## +## General compiler and linker options +## + +CFLAGS += -W -Wall -Wextra -pipe -std=gnu99 + +ifeq ($(MAINTAINER_MODE),0) +ifeq ($(BUILD_MODE),native) +CFLAGS += -march=native +endif +endif + COMBINATOR_LEN_MAX := 512 ifeq ($(DEBUG),0) @@ -48,11 +99,11 @@ clean: ## native ## -CC ?= gcc -CC_NATIVE = $(CC) -STRIP_NATIVE = strip -CFLAGS_NATIVE = $(CFLAGS) -LDFLAGS_NATIVE = $(LDFLAGS) +CC ?= gcc +CC_NATIVE := $(CC) +STRIP_NATIVE := strip +CFLAGS_NATIVE := $(CFLAGS) +LDFLAGS_NATIVE := $(LDFLAGS) native: cap2hccapx.bin cleanup-rules.bin combinator.bin combinator3.bin combinatorX.bin combipow.bin ct3_to_ntlm.bin cutb.bin expander.bin gate.bin generate-rules.bin hcstatgen.bin hcstat2gen.bin keyspace.bin len.bin mli2.bin morph.bin ngramX.bin permute.bin permute_exist.bin prepare.bin req-include.bin req-exclude.bin rli.bin rli2.bin rules_optimize.bin splitlen.bin strip-bsr.bin strip-bsn.bin @@ -147,10 +198,24 @@ strip-bsn.bin: strip-bsn.c ## WINDOWS ## -CC_WINDOWS = x86_64-w64-mingw32-gcc -STRIP_WINDOWS = x86_64-w64-mingw32-strip -CFLAGS_WINDOWS = $(CFLAGS) -D_WINDOWS -GLOB_WINDOWS = /usr/x86_64-w64-mingw32/lib/CRT_glob.o +CC_WINDOWS ?= x86_64-w64-mingw32-gcc +STRIP_WINDOWS ?= x86_64-w64-mingw32-strip + +ifeq (,$(findstring clang, $(CC_WINDOWS))) +CFLAGS_WINDOWS := $(CFLAGS) -D_WINDOWS +else +CFLAGS_WINDOWS := --target=x86_64-w64-mingw32 +ifeq ($(UNAME),Darwin) +CFLAGS_WINDOWS += --sysroot=$(BREW_MINGW_PREFIX)/toolchain-x86_64 +endif +CFLAGS_WINDOWS += $(CFLAGS) -D_WINDOWS +endif + +ifeq ($(UNAME),Darwin) +GLOB_WINDOWS := $(BREW_MINGW_PREFIX)/toolchain-x86_64/x86_64-w64-mingw32/lib/CRT_glob.o +else +GLOB_WINDOWS := /usr/x86_64-w64-mingw32/lib/CRT_glob.o +endif windows: cap2hccapx.exe cleanup-rules.exe combinator.exe combinator3.exe combinatorX.exe combipow.exe ct3_to_ntlm.exe cutb.exe expander.exe gate.exe generate-rules.exe hcstatgen.exe hcstat2gen.exe keyspace.exe len.exe mli2.exe morph.exe ngramX.exe permute.exe permute_exist.exe prepare.exe req-include.exe req-exclude.exe rli.exe rli2.exe rules_optimize.exe splitlen.exe strip-bsr.exe strip-bsn.exe @@ -224,7 +289,7 @@ req-exclude.exe: req-exclude.c ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< rli.exe: rli.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ rli.c ${GLOB_WINDOWS} + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< ${GLOB_WINDOWS} rli2.exe: rli2.c ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< From 524a127ee452200815c6d2a40792914610f05c8d Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:40:26 +0200 Subject: [PATCH 04/13] Rename bin/.hold in bin/.gitkeep --- bin/{.hold => .gitkeep} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bin/{.hold => .gitkeep} (100%) diff --git a/bin/.hold b/bin/.gitkeep similarity index 100% rename from bin/.hold rename to bin/.gitkeep From 2679ae62725ada422cf6c07e2a756e106c9af855 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:52:44 +0200 Subject: [PATCH 05/13] Updated Makefile --- Makefile | 1 + src/Makefile | 244 +++++++++++++++++++++++++-------------------------- 2 files changed, 121 insertions(+), 124 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..50f8e16 --- /dev/null +++ b/Makefile @@ -0,0 +1 @@ +include src/Makefile diff --git a/src/Makefile b/src/Makefile index 78bf322..975dd0f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -84,16 +84,12 @@ endif all: clean native release: native windows - $(STRIP_NATIVE) *.bin - $(STRIP_WINDOWS) *.exe - mv *.bin ../bin - mv *.exe ../bin - cp -a *.pl ../bin + $(STRIP_NATIVE) bin/*.bin + $(STRIP_WINDOWS) bin/*.exe + cp -a src/*.pl bin clean: - rm -f ../bin/* - rm -f *.bin *.exe - rm -rf *.dSYM + rm -f bin/* ## ## native @@ -107,92 +103,92 @@ LDFLAGS_NATIVE := $(LDFLAGS) native: cap2hccapx.bin cleanup-rules.bin combinator.bin combinator3.bin combinatorX.bin combipow.bin ct3_to_ntlm.bin cutb.bin expander.bin gate.bin generate-rules.bin hcstatgen.bin hcstat2gen.bin keyspace.bin len.bin mli2.bin morph.bin ngramX.bin permute.bin permute_exist.bin prepare.bin req-include.bin req-exclude.bin rli.bin rli2.bin rules_optimize.bin splitlen.bin strip-bsr.bin strip-bsn.bin -cap2hccapx.bin: cap2hccapx.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +cap2hccapx.bin: src/cap2hccapx.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -cleanup-rules.bin: cleanup-rules.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +cleanup-rules.bin: src/cleanup-rules.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -combinator.bin: combinator.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) +combinator.bin: src/combinator.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) -combinator3.bin: combinator3.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) +combinator3.bin: src/combinator3.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) -combinatorX.bin: combinatorX.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) +combinatorX.bin: src/combinatorX.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) -combipow.bin: combipow.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +combipow.bin: src/combipow.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -ct3_to_ntlm.bin: ct3_to_ntlm.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +ct3_to_ntlm.bin: src/ct3_to_ntlm.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -cutb.bin: cutb.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +cutb.bin: src/cutb.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -expander.bin: expander.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +expander.bin: src/expander.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -gate.bin: gate.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +gate.bin: src/gate.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -generate-rules.bin: generate-rules.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +generate-rules.bin: src/generate-rules.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -hcstatgen.bin: hcstatgen.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +hcstatgen.bin: src/hcstatgen.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -hcstat2gen.bin: hcstat2gen.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +hcstat2gen.bin: src/hcstat2gen.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -keyspace.bin: keyspace.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +keyspace.bin: src/keyspace.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -len.bin: len.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +len.bin: src/len.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -mli2.bin: mli2.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +mli2.bin: src/mli2.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -morph.bin: morph.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +morph.bin: src/morph.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -ngramX.bin: ngramX.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +ngramX.bin: src/ngramX.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -permute.bin: permute.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +permute.bin: src/permute.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -permute_exist.bin: permute_exist.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +permute_exist.bin: src/permute_exist.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -prepare.bin: prepare.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +prepare.bin: src/prepare.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -req-include.bin: req-include.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +req-include.bin: src/req-include.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -req-exclude.bin: req-exclude.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +req-exclude.bin: src/req-exclude.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -rli.bin: rli.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +rli.bin: src/rli.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -rli2.bin: rli2.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +rli2.bin: src/rli2.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -rules_optimize.bin: rules_optimize.c cpu_rules.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ rules_optimize.c cpu_rules.c +rules_optimize.bin: src/rules_optimize.c src/cpu_rules.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ src/rules_optimize.c src/cpu_rules.c -splitlen.bin: splitlen.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +splitlen.bin: src/splitlen.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -strip-bsr.bin: strip-bsr.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +strip-bsr.bin: src/strip-bsr.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< -strip-bsn.bin: strip-bsn.c - ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o $@ $< +strip-bsn.bin: src/strip-bsn.c + ${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o bin/$@ $< ## ## WINDOWS @@ -219,89 +215,89 @@ endif windows: cap2hccapx.exe cleanup-rules.exe combinator.exe combinator3.exe combinatorX.exe combipow.exe ct3_to_ntlm.exe cutb.exe expander.exe gate.exe generate-rules.exe hcstatgen.exe hcstat2gen.exe keyspace.exe len.exe mli2.exe morph.exe ngramX.exe permute.exe permute_exist.exe prepare.exe req-include.exe req-exclude.exe rli.exe rli2.exe rules_optimize.exe splitlen.exe strip-bsr.exe strip-bsn.exe -cap2hccapx.exe: cap2hccapx.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +cap2hccapx.exe: src/cap2hccapx.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -cleanup-rules.exe: cleanup-rules.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +cleanup-rules.exe: src/cleanup-rules.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -combinator.exe: combinator.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) +combinator.exe: src/combinator.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) -combinator3.exe: combinator3.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) +combinator3.exe: src/combinator3.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) -combinatorX.exe: combinatorX.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) +combinatorX.exe: src/combinatorX.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -DLEN_MAX=$(COMBINATOR_LEN_MAX) -combipow.exe: combipow.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +combipow.exe: src/combipow.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -ct3_to_ntlm.exe: ct3_to_ntlm.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +ct3_to_ntlm.exe: src/ct3_to_ntlm.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -cutb.exe: cutb.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +cutb.exe: src/cutb.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -expander.exe: expander.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +expander.exe: src/expander.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -gate.exe: gate.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +gate.exe: src/gate.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -generate-rules.exe: generate-rules.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +generate-rules.exe: src/generate-rules.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -hcstatgen.exe: hcstatgen.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +hcstatgen.exe: src/hcstatgen.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -hcstat2gen.exe: hcstat2gen.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +hcstat2gen.exe: src/hcstat2gen.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -keyspace.exe: keyspace.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +keyspace.exe: src/keyspace.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -len.exe: len.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +len.exe: src/len.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -mli2.exe: mli2.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +mli2.exe: src/mli2.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -morph.exe: morph.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +morph.exe: src/morph.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -ngramX.exe: ngramX.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +ngramX.exe: src/ngramX.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -permute.exe: permute.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +permute.exe: src/permute.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -permute_exist.exe: permute_exist.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +permute_exist.exe: src/permute_exist.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -prepare.exe: prepare.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +prepare.exe: src/prepare.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -req-include.exe: req-include.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +req-include.exe: src/req-include.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -req-exclude.exe: req-exclude.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +req-exclude.exe: src/req-exclude.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -rli.exe: rli.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< ${GLOB_WINDOWS} +rli.exe: src/rli.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< ${GLOB_WINDOWS} -rli2.exe: rli2.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +rli2.exe: src/rli2.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -rules_optimize.exe: rules_optimize.c cpu_rules.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ rules_optimize.c cpu_rules.c +rules_optimize.exe: src/rules_optimize.c src/cpu_rules.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ src/rules_optimize.c src/cpu_rules.c -splitlen.exe: splitlen.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +splitlen.exe: src/splitlen.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -strip-bsr.exe: strip-bsr.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +strip-bsr.exe: src/strip-bsr.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< -strip-bsn.exe: strip-bsn.c - ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o $@ $< +strip-bsn.exe: src/strip-bsn.c + ${CC_WINDOWS} ${CFLAGS_WINDOWS} -o bin/$@ $< From 889ffc5b468329d7dc4b3d4dd938c131482fdb44 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:53:16 +0200 Subject: [PATCH 06/13] Updated README.md --- README.md | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5b61247..5fa300c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -hashcat-utils -============== +## *hashcat-utils* ## -Hashcat-utils are a set of small utilities that are useful in advanced password cracking +**hashcat-utils** are a set of small utilities that are useful in advanced password cracking -Brief description --------------- +### License ### + +**hashcat-utils** is licensed under the MIT license. Refer to [docs/license.txt](docs/license.txt) for more information. + +### Brief description ### They all are packed into multiple stand-alone binaries. @@ -12,17 +14,40 @@ All of these utils are designed to execute only one specific function. Since they all work with STDIN and STDOUT you can group them into chains. -Detailed description --------------- +### Detailed description ### See the hashcat wiki page of hashcat-utils: https://hashcat.net/wiki/doku.php?id=hashcat_utils -Compile --------------- +### Building ### + +#### Native binaries only + +Using gcc + +```bash +$ make clean && make +``` + +Alternatively, using clang + +```bash +$ make clean && make CC=clang +``` + +#### Windows binaries only + +Using mingw + +```bash +$ make clean && make windows +``` + +Alternatively, using clang -Simply run make +```bash +$ make clean && make windows CC_WINDOWS=clang +``` -Binary distribution --------------- +### Binary distribution ### -Binaries for Linux, Windows and OSX: https://github.com/hashcat/hashcat-utils/releases +Binaries for Linux and Windows: https://github.com/hashcat/hashcat-utils/releases From 4569ed07a51c5d400486178c0beb05a7f65ef779 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:53:39 +0200 Subject: [PATCH 07/13] Updated changes.txt --- docs/changes.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 65c268f..30fff32 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,3 +1,11 @@ +* v1.10 -> v1.1x + +- Fixed ct3 and pt3 calculation in ntlmv1.py +- Moved CHANGES and LICENSE into docs/changes.txt and docs/license.txt +- Updated combinatorX: using LEN_MAX from Makefile instead of hardcoded MAX_LEN +- Updated Makefile +- Updated README.md + * v1.9 -> v1.10 - Added ngramX From 3823ce7b9b33fcf08813dc280d6eec12d0ea52f8 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 21:58:55 +0200 Subject: [PATCH 08/13] trying to updated build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aeb721f..57c1c14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v5 - name: Build - run: cd src/ && make + run: make - name: Generate artifacts uses: actions/upload-artifact@v4 with: @@ -42,7 +42,7 @@ jobs: steps: - uses: actions/checkout@v5 - name: Build - run: cd src/ && make + run: make - name: Generate artifacts uses: actions/upload-artifact@v4 with: @@ -71,7 +71,7 @@ jobs: run: mkdir -p D:/a/_temp/msys64/usr/x86_64-w64-mingw32/lib && cp D:/a/_temp/msys64/mingw64/lib/CRT_glob.o D:/a/_temp/msys64/usr/x86_64-w64-mingw32/lib/CRT_glob.o - name: Build shell: msys2 {0} - run: cd src/ && make windows + run: make windows - name: Generate artifacts uses: actions/upload-artifact@v4 with: From eba69e5477ae2364c4dbba1939abe6b1c24ec98e Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 22:01:21 +0200 Subject: [PATCH 09/13] Updated changes.txt --- docs/changes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changes.txt b/docs/changes.txt index 30fff32..aecdaab 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -2,6 +2,7 @@ - Fixed ct3 and pt3 calculation in ntlmv1.py - Moved CHANGES and LICENSE into docs/changes.txt and docs/license.txt +- Updated build.yml - Updated combinatorX: using LEN_MAX from Makefile instead of hardcoded MAX_LEN - Updated Makefile - Updated README.md From e944dd81d235d1ac276ebdc836d6ba2b542a80da Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 22:13:32 +0200 Subject: [PATCH 10/13] Added missing *.py to bin folder --- docs/changes.txt | 1 + src/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index aecdaab..ecc7cb2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,5 +1,6 @@ * v1.10 -> v1.1x +- Added missing *.py to bin folder - Fixed ct3 and pt3 calculation in ntlmv1.py - Moved CHANGES and LICENSE into docs/changes.txt and docs/license.txt - Updated build.yml diff --git a/src/Makefile b/src/Makefile index 975dd0f..ca959ae 100644 --- a/src/Makefile +++ b/src/Makefile @@ -87,6 +87,7 @@ release: native windows $(STRIP_NATIVE) bin/*.bin $(STRIP_WINDOWS) bin/*.exe cp -a src/*.pl bin + cp -a src/*.py bin clean: rm -f bin/* From 214f6f2a0d270823c5f29e54fd9cf02f3a0cbcf9 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 22:15:43 +0200 Subject: [PATCH 11/13] Updated build.yml: added missing *.pl --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57c1c14..cec397c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,7 @@ jobs: path: | src/*.bin src/*.py + src/*.pl build-macos: strategy: @@ -50,6 +51,7 @@ jobs: path: | src/*.bin src/*.py + src/*.pl build-windows: strategy: @@ -79,3 +81,4 @@ jobs: path: | src/*.exe src/*.py + src/*.pl From a9c05608d3b08973400cb7dee7da628ae4024f70 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 22:20:56 +0200 Subject: [PATCH 12/13] fix build.yml, binaries are not included into artifacts --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cec397c..833cd46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: with: name: hashcat-utils-linux path: | - src/*.bin + bin/*.bin src/*.py src/*.pl @@ -49,7 +49,7 @@ jobs: with: name: hashcat-utils-macos path: | - src/*.bin + bin/*.bin src/*.py src/*.pl @@ -79,6 +79,6 @@ jobs: with: name: hashcat-utils-windows path: | - src/*.exe + bin/*.exe src/*.py src/*.pl From b14d4fe33fe8e8fa58c1e3fe8ae2f41801a568ed Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 20 Sep 2025 22:30:48 +0200 Subject: [PATCH 13/13] add only bin folder inside the artifacts --- .github/workflows/build.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 833cd46..054646f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,14 +26,18 @@ jobs: - uses: actions/checkout@v5 - name: Build run: make + - name: Collect scripts into bin + run: | + cp src/*.py bin/ + cp src/*.pl bin/ - name: Generate artifacts uses: actions/upload-artifact@v4 with: name: hashcat-utils-linux path: | bin/*.bin - src/*.py - src/*.pl + bin/*.py + bin/*.pl build-macos: strategy: @@ -44,14 +48,18 @@ jobs: - uses: actions/checkout@v5 - name: Build run: make + - name: Collect scripts into bin + run: | + cp src/*.py bin/ + cp src/*.pl bin/ - name: Generate artifacts uses: actions/upload-artifact@v4 with: name: hashcat-utils-macos path: | bin/*.bin - src/*.py - src/*.pl + bin/*.py + bin/*.pl build-windows: strategy: @@ -74,11 +82,15 @@ jobs: - name: Build shell: msys2 {0} run: make windows + - name: Collect scripts into bin + run: | + cp src/*.py bin/ + cp src/*.pl bin/ - name: Generate artifacts uses: actions/upload-artifact@v4 with: name: hashcat-utils-windows path: | bin/*.exe - src/*.py - src/*.pl + bin/*.py + bin/*.pl