diff --git a/.gitmodules b/.gitmodules index 21042be..68ef19c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,10 +10,6 @@ path = omen url = https://github.com/RUB-SysSec/OMEN.git ignore = dirty -[submodule "hashcat"] - path = hashcat - url = https://github.com/hashcat/hashcat.git - ignore = dirty [submodule "princeprocessor"] path = princeprocessor url = https://github.com/hashcat/princeprocessor.git diff --git a/Makefile b/Makefile index 6bea46d..9858a01 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,6 @@ submodules: $(MAKE) submodules-pre; \ if [ -f .gitmodules ] && command -v git >/dev/null 2>&1; then \ for path in $$(git config --file .gitmodules --get-regexp path | awk '{print $$2}'); do \ - if [ "$$path" = "hashcat" ] && command -v hashcat >/dev/null 2>&1; then \ - echo "hashcat already installed in PATH, skipping submodule compilation"; \ - continue; \ - fi; \ if [ "$$path" = "princeprocessor" ]; then \ $(MAKE) -C "$$path/src" CFLAGS_LINUX64="-W -Wall -std=c99 -O2 -s -DLINUX"; \ if [ -f "$$path/src/pp64.bin" ]; then cp "$$path/src/pp64.bin" "$$path/"; \ @@ -32,9 +28,8 @@ submodules: submodules-pre: @# Pre-step: basic sanity checks and file generation before building submodules. @# Ensure required directories exist (whether as submodules or vendored copies). - @# hashcat is optional here: submodule is compiled if present, else PATH hashcat is used. - @test -d hashcat || command -v hashcat >/dev/null 2>&1 || { \ - echo "Error: hashcat not found. Either initialize the hashcat submodule or install hashcat."; exit 1; } + @command -v hashcat >/dev/null 2>&1 || { \ + echo "Error: hashcat not found. Install hashcat (e.g. apt install hashcat or brew install hashcat)."; exit 1; } @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)"; } @@ -51,7 +46,7 @@ vendor-assets: @rm -rf hate_crack/hashcat hate_crack/hashcat-utils hate_crack/princeprocessor hate_crack/omen @mkdir -p hate_crack/hashcat @if [ -f hashcat/hashcat ]; then \ - echo "Vendoring compiled hashcat submodule binary..."; \ + echo "Vendoring compiled hashcat binary from submodule..."; \ cp hashcat/hashcat hate_crack/hashcat/hashcat; \ [ -d hashcat/rules ] && cp -R hashcat/rules hate_crack/hashcat/rules || true; \ [ -d hashcat/OpenCL ] && cp -R hashcat/OpenCL hate_crack/hashcat/OpenCL || true; \ @@ -71,7 +66,7 @@ vendor-assets: [ -d "$$HASHCAT_DIR/OpenCL" ] && cp -R "$$HASHCAT_DIR/OpenCL" hate_crack/hashcat/OpenCL || true; \ [ -d "$$HASHCAT_DIR/modules" ] && cp -R "$$HASHCAT_DIR/modules" hate_crack/hashcat/modules || true; \ else \ - echo "Error: hashcat not found. Either compile the hashcat submodule or install hashcat."; \ + echo "Error: hashcat not found. Install hashcat (e.g. apt install hashcat or brew install hashcat)."; \ exit 1; \ fi @cp -R hashcat-utils hate_crack/ @@ -124,7 +119,6 @@ dev-reinstall: uninstall dev-install clean: -$(MAKE) -C hashcat-utils clean - -$(MAKE) -C hashcat clean -@if [ -f .gitmodules ]; then git submodule deinit -f --all; fi rm -rf .pytest_cache .ruff_cache build dist *.egg-info rm -rf ~/.cache/uv diff --git a/README.md b/README.md index bcc0f31..e4efc93 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,21 @@ ## Installation -### 1. Install hashcat (Optional) +### 1. Install hashcat -Hashcat is included as a git submodule and will be compiled automatically. If you already have hashcat installed and in your PATH, the build step will skip the submodule compilation. +Hashcat must be installed and available in your PATH: -To manually install hashcat instead (e.g., system package or pre-built binary), ensure `hashcat` is available in your PATH or set `hcatPath` in `config.json`. +Ubuntu/Kali: +```bash +sudo apt-get install -y hashcat +``` + +macOS (Homebrew): +```bash +brew install hashcat +``` + +Or download a pre-built binary from https://hashcat.net/hashcat/ and set `hcatPath` in `config.json` to its location. ### 2. Download hate_crack @@ -36,7 +46,7 @@ Then customize configuration in `config.json` if needed (wordlist paths, API key The easiest way is to run `make` (or `make install`), which auto-detects your OS and installs: - External dependencies (p7zip, transmission-cli) -- Builds submodules (hashcat-utils, princeprocessor, and optionally hashcat if not in PATH) +- Builds submodules (hashcat-utils, princeprocessor, and optionally omen) - Python tool via uv ```bash @@ -532,10 +542,18 @@ HATE_CRACK_RUN_DOCKER_TESTS=1 uv run pytest tests/test_docker_script_install.py The Docker E2E test also downloads a small subset of rockyou and runs a basic hashcat crack to validate external tool integration. -Lima VM end-to-end test (macOS only, requires Lima): +Lima VM end-to-end test (macOS only): + +Prerequisites: [Lima](https://lima-vm.io/) and `rsync` must be installed. ```bash -uv run pytest tests/test_lima_vm_install.py -v +brew install lima +``` + +The test VM provisions automatically with all Linux dependencies (hashcat, build-essential, curl, git, gzip, p7zip-full, transmission-cli, ocl-icd-libopencl1, pocl-opencl-icd, uv). + +```bash +HATE_CRACK_RUN_LIMA_TESTS=1 uv run pytest tests/test_lima_vm_install.py -v ``` This test validates installation and execution within a lightweight Linux VM on macOS. diff --git a/hashcat b/hashcat deleted file mode 160000 index 2d71af3..0000000 --- a/hashcat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2d71af3718ef76f69c675e933cb4900c40788c58