
hate_crack v2.25.1
TrustedSec 团队开发的一款通过 Hashcat 自动化执行破解方法的工具。
___ ___ __ _________ __
/ | \_____ _/ |_ ____ \_ ___ \____________ ____ | | __
/ ~ \__ \\ __\/ __ \ / \ \/\_ __ \__ \ _/ ___\| |/ /
\ Y // __ \| | \ ___/ \ \____| | \// __ \\ \___| <
\___|_ /(____ /__| \___ >____\______ /|__| (____ /\___ >__|_ \
\/ \/ \/_____/ \/ \/ \/ \/
安装
从源码安装是唯一受支持的途径。hate_crack 不通过 PyPI 分发:pip install hate-crack 会解析到一个 0.0.0 占位包,该占位包刻意安装失败并指向这里。保留这个名字只是为了阻止其他人以它发布相似工具——参见
packaging/pypi-placeholder/。
1. 安装 hashcat
必须安装 hashcat 并确保它在你的 PATH 中可用:
Ubuntu/Kali:```bash sudo apt-get install -y hashcat
macOS(Homebrew):```bash
brew install hashcat
或者从 https://hashcat.net/hashcat/ 下载预构建的二进制文件,并在 config.json 中将 hcatPath 设置为该位置。
2. 下载 hate_crack
使用子模块克隆(需要 hashcat-utils、princeprocessor、pcfg_cracker,以及可选的 omen):```bash git clone --recurse-submodules https://github.com/trustedsec/hate_crack.git cd hate_crack
如果你克隆时未包含子模块,请初始化它们:```bash
git submodule update --init --recursive
然后,如果需要,可自定义配置。hate_crack 使用两个配置文件,每个文件负责一组不同的设置:
config.json— 字典路径、掩码、规则、调优、potfile、hashcat 路径、候选数限制、通知开关、CLI 偏好默认值(共 35 项设置)。.env— 仅包含第三方集成设置:Hashview 和 Hashmob 凭据、Pushover 凭据、Ollama 和 pipal(共 14 项设置)。不受 git 跟踪,创建时权限为0600。
这样划分的原因只有一个:.env 是可能包含密钥(secret)的文件。第三方服务的凭据及其配置放在不受跟踪、权限为 0600 的文件中;而 hate_crack 在本地执行的所有操作则保留在 config.json 中,该文件可以安全地共享、比较差异并纳入你自己的笔记。这也是为什么 Pushover 的凭据位于 .env,而 Pushover 的启停开关位于 config.json —— 开关是本地偏好,不是密钥。
每个键只有一个归属位置。放在另一个文件中的键会被忽略,并且 hate_crack 会打印一条警告,指明该键应属于哪个文件。任何键仍可通过导出其环境变量,在单次运行中覆盖。大多数用户可跳过此步骤,因为默认路径开箱即用。
config.json 是永久且一等公民 —— 它不会被弃用,也没有移除时间表。只有集成设置发生了迁移。
从单个 config.json 升级? hate_crack 会在首次运行时自动为你迁移:集成设置会被复制到新的 0600 .env 中,然后从 config.json 中移除,以免两个文件同时声明这些设置。它会打印出哪些键被移动(绝不显示其值),并在改动前将你的原文件保存为 config.json.pre-split.bak。config.json 中的其他所有内容都保持原样,包括键的顺序。
首次运行: hate_crack 会为你创建这两个文件,因此无需任何操作。若想手动设置 .env,请复制被跟踪的模板:```bash
cp .env.example .env
chmod 600 .env
`.env.example` 已提交并随项目分发,所有凭据键均为空。`.env` 本身**绝不能**提交——它已被 gitignore 忽略,连同其常见的备份命名变体,并且 hate_crack 始终以 `0600` 模式(仅属主可读写)创建它。`.env.example` 由 schema 生成;修改 `hate_crack/config_schema.py` 后,请使用 `uv run python -m hate_crack.config_writer` 重新生成。
### 3. 安装依赖与 hate_crack
最简单的方法是运行 `make`(或 `make install`),它会自动检测你的操作系统并安装:
- 外部依赖(p7zip、transmission-daemon / transmission-remote)
- 构建子模块(hashcat-utils、princeprocessor、pcfg_cracker,以及可选的 omen)
- 通过 uv 安装 Python 依赖,并在 `~/.local/bin/hate_crack` 处提供 CLI 启动器```bash
make
这是幂等的——它会跳过已安装的工具。要强制干净地重新安装:```bash make reinstall
**或者手动安装依赖:**
### 外部依赖
以下是某些下载/解压流程所必需的:
- `7z`/`7za` (p7zip) — 用于解压 `.7z` 压缩包。
- `transmission-daemon` / `transmission-remote` — 用于下载 Weakpass 种子。
手动安装命令:
Ubuntu/Kali:```bash
sudo apt-get update
sudo apt-get install -y p7zip-full transmission-daemon
macOS (Homebrew):```bash brew install p7zip transmission-cli # provides transmission-daemon and transmission-remote
然后安装 Python 依赖和 CLI shim:```bash
uv sync
mkdir -p ~/.local/bin
printf '#!/usr/bin/env bash\nset -euo pipefail\nexec uv run --directory %s python -m hate_crack "$@"\n' "$(pwd)" > ~/.local/bin/hate_crack
chmod +x ~/.local/bin/hate_crack
项目结构
核心逻辑现在拆分为 hate_crack/ 下的模块:
hate_crack/cli.py:argparse 辅助函数与配置覆盖。hate_crack/api.py:Hashview、Weakpass 和 Hashmob 集成(下载/菜单/辅助函数)。hate_crack/attacks.py:菜单攻击处理程序。hate_crack/hashmob_wordlist.py:Hashmob 字典工具(薄封装;调用 api.py)。hate_crack/corpus_stats.py:用于向 LLM 描述语料库的全语料密码统计信息。hate_crack/plaintext.py:从语料库行中恢复密码(去除哈希前缀、解码$HEX[...]);供 LLM 模式、corpus_stats 和 rulegen 共用。hate_crack/llm.py:通过 Atomic Agents 进行结构化(JSON)LLM 候选生成。hate_crack/menu.py:共享菜单渲染器,包括可选的方向键导航。hate_crack/noninteractive.py:脚本化攻击子命令的调度器。hate_crack/notify/:通知包(Pushover 后端、每次破解的跟踪器)。hate_crack/username_detect.py:检测username:hash输入文件,以决定 hashcat 的--username选项。hate_crack/formatting.py、hate_crack/progress.py:输出格式化和进度显示辅助函数。hate_crack/main.py:主要 CLI 实现。
顶层 hate_crack.py 仍是主入口点,并负责协调这些模块。
参考与致谢
本项目依赖并受到多个外部项目与服务的启发。感谢:
- Hashview (http://github.com/hashview/)
- Weakpass (https://weakpass.com)
- Hashmob (https://hashmob.net)
用法
使用 make 安装后,可在任意位置运行 hate_crack:```bash
hate_crack
or with arguments:
hate_crack <hash_file> <hash_type> [options]
或者,通过 `uv` 运行:```bash
uv run hate_crack.py <hash_file> <hash_type>
作为工具运行(推荐)
使用 make 从仓库根目录进行安装 - 这会构建子模块并打包资源:```bash
cd /path/to/hate_crack
make
hate_crack
`make install` 命令会在 `~/.local/bin/hate_crack` 创建一个 bash shim,该 shim 从仓库目录运行,因此无论当前工作目录在哪里,配置和资源文件总能被找到。
配置也会在以下位置搜索:
- 仓库根目录和包目录
- `~/.hate_crack`
**注意:** `config.json` 中的 `hcatPath` 仅用于指定 hashcat 二进制文件的位置(如果 hashcat 已在 PATH 中,则可选)。Hate_crack 的资源(hashcat-utils、princeprocessor、pcfg_cracker、omen)从仓库目录加载,并由 `make install` 自动捆绑。
### 作为脚本运行
脚本使用 `uv` shebang。使其可执行并运行:```bash
chmod +x hate_crack.py
./hate_crack.py
你也可以直接使用 Python:```bash python hate_crack.py
### 非交互式/脚本化使用
为了自动化,你可以直接发起一次攻击,跳过菜单。攻击名称作为第一个参数,后跟哈希文件和 hashcat 哈希类型。预处理提示(计算机账户过滤、LM 优先暴力破解、重复账户去重)在此模式下会自动接受其默认值。进程在成功时退出 `0`,出错时退出非零值(缺少哈希文件、非数字哈希类型、缺少字典文件或未知规则文件名)。```bash
# Quick crack: one wordlist + optional rule(s) from the rules directory
hate_crack quick hashes.txt 1000 --wordlist rockyou.txt --rules best64.rule
# Chain two rules in a single run
hate_crack quick hashes.txt 1000 --wordlist rockyou.txt --rules best64.rule+d3ad0ne.rule
# Run two rules as two separate passes
hate_crack quick hashes.txt 1000 --wordlist rockyou.txt --rules best64.rule d3ad0ne.rule
# Canned dictionary methodology (uses your configured wordlists)
hate_crack dict hashes.txt 1000
# Brute force lengths 1-8
hate_crack brute hashes.txt 1000 --min 1 --max 8
# Top-mask attack targeting ~4 hours
hate_crack topmask hashes.txt 1000 --target-time 4
故障排查
错误:更新时提示 "would clobber existing tag"
较旧的克隆可能会拒绝更新,并打印一长串类似这样的行:``` ! [rejected] v2.5.0 -> v2.5.0 (would clobber existing tag)
这会影响 2026 年 7 月之前创建的克隆。发布的历史记录被重写,
以移除一些绝不应该提交的文件,这使
每个提交都获得了新的 ID;因此,旧克隆的标签指向了这个
仓库不再包含的对象,git 拒绝移动它已有的标签。
你的检出没有问题,也没有任何破解数据面临风险。
通过一次性重置即可恢复。这会丢弃本地提交和检出中的编辑,
因此,如果你自定义了任何由 git 跟踪的内容(相对于
`config.json`,它不被跟踪),请先将其提交到一个分支:```bash
cd /path/to/hate_crack
git fetch --tags --force origin
git checkout -B main origin/main
make install
--force 在这里只会更新标签;它无法改动你的提交。之后
内置更新程序就能正常工作。2.18 之前的版本无法自行执行此
恢复操作,因此需要手动执行一次。
错误:构建目录不存在
如果你看到类似如下的错误:``` Error: Build directory /opt/hashcat/hashcat-utils does not exist. Expected to find expander at /opt/hashcat/hashcat-utils/bin/expander.
这意味着 hate_crack 资源未被打包到已安装的程序包中。
**理解路径:**
- config.json 中的 `hcatPath` → 指向 **hashcat 二进制文件位置**(可选,也可位于 PATH 中)
- `hashcat-utils/` 和 `princeprocessor/` → 由 `make install` 打包进程序
**解决方案:**
使用 Makefile 重新安装,它会构建子模块并安装该工具:```bash
cd /path/to/hate_crack # the repository checkout
make install
默认配置 (config.json.example):
大多数用户无需自定义即可使用默认配置:
hcatWordlists:./wordlists(相对于仓库根目录或 HOME/.hate_crack)hcatOptimizedWordlists:./optimized_wordlists(Quick Crack 使用的目录; 如果未找到则回退到hcatWordlists)rules_directory:./hashcat/rules(包含子模块规则)hcatTuning: `` (空字符串 - 无默认调优参数)
示例 config.json 自定义配置:```json { "hcatPath": "/usr/local/bin", # Location of hashcat binary (optional, auto-detected from PATH) "hcatBin": "hashcat", # Hashcat binary name "hcatWordlists": "./wordlists", # Dictionary wordlist directory (relative or absolute) "rules_directory": "./hashcat/rules", # Rules directory (relative or absolute) "hcatTuning": "", # Additional hashcat flags (empty by default) ... }
**配置加载:**
- 每个键的优先级:`os.environ` > 该键对应的主目录文件(`.env` 或 `config.json`)> 内置默认值
- 缺失的键回退到内置默认值;`config.json.example` 记录了每个 `config.json` 键
- 两个文件会彼此独立地按以下顺序搜索:**仓库根目录**,然后是**已安装的包目录**,最后是**`~/.hate_crack`**。先匹配到的生效;两个文件来自不同目录是正常现象。
- 首次运行时,两个文件都会被创建——`config.json` 从 `config.json.example` 生成,`.env` 从内置默认值生成。如果旧的 `config.json` 中仍包含集成密钥,它们会被复制到新的 `.env` 中,并且 hate_crack 会告诉你应从 `config.json` 中删除哪些密钥;它从不自行编辑该文件。
- 每次运行时,hate_crack 都会打印它实际加载的两个文件: ```
[*] config.json: /home/you/.hate_crack/config.json
[*] .env: /home/you/.hate_crack/.env
在调试一个“似乎未生效”的设置之前,请先阅读这两行。它们之所以存在,是因为搜索顺序中有两个陷阱:
- 检出目录优先于你的主目录。 仓库根目录会被优先搜索,因此,你运行该工具时所在的任意检出目录中的
.env或config.json都会优先于~/.hate_crack中的同名文件——而正是从检出目录运行工具,才会首先在这些位置创建这些文件。 - 当前工作目录永远不会被搜索。 你碰巧所在目录中的
.env会被故意忽略:项目目录中满是并非用作配置的文件。请将其放在仓库根目录或~/.hate_crack。
错误:与引用 'refs/heads/master' 合并,但未获取到该引用
如果你看到:``` Your configuration specifies to merge with the ref 'refs/heads/master' from the remote, but no such ref was fetched.
默认分支已从 `master` 重命名为 `main`。修复方法:```bash
git remote set-head origin -a
git branch -m master main
git branch --set-upstream-to=origin/main main
git pull
Makefile 目标
默认(完整安装) - 构建子模块、安装依赖项并安装工具:```bash make
or explicitly:
make install
这是幂等的——它会跳过已安装的工具。
**强制干净重装:**```bash
make reinstall
快速更新 - 重建子模块并重新安装工具(在拉取更改后):```bash make update
**卸载** - 移除操作系统依赖和工具:```bash
make uninstall
仅构建 hashcat-utils:```bash make hashcat-utils
**运行测试** - 在需要时自动处理 HATE_CRACK_SKIP_INIT:```bash
make test
覆盖率报告:```bash make coverage
**清理构建/测试产物:**```bash
make clean
开发
设置开发环境
使用可选的开发依赖安装项目(包括 lint 工具和测试工具):```bash make dev-install
### 运行 Linter 和类型检查
在推送更改之前,请在本地运行这些检查。使用 `make lint` 一次性完成所有检查,或单独运行各项检查:
**Ruff(代码检查与格式化):**```bash
make ruff
# or manually:
uv run ruff check hate_crack tests tools packaging hate_crack.py
自动修复问题:```bash uv run ruff format hate_crack tests tools packaging hate_crack.py uv run ruff check --fix hate_crack tests tools packaging hate_crack.py
**ty (类型检查):**```bash
make ty
# or manually:
uv run ty check hate_crack
一起运行所有检查:```bash make lint
### 运行测试
测试会自动检测子模块未构建的情况,并自动设置 `HATE_CRACK_SKIP_INIT=1`。```bash
make test
或者直接运行 pytest:```bash uv run pytest -v
覆盖范围:```bash
make coverage
或者使用 pytest:```bash uv run pytest --cov=hate_crack
### Git 钩子(prek)
Git 钩子由 [prek](https://github.com/j178/prek)(v0.3.3+)管理。使用以下命令安装钩子:```bash
prek install --hook-type pre-push --hook-type pre-commit
这会使用 pre-commit 的 local-repo TOML 模式安装 prek.toml 中定义的钩子:
- pre-push(本地钩子):ruff、ruff-format、ty、pytest、pytest-lima、bandit
- pre-commit(来自
pre-commit/pre-commit-hooks):trailing-whitespace、 end-of-file-fixer、check-yaml、check-merge-conflict、check-added-large-files、 detect-private-key
pre-commit 的自动修复器会就地重写文件,因此运行后需要重新暂存并再次提交。
注意:prek 0.3.3 期望在顶层使用 repos = [...]。旧的 [hooks.<stage>] commands = [...] 格式不受支持。
方向键菜单导航
菜单默认使用经典的编号 print() + input() 选择方式,支持完整的多位数字键。
要通过 simple-term-menu 启用方向键导航,请设置 HATE_CRACK_ARROW_MENU=1。在该模式下,只有单个数字的快捷键有效;编号为 10 及以上的选项必须使用方向键选择。方向键模式还需要 TTY,因此当输出被管道化时它保持关闭。
开发依赖
可选的 [dev] 组包括:
- ty - 静态类型检查器
- ruff - 快速的 Python 代码检查器和格式化工具
- pytest - 测试框架
- pytest-cov - 覆盖率报告
常用选项:
--download-hashview:在破解前从 Hashview 下载哈希。--hashview:交互式 Hashview 菜单,用于管理哈希、字典和任务。--hashview --help:显示 Hashview 命令行选项。--weakpass:从 Weakpass 下载字典。--hashmob:从 Hashmob.net 下载字典。--download-torrent <FILENAME>:下载指定的 Weakpass torrent 文件。--download-all-torrents:从缓存下载所有可用的 Weakpass torrent。--wordlists-dir <PATH>/--optimized-wordlists-dir <PATH>:覆盖字典目录。--pipal-path <PATH>:覆盖 pipal 路径。--restore-potfile:启动时从 hashcat POT 文件重建<hashfile>.out,替换任何现有内容,然后继续进入正常菜单。没有此标志时,POT 查找仅在.out不存在时运行。菜单选项 93 在需要时执行同样的操作,并带有确认提示。--maxruntime <SECONDS>:覆盖最大运行时间。--bandrel-basewords <PATH>:覆盖 bandrel 基础词文件。--update:更新到最新发布版并重新安装。如果当前在其他分支,则将检出切换到main,因为发布标签位于该分支。--nightly:改为从nightly-dev分支更新到最新的 nightly 版本。Nightly 版本已通过 CI,但不属于正式发布的版本。也可以写作--update --nightly。--no-optimized-kernel(或--no-optimize):在整个运行过程中绝不向 hashcat 传递-O。覆盖config.json中的optimizedKernelAttacks,并移除你在hcatTuning中添加的任何-O。不会向配置写回任何内容,因此仅对本次运行生效。与子命令一起使用时,请将其放在子命令之前:./hate_crack.py --no-optimize quick hashes.txt 1000 --wordlist words.txt。--debug:启用调试日志(写入 stderr)。
Hashview 集成
hate_crack 与 Hashview 集成,用于集中式哈希管理和分布式破解。
交互式菜单
访问交互式 Hashview 菜单:```bash hate_crack.py --hashview
菜单选项:
- **(1) Upload Cracked Hashes** - 将当前会话中已破解的结果上传到 Hashview
- **(2) Upload Wordlist** - 将字典文件上传到 Hashview
- **(3) Download Wordlist** - 从 Hashview 下载字典
- **Download Rule** - 从 Hashview 下载规则文件(解压为纯文本,可直接用于 `hashcat -r`)
- **(4) Download Left Hashes** - 下载剩余未破解的哈希(提示切换以进行破解)
- **(5) Download Found Hashes** - 下载已破解的哈希及明文密码(供参考/分析)
- **(6) Upload Hashfile and Create Job** - 上传新的哈希文件并创建破解任务
- **(99) Back to Main Menu** - 返回主菜单
**重要提示:Download Found 与 Download Left 的区别**
- **Download Left Hashes (4)**:下载需要破解的未破解哈希。如果存在已找到的哈希,会自动合并,并提示切换到此哈希文件进行破解。
- **Download Found Hashes (5)**:以 hash:cleartext 格式下载已破解的哈希。这些哈希仅供参考,无法继续破解。不显示切换提示。
#### 命令行界面
Hashview 操作也可以通过命令行执行:
上传已破解的哈希:```bash
hate_crack.py --hashview upload-cracked --file <output_file>.out --hash-type 1000
上传字典:```bash hate_crack.py --hashview upload-wordlist --file .txt --name "My Wordlist"
下载规则文件(已解压保存,可直接用于 `hashcat -r`):```bash
hate_crack.py --hashview download-rules --rules-id 4 --output best64.rule
下载剩余的哈希值(用于破解的未破解哈希):```bash hate_crack.py --hashview download-left --customer-id 1 --hashfile-id 123
下载已找到的哈希 (已破解的哈希及其明文):```bash
hate_crack.py --hashview download-found --customer-id 1 --hashfile-id 123
上传哈希文件并创建任务:```bash
hate_crack.py --hashview upload-hashfile-job --file hashes.txt --customer-id 1
--hash-type 1000 --job-name "NTLM Crack Job" --hashfile-name "Domain Hashes"
#### 配置
在 `.env` 中设置 Hashview 凭据(这些是集成设置,因此它们不存放在 `config.json` 中):```
HASHVIEW_URL=https://hashview.example.com
HASHVIEW_API_KEY=your-api-key-here
Ollama 配置
LLM 攻击(选项 12)使用 Ollama 生成密码候选。请在 .env 中配置模型、上下文窗口和请求超时:```
OLLAMA_MODEL=qwen2.5:32b
OLLAMA_NUM_CTX=8192
OLLAMA_TIMEOUT=300
- **`OLLAMA_MODEL`** — 用于候选口令生成的 Ollama 模型(默认:`qwen2.5:32b`)。LLM 攻击使用结构化(JSON)输出,因此请选择对工具/JSON 支持良好的模型。
- **`OLLAMA_NUM_CTX`** — 模型的上下文窗口大小(默认:`8192`)。在引入语料统计之前,此值为 `2048`,太小而无法容纳所给出的提示词:500 条抽样明文在系统提示词和回复之前大约占用 2,000–3,500 个 token,因此 Ollama 会静默截断抽样器精心散布在文件中的部分样本。
- **`OLLAMA_TIMEOUT`** — 放弃之前等待生成响应的秒数(默认:`300`)。如果大型模型在首次请求时仍在加载到显存中,请调高此值,否则可能会超过超时;`hate_crack` 在触发时会打印已消耗的超时时间和此设置的名称。
- **`OLLAMA_MAX_SAMPLE_LINES`** — 低于此阈值时,LLM 模式也会将字面明文粘贴到提示词中(默认:`500`)。≤ 0 的值按 500 处理。
基于语料的模式(**Wordlist**、**Cracked passwords**、**Pattern rules**)始终以统计方式描述*整个*语料——基础词占比、掩码、大小写、长度、尾随数字和符号、年份——而非粘贴其中的片段。聚合是有界的,因此 120,000 条口令的转储与 500 行的转储所占提示词空间大致相同。当整个语料低于此阈值时,原始明文也会一并包含,因为向模型隐藏小型语料毫无收益。
这取代了之前粘贴最多 `ollamaMaxSampleLines` 条均匀间隔口令样本的行为。大型转储的样本完全无法传达频率信息:模型无法区分被组织中 8% 的人使用的基础词与仅被一个人使用的基础词,而这恰恰是让一次猜测值得运行的关键信号。
- **`OLLAMA_NO_CLOUD`** — 当为 `true` 时,拒绝向 Ollama *云端*模型发送任何内容。Ollama 通过本地模型使用的同一本地端点,将带 `-cloud` 标签的模型(`gpt-oss:120b-cloud`、`deepseek-v3.1:671b-cloud`)代理到 ollama.com,因此请求看起来毫无不同——但 `hate_crack` 的提示词携带已恢复的明文、语料统计,以及客户名称、行业和位置。设置此选项后,在构建任何请求之前就会拒绝云端模型名称。默认值为 `false`,因此特意配置的云端模型仍可正常工作;在客户数据不得离开主机的项目中,请开启此选项。
- **`OLLAMA_AUTO_RESEARCH`** — 当为 `true`(默认)时,**Target info** 模式会在您刚输入公司名称后立即让本地模型建议行业和位置,并将其作为可编辑的提示词默认值提供。设置为 `false` 则始终获得空白提示词(在模型较慢时很有用,因为调研会在攻击开始前额外花费一次往返)。
- **`OLLAMA_HOST`** — Ollama 监听的地址。接受裸 `host:port`(`theplague.lan:11434`)或带协议的完整 URL(`https://ollama.example.com`);无论哪种方式,基础 URL 都会在使用前被规范化。默认为 `localhost:11434`。在 `.env` 中设置,或将其导出为真实的环境变量,以便在单次运行中覆盖该值——这与 Ollama 自身 CLI 读取的变量名相同。
- 使用 LLM Attack 之前,请确保 Ollama 正在运行且模型已拉取(`ollama pull qwen2.5:32b`)——`hate_crack` 不再自动拉取缺失的模型。
该攻击提供三种生成模式:
1. **Target info** — 公司 / 行业 / 位置;模型根据这些详细信息推导出候选口令。
输入公司名称后,`hate_crack` 会询问同一个本地模型它已经了解该组织的哪些信息,并将答案预填到 **行业** 和 **位置** 提示框中,以括号形式显示: ```
Company name: Acme Rail Services
[!] The values in parentheses below are the local model's GUESSES, not verified OSINT.
Press Enter to accept, or type your own value to override.
Industry (freight rail maintenance):
Location (Omaha, Nebraska):
按 Enter 接受建议,或直接键入覆盖。这些值是模型的记忆,并非 OSINT——应将其视为起点,而非关于客户的情报。该查询仅使用本地 Ollama 服务器,因此客户端名称永远不会离开主机;不会有网络或第三方 API 调用。如果模型无法识别该组织(小型客户的常见情况),它将不返回任何内容,你会得到空白的提示符: ``` Company name: Acme Rail Services Industry: Location:
研究失败 — 超时、Ollama 未运行、空答案 — 绝不会阻止攻击;它只会回退为空白提示。将 `ollamaAutoResearch` 设为 `false` 可完全跳过研究。
2. **Wordlist** — 从样本单词列表中推导基础词。
3. **已破解的密码** — 将本次会话已恢复的明文(`<hashfile>.out`)反馈给模型,使其能推断目标组织自身的密码惯例(基础词、季节、年份、后缀、leet 拼写),并生成同样风格的*新*候选。只有至少破解出一个哈希后,该选项才会列出;整个文件与 Wordlist 模式一样进行统计分析(参见上文 `ollamaMaxSampleLines`)。
#### PCFG 配置
PCFG 攻击(选项 20)和 PRINCE-LING 攻击(选项 21)使用 `pcfg_cracker` 子模块。在 `config.json` 中配置它们:```json
{
"pcfgRuleset": "DEFAULT",
"pcfgMaxCandidates": 50000000,
"pcfgPrinceLingMaxCandidates": 10000000
}
pcfgRuleset—— 要使用的已训练语法名称(默认:DEFAULT),解析为pcfg_cracker/Rules/<name>/。使用 pcfg_cracker 的trainer.py训练自己的语法,并将其设置为此规则集名称。pcfgMaxCandidates——pcfg_guesser.py为 PCFG 攻击生成的最大候选数(默认:50000000)。pcfgPrinceLingMaxCandidates——prince_ling.py写入缓存的 PRINCE 基础词表的最大基础词数(默认:10000000)。
优化内核(optimizedKernelAttacks)
hashcat 的 -O 标志选择优化内核,这些内核速度明显更快,但会限制候选长度(大约 31 个字符,某些模式更低),并静默跳过任何更长的内容。config.json 中的 optimizedKernelAttacks 列出了使用 -O 运行的攻击;从列表中省略某个攻击,即可使用全长内核运行它。config.json.example 中的列表与内建默认值一致,该默认值在不存在 config.json 时生效。
四个攻击遵循该设置,但默认不使用优化,因为它们提供的候选可能超过 -O 的上限——将它们添加到列表中以选择加入:
hcatNgramX、hcatOllama、hcatOmen、hcatLMtoNT
要在不编辑配置的情况下为单次运行全局关闭 -O,请传入 --no-optimized-kernel(短形式 --no-optimize)。它会覆盖每个攻击的列表,并丢弃写入 hcatTuning 中的 -O,否则后者会无视该列表而到达 hashcat。
名称必须完全匹配,无法识别的条目会在启动时报告,而不是被忽略。注意,委托给另一个攻击的攻击由被委托的攻击控制,而不是由自身名称控制:PRINCE-LING 遵循 hcatPrince,而 Spoonman、Rosetta 和 LLM 模式规则模式遵循 hcatQuickDictionary。
通知(菜单选项 82)
hate_crack 可以在攻击完成时发送 Pushover 推送通知,并且(可选)在单个哈希被破解时也发送。所有控制项都位于主菜单选项 82 — Notifications 下:
- 切换 Pushover 通知 [ON/OFF] —— 总开关。以
notify_enabled形式持久化到config.json。 - 切换每次破解通知 [ON/OFF] —— 打开时,后台 tailer 会监视
.out文件,并在每次破解时推送通知(带按周期突发聚合)。以notify_per_crack_enabled形式持久化到config.json。总开关关闭时无法启用——请先启用选项 1。 - 发送测试 Pushover 通知 —— 发送一条预设推送,以便你可以确认 Pushover 令牌/用户组合可用。即使总开关关闭也能使用。
凭据存放在 .env 中;其余调优旋钮仅可通过 config.json 配置文件设置:
NOTIFY_PUSHOVER_TOKEN、NOTIFY_PUSHOVER_USER(在.env中)——触发任何推送所必需。菜单中没有任何项目会写入这些值;请自行编辑.env。notify_attack_allowlist—— 无需[y/N/always]提示即可自动同意的攻击名称。当你回答always时自动填充。notify_suppress_in_orchestrators(默认true)——静默 Extensive Crack 链接的各个单独攻击,而只发送一条汇总通知。设为false可让每个链接的攻击都收到通知。其他运行多轮的菜单项(例如带有多个规则链的 Quick Crack)不是编排器,始终按轮发送通知。notify_max_cracks_per_burst(默认5)、notify_poll_interval_seconds(默认5.0)——每次破解通知的 tailer 调优。突发聚合逻辑见hate_crack/notify/tailer.py。
字典工具(菜单选项 80)
字典工具子菜单提供由 hashcat-utils 二进制程序支持的字典预处理工具,以及来自 Hashmob.net 和 Weakpass 的字典下载。通过主菜单中的选项 80 访问。
| 选项 | 二进制 | 功能 |
|---|---|---|
| 1 | len.bin | 按长度过滤 - 仅保留长度在最小值和最大值之间的词 |
| 2 | req-include.bin | 要求字符类别 - 仅保留包含所有必需字符类型的词 |
| 3 | req-exclude.bin | 排除字符类别 - 删除包含任何被排除字符类型的词 |
| 4 | cutb.bin | 提取子串 - 从每个词中截取一段字节范围 |
| 5 | splitlen.bin | 按长度拆分 - 为每种词长创建单独文件(输出目录中文件命名为 01-64) |
| 6 | rli.bin / rli2.bin | 减去词 - 删除出现在一个或多个其他文件中的条目 |
| 7 | gate.bin | 分片 - 提取每隔 N 个词一个,用于多台机器上的分布式破解 |
| 8 | - | 优化字典 - 去重并按长度拆分到优化字典目录下 |
| 9 | - | 从 Hashmob.net 下载字典 |
| 10 | - | 从 Weakpass 下载字典(通过 BitTorrent) |
字符类别掩码位(用于选项 2 和 3):1=小写字母,2=大写字母,4=数字,8=符号,16=其他。将值相加:7 = 小写字母+大写字母+数字。
分片的预期用法:分片将一个字典拆分为 N 个相等且不重叠的部分,以便将工作分散到多台机器或多块 GPU 上。每个部分都是交错的(每隔 N 行取一个),因此每个分片都是整个列表的代表性样本,而不是连续的前/后块——不会有单个节点卡在只破解低概率尾部。
运行一次选项 7,提供输入字典、输出基础路径和分片数量(N)。它会在单遍写入中生成全部 N 个部分,并使用零填充的编号命名(base.001、base.002、…直到 base.00N)。将其中一个部分复制到每个节点,并让该节点的 hashcat 运行指向它。在单 GPU 系统上,分片不会带来加速,但单个部分仍然是快速、具有代表性的样本,适合在投入完整字典之前进行快速初筛。
自动更新检查
hate_crack 可以在启动时自动检查 GitHub 上是否有更新版本。此功能由 check_for_updates 配置选项控制:```json
{
"check_for_updates": true
}
- **`check_for_updates`** — 在启动时启用自动版本检查(默认:`true`)。
- 启用后,hate_crack 会从 GitHub 获取最新发布信息,并在有可用更新时显示通知。
- 该检查异步运行,不会阻塞启动。网络错误会被静默忽略。
##### 更新通道
| Channel | Flag | Source | What you get |
|---------|------|--------|--------------|
| 发布版 | `--update` | `main` | 最新的正式发布版本。这是默认选项,也是启动检查所提供的内容。 |
| 夜间版 | `--nightly` | `nightly-dev` | 已通过 CI 但尚未发布的代码。 |
版本遵循普通的语义化版本规范(semver),版本号的提升由批次中的实际内容决定。**仅当包含功能时**,第二个组成部分(次版本号)才会递增:含有任意 `feat` 提交的周期将面向 `X.(Y+1).0`,而仅包含修复、文档和杂务的周期将面向 `X.Y.(Z+1)`。
`nightly-dev` 会为批次所面向的版本打上发布候选标签——`v2.20.1rc1`、`v2.20.1rc2`、……——合并到 `main` 后,该目标会被提升为最终正式版本。候选版本是真正的 PEP 440 预发布版本,因此它们在两端都能正确排序:
2.20.0 < 2.20.1rc1 < 2.20.1rc2 < 2.20.1 < 2.21.0rc1 < 2.21.0
目标在周期中可能会改变:第一个合入的 `feat` 会将其从 `X.Y.(Z+1)` 移至 `X.(Y+1).0`,并且候选版本的编号会针对新目标重新开始。该编号始终标示该批次当下发布时会使用的版本。
主版本号永远不会被自动提升——`!` 主题或 `BREAKING CHANGE:` 脚注会被视为功能变更,因为自动提升主版本号意味着一个敲错的提交主题就可能导致一次不可逆的正式发布。主版本号的提升是明确的人工操作:手动打标签并推送。
该策略位于 `tools/next_version.py` 中,由两个打标签工作流共用,并在 `tests/test_next_version.py` 中进行了单元测试。
启动检查只会提供正式发布版本,因为夜间版构建根本不会发布 GitHub release,而该检查读取的是 GitHub 的 "latest release" 端点——因此启用 `check_for_updates` 永远也不会把你带到夜间版。目前有两个因素将两个通道区分开来:其一是这一点;其二是候选版本是真正的 PEP 440 预发布版本,因此任何按原始版本号排序的工具也会将其视为比它最终变成的正式版更旧。
任意一个标志都会先将你的检出(checkout)切换到对应分支(如果你有未提交的更改,则会拒绝切换)。如果你正在运行夜间版并希望回到已发布代码,`--update` 会将你移回 `main`。
#### 自动合并已破解哈希(仅下载左侧哈希时)
下载左侧哈希(未破解哈希)时,hate_crack 会自动:
1. 尝试从 Hashview 下载任何已找到(已破解)的哈希,作为辅助操作
2. 将已找到的哈希与本地 `.out` 文件合并(例如,pwdump 格式的 `left_1_123.txt.out` 或 `left_1_123.nt.txt.out`)
3. 移除重复条目
4. 合并后清理临时分片文件
这可以确保在处理未破解哈希时,你本地的破解结果与 Hashview 的集中式数据库保持同步。
**注意:** download-found 选项会单独下载已破解的哈希以供参考,不会执行任何合并操作,也不会提示进行破解。
通过运行 `hashcat --help` 可获取 <hash_type>。
示例哈希:http://hashcat.net/wiki/doku.php?id=example_hashes```
$ hashcat --help |grep -i ntlm
5500 | NetNTLMv1 | Network protocols
5500 | NetNTLMv1 + ESS | Network protocols
5600 | NetNTLMv2 | Network protocols
1000 | NTLM | Operating-Systems
-
概念验证模板:预制的常见漏洞类型(SQL注入、XSS、RCE、SSRF、LFI、IDOR等)的PoC模板。
-
快速入门指南:5分钟内即可启动运行。
-
多协议支持:测试Web应用、云服务和网络服务(HTTP、DNS、gRPC、原始TCP等)。
-
自动化友好:与CI/CD管道、漏洞扫描器和漏洞赏金工作流集成。``` $ ./hate_crack.py 1000
/ | _____ / | ____ _ ___ ____________ ____ | | __
/ ~ __ \ / __ \ / \ /_ __ _ \ / | |/ /
\ Y // __ | | \ / \ _| | // __ \ _| <
___| /(__ /| _ >______ /|__| ( /___ >|_
/ / /___/ / / / /
Version 2.0
## 测试
测试套件大部分为离线运行,并使用模拟对象(mocks)和固定数据(fixtures)。实时网络检查和系统依赖检查可通过环境变量选择启用。
### 在本地运行测试```bash
# Run all tests
uv run pytest -v
# Run specific test
uv run pytest tests/test_hashview.py -v
你还可以使用 make test 运行完整测试套件。
在线测试(可选启用)
设置以下任意一项以启用在线检查:
HASHMOB_TEST_REAL=1— Hashmob 连接/CLI 菜单在线检查HASHVIEW_TEST_REAL=1— Hashview CLI 菜单在线检查WEAKPASS_TEST_REAL=1— Weakpass CLI 菜单在线检查HATE_CRACK_REQUIRE_DEPS=1— 如果缺少7z、transmission-daemon或transmission-remote则失败
Hashview 在线上传测试
Hashview 在线上传测试默认跳过。要运行它,请在 .env 中设置环境变量并提供有效凭据:```bash
HATE_CRACK_RUN_LIVE_TESTS=1 uv run pytest tests/test_upload_cracked_hashes.py -v
### 针对本地 Docker 堆栈的实时 Hashview 测试
除了将实时测试指向远程 Hashview 服务器之外,您还可以让测试套件启动一个本地 [Hashview](https://github.com/hashview/hashview) Docker 堆栈,为其填充种子数据,对其运行实时测试,然后将其拆除。设置 `HASHVIEW_TEST_LOCAL=1`,并将 `HASHVIEW_REPO` 指向 Hashview 的检出目录:```bash
HASHVIEW_TEST_LOCAL=1 HASHVIEW_REPO=~/projects/hashview \
HATE_CRACK_SKIP_INIT=1 uv run pytest tests/test_hashview_cli_subcommands_subprocess.py -v
在Hashview仓库中启动docker compose,植入一个管理员API密钥、一个客户、一个哈希文件,以及已破解的"有效任务"数据,然后导出测试所需读取的HASHVIEW_*环境变量。有用的环境变量:
HASHVIEW_TEST_LOCAL=1— 启用本地堆栈(否则为无操作)HASHVIEW_REPO=<path>— Hashview检出目录(默认~/projects/hashview)HASHVIEW_KEEP=1— 会话结束后保持容器运行(加快重新运行速度)HASHVIEW_LOCAL_PORT=5000— 应用发布到的主机端口
hate_crack CLI会遵循HASHVIEW_URL / HASHVIEW_API_KEY环境变量(覆盖这两个键所在的.env),这使测试套件无需编辑持久化配置即可将CLI指向本地堆栈。
端到端安装测试(本地 + Docker)
本地uv工具安装 + 脚本执行(使用临时HOME):```bash HATE_CRACK_RUN_E2E=1 uv run pytest tests/test_e2e_local_install.py -v
基于 Docker 的端到端安装/运行(通过 `Dockerfile.test` 缓存):```bash
HATE_CRACK_RUN_DOCKER_TESTS=1 uv run pytest tests/test_docker_script_install.py -v
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):
Prerequisites: Lima and rsync must be installed.```bash
brew install lima
测试虚拟机自动配置所有 Linux 依赖项(hashcat、build-essential、curl、git、gzip、p7zip-full、transmission-daemon、ocl-icd-libopencl1、pocl-opencl-icd、uv)。```bash
HATE_CRACK_RUN_LIMA_TESTS=1 uv run pytest tests/test_lima_vm_install.py -v
此测试验证在 macOS 上的轻量级 Linux 虚拟机中的安装与执行。
测试结构
- tests/test_hashview.py:针对 HashviewAPI 类的全面测试套件,使用模拟 API 响应,包括:
- 客户列表与数据验证
- 认证与授权测试
- Hashfile 上传功能
- 完整的作业创建流程
所有测试均使用模拟 API 调用,因此无需连接 Hashview 服务器即可运行。
(1) 快速破解 (2) 全面 Pure_Hate 方法论破解 (3) 暴力破解攻击 (4) Top Mask 攻击 (5) 指纹攻击 (6) 组合器攻击 (7) 混合攻击 (8) Pathwell Top 100 掩码暴力破解 (9) PRINCE 攻击 (10) Bandrel 方法论 (11) Loopback 攻击 (12) LLM 攻击 (13) OMEN 攻击 (14) 临时掩码攻击 (15) Markov 暴力破解攻击 (16) N-gram 攻击 (17) 排列攻击 (18) 随机规则攻击 (19) Combipow 密码短语攻击 (20) PCFG 攻击 (21) PRINCE-LING 攻击 (22) Spoonman 攻击 (23) Rosetta 攻击
(80) 字典工具 (81) 规则文件工具 (82) 通知
(93) 从 POT 文件重新生成 .out (94) Hashview API (95) 使用 Pipal 分析哈希 (96) 将输出导出为 Excel 格式 (97) 显示已破解哈希 (98) 显示 README (99) 退出
选择一个任务:```
Option 94 — Hashview API is only listed when HASHVIEW_API_KEY is set in .env.
The YOLO, Middle, and Thorough Combinator attacks were previously at keys 10-12. They now live in the Combinator Attacks submenu (option 6) along with Combinator3 and CombinatorX.
Quick Crack
Runs a dictionary attack against wordlists in your hcatOptimizedWordlists directory (falls back to hcatWordlists if not configured) and optionally applies rules. Multiple rules can be selected by comma-separated list, and chains can be created with the '+' symbol. Pressing Enter at the wordlist prompt uses the configured optimized wordlists directory as the default.
您想运行哪些规则?
(1) best64.rule
(2) d3ad0ne.rule
(3) T0XlC.rule
(4) dive.rule
(99) YOLO...运行所有规则
输入您要运行的规则列表,以逗号分隔。要链式运行规则,请使用 + 符号。
例如,1+1 将链式运行 best64.rule 两次,1,2 将依次运行 best64.rule 和 d3ad0ne.rule。
请慎重选择:```
#### Extensive Pure_Hate Methodology Crack
Runs several attack methods provided by Martin Bos (formerly known as pure_hate):
* Brute Force Attack (7 characters)
* Dictionary Attack
* All wordlists in `hcatWordlists` with `best64.rule`
* `rockyou.txt` with `d3ad0ne.rule`
* `rockyou.txt` with `T0XlC.rule`
* Top Mask Attack (Target Time = 4 Hours)
* Fingerprint Attack
* Combinator Attack
* Hybrid Attack
* Extra - Just For Good Measure
- Runs a dictionary attack using `rockyou.txt` with chained `combinator.rule` and `InsidePro-PasswordsPro.rule` rules
#### Brute Force Attack
Brute forces all characters with the choice of a minimum and maximum password length.
#### Top Mask Attack
Uses StatsGen and MaskGen from PACK (https://thesprawl.org/projects/pack/) to perform a top mask attack using passwords already cracked for the current session.
Presents the user a choice of target cracking time to spend (default 4 hours).
#### Fingerprint Attack
https://hashcat.net/wiki/doku.php?id=fingerprint_attack
Runs a fingerprint attack using passwords already cracked for the current session.
#### Combinator Attack
https://hashcat.net/wiki/doku.php?id=combinator_attack
Runs a combinator attack using the "rockyou.txt" wordlist.
#### Hybrid Attack
https://hashcat.net/wiki/doku.php?id=hybrid_attack
* Runs several hybrid attacks using the "rockyou.txt" wordlists.
- Hybrid Wordlist + Mask - ?s?d wordlists/rockyou.txt ?1?1
- Hybrid Wordlist + Mask - ?s?d wordlists/rockyou.txt ?1?1?1
- Hybrid Wordlist + Mask - ?s?d wordlists/rockyou.txt ?1?1?1?1
- Hybrid Mask + Wordlist - ?s?d ?1?1 wordlists/rockyou.txt
- Hybrid Mask + Wordlist - ?s?d ?1?1?1 wordlists/rockyou.txt
- Hybrid Mask + Wordlist - ?s?d ?1?1?1?1 wordlists/rockyou.txt
#### Pathwell Top 100 Mask Brute Force Crack
Runs a brute force attack using the top 100 masks from KoreLogic:
https://blog.korelogic.com/blog/2014/04/04/pathwell_topologies
#### PRINCE Attack
https://hashcat.net/events/p14-trondheim/prince-attack.pdf
Runs a PRINCE attack using wordlists/rockyou.txt
#### YOLO Combinator Attack
Runs a continuous combinator attack using random wordlists from the configured wordlists directory for the left and right sides.
#### Middle Combinator Attack
https://jeffh.net/2018/04/26/combinator_methods/
Runs a modified combinator attack adding a middle character mask:
wordlists/rockyou.txt + masks + worklists/rockyou.txt
Where the masks are some of the most commonly used separator characters:
2 4 <space> - _ , + . &
#### Thorough Combinator Attack
https://jeffh.net/2018/04/26/combinator_methods/
* Runs many rounds of different combinator attacks with the rockyou list.
- Standard Combinator attack: rockyou.txt + rockyou.txt
- Middle Combinator attack: rockyou.txt + ?n + rockyou.txt
- Middle Combinator attack: rockyou.txt + ?s + rockyou.txt
- End Combinator attack: rockyou.txt + rockyou.txt + ?n
- End Combinator attack: rockyou.txt + rockyou.txt + ?s
- Hybrid middle/end attack: rockyou.txt + ?n + rockyou.txt + ?n
- Hybrid middle/end attack: rockyou.txt + ?s + rockyou.txt + ?s
#### Bandrel Methodology
Prompts for comma-separated names and creates a pseudo hybrid attack by capitalizing the first letter and adding up to six additional characters at the end. Each word is limited to a total of five minutes.
- Built-in common words (seasons, months) included as a customizable `config.json` entry (`bandrel_common_basedwords`)
- The default five-minute time limit is customizable via `bandrelmaxruntime` in `config.json`
#### Loopback Attack
https://hashcat.net/wiki/doku.php?id=loopback_attack
Uses hashcat's loopback mode to feed cracked passwords from the current session back into the attack pipeline with rules applied. This generates new password candidates based on variations of already-cracked passwords, which is particularly effective for finding related passwords that follow similar patterns.
* Prompts for rule selection to apply to the loopback candidates
* Uses an empty wordlist with the --loopback flag to process previously cracked passwords
* Automatically downloads Hashmob rules if no rules are available locally
#### LLM Attack
Uses a local Ollama instance to generate password candidates for a capture-the-flag scenario. Prompts for the fake company name, industry, and location, then sends these details to the configured LLM model to produce likely password candidates using industry terms and company name permutations. The generated candidates are fed into a hashcat wordlist+rules attack.
* Requires a running Ollama instance (default: `http://localhost:11434`, override with `OLLAMA_HOST` in `.env` or the environment) with the model already pulled — hate_crack does not auto-pull
* Candidate generation uses structured (JSON) output via Atomic Agents, so pick a model with good schema adherence (default: `qwen2.5:32b`)
* Configurable model, context window, request timeout, and sample size via `.env` (see Ollama Configuration below)
* Prompts for target company name, industry, and location. The industry and location prompts are pre-filled with the local model's guesses about the named organization (editable, and clearly labelled as guesses rather than verified OSINT); disable with `ollamaAutoResearch: false`
* Alternatively derives basewords from a sample **wordlist**, or from the **cracked passwords** of the current session (`<hashfile>.out`) so the model mirrors the target organization's own password conventions and produces new candidates in that style (only offered once something has been cracked)
* A live spinner with an elapsed-seconds counter runs during generation, and requests are bounded by `ollamaTimeout` so a model stuck loading into VRAM reports a timeout instead of hanging
**Pattern rules mode** (option 4 in the LLM submenu) takes the same shape as the [Spoonman Attack](#spoonman-attack) — a baseword list run through a rule file, both derived from one corpus — but infers each side with the model instead of extracting it. Spoonman is exact and therefore bounded: its basewords all appear in the corpus and its rules only reproduce transformations the corpus already shows. This asks the model to generalize on both axes, so it can name the *word families* behind a sample (the company and its products, site names, local sports teams, seasons, mascots) and write decorations the corpus does not contain.
* Pattern source is either the current session's cracked passwords (offered first, and only once something has been cracked, since those reveal the target's real conventions) or a sample wordlist
* **You are not asked to pick a rule file.** The model writes one, from the same corpus statistics — a stock rule file encodes the internet's habits, and the point of spending a model round trip is to encode *this* organization's
* Basewords are normalized to lowercase letters only, discarding anything under 3 characters, so the generated rules supply case, digits, and punctuation exactly once
* Generated rules are validated before hashcat sees them, and anything using an op hashcat does not have, a position argument outside `0-9A-Z`, more than 31 functions, or a stray comment or non-ASCII character is discarded. hashcat drops an invalid rule *silently* when valid rules share the file, so an unscreened line would become missing coverage rather than an error. The op table was established by testing hashcat itself, not from its rule documentation, which lists ops hashcat will not actually run
* Local-model yield varies a lot run to run, so a thin answer is asked again once and the two rounds are merged — a handful of rules would waste the pass they are spent on
* If no rule survives validation the basewords still run, unmutated, rather than throwing away the expensive half of the run
* Output lands in `<hashfile>.llm_patterns/` as `basewords.txt` and `rules.rule` — per-run scratch, laid out like `.spoonman/` and removed on exit
#### OMEN Attack
Uses the Ordered Markov ENumerator (OMEN) to train a statistical password model from a wordlist and generate password candidates. This attack learns patterns from known passwords and generates new candidates based on those patterns.
* Requires OMEN binaries (createNG and enumNG) to be built from the omen submodule
* Interactive menu: use existing model, train new model, or cancel
* Training wordlist picker shows available wordlists from configured directory or accepts a custom path
* Validates all 5 required model files (createConfig, CP/IP/EP/LN.level) before running
* Captures and reports enumNG errors instead of failing silently
* Generates up to a specified number of password candidates (configurable via `omenMaxCandidates`)
* Pipes generated candidates directly into hashcat for cracking
* Model files and metadata are stored in `~/.hate_crack/omen/` for persistence across sessions
#### Combinator Attacks Submenu
Opens an interactive submenu with six combinator attack variants (formerly at menu keys 10-12). Consolidates related attacks for cleaner menu organization:
- Combinator Attack - combines two wordlists
- YOLO Combinator Attack - combines all permutations of multiple wordlists
- Middle Combinator Attack - combines wordlists with an extra word in the middle
- Thorough Combinator Attack - comprehensive combination of wordlists with rules
- Combinator3 Attack - combines exactly 3 wordlists using `combinator3.bin`, generating all `word1+word2+word3` combinations piped to hashcat
- CombinatorX Attack - combines 2-8 wordlists using `combinatorX.bin` with optional `--sepFill` separator character between word segments
#### Ad-hoc Mask Attack
Runs hashcat mask attack (mode 3) with a user-specified custom mask string. Allows fine-grained control over character-set brute forcing.
* Opens with a choice between typing a mask and selecting a mask file
* Prompts for a hashcat mask (e.g., `?u?l?l?l?d?d` for uppercase + lowercase + lowercase + lowercase + digit + digit)
* Supports custom character sets (`-1`, `-2`, `-3`, `-4`) for specialized character combinations
* Interactive charset entry with early exit on blank input
* Mask files (`.hcmask`) can be selected with tab completion, defaulting to the bundled `masks/` directory; hashcat runs every mask in the file in order. Because a mask file defines its own charsets inline, the `-1` through `-4` prompts are skipped when one is chosen
* Useful for targeted brute forcing when you know password structure patterns
#### Markov Brute Force Attack
Generates password candidates using Markov chain statistical models. Similar to OMEN but simpler and faster.
* Checks for existing `.hcstat2` Markov table from previous sessions (with option to reuse, regenerate, or cancel)
* Generates table from training source if needed:
- Can use cracked passwords from current session (`.out` file) as training data
- Or select any wordlist from configured directory or custom path
* Interactive menu: choose minimum and maximum password length
* Uses `--increment` flag to test lengths in sequence
* Markov table persists with hash file (filename.out.hcstat2) for fast subsequent runs
* Faster than OMEN for general-purpose brute forcing
#### N-gram Attack
Generates n-gram candidates from a corpus file using `ngramX.bin` from hashcat-utils and pipes them into hashcat.
* Prompts for a corpus file with tab completion, defaulting to the configured wordlist directory
* Prompts for an n-gram group size (default 3)
* Gzip-compressed corpus files are auto-detected and decompressed on the fly
* Useful when you have target-relevant prose (scraped site copy, leaked documents, internal wiki exports) rather than a password list
#### Permutation Attack
Generates all character permutations of each word in a targeted wordlist and pipes them to hashcat via `permute.bin` from hashcat-utils.
* Prompts for a single wordlist file (not a directory)
* Effective against short targeted wordlists where the character set is known but the order is not (company abbreviations, name fragments, known tokens)
* WARNING: Scales as N! per word - an 8-character word produces 40,320 permutations. Only practical for words up to ~8 characters.
* Uses `permute.bin < wordlist | hashcat` pipeline pattern
#### Random Rules Attack
Generates a set of random hashcat mutation rules using `generate-rules.bin`, writes them to a temporary file, then runs hashcat against a chosen wordlist with those rules.
* Prompts for rule count (default 65536)
* Prompts for wordlist path with tab-completion and numbered selection
* Temporary rules file is cleaned up after the run regardless of outcome
* Useful when known rule sets are exhausted - explores random rule-space for additional cracks
#### Combipow Passphrase Attack
Generates all unique non-empty subset combinations from a short wordlist using `combipow.bin` and pipes them into hashcat. Designed for passphrase cracking when you know the pool of words a password was built from.
* Prompts for a wordlist file (max 63 lines - combipow generates up to 2^n-1 combinations)
* Optional space separator (`-s` flag) to insert spaces between words in each combination
* Warns if the wordlist exceeds 20 lines (output volume may be large)
* Aborts with a clear message if the wordlist exceeds 63 lines (hard limit)
* Candidates are piped directly to hashcat stdin
#### PCFG Attack
Uses [pcfg_cracker](https://github.com/lakiw/pcfg_cracker) to generate candidates from a Probabilistic Context-Free Grammar, piping `pcfg_guesser.py` output directly into hashcat's stdin mode. A PCFG models password *structure* (baseword + digits + symbol, capitalization habits, keyboard walks) with learned probabilities, so candidates come out roughly in descending likelihood order.
* Requires the `pcfg_cracker` submodule. Presence is checked at startup and reported non-fatally: if it is missing, the PCFG attacks are simply unavailable. Run `make` to fetch it.
* Uses the trained grammar named by `pcfgRuleset` in `config.json` (default `DEFAULT`), read from `pcfg_cracker/Rules/<name>/`
* Candidate count is capped by `pcfgMaxCandidates` (default 50,000,000)
* hate_crack does not wrap grammar training. To build a grammar from a target-specific password set, run pcfg_cracker's own `trainer.py` and point `pcfgRuleset` at the resulting ruleset name
#### PRINCE-LING Attack
Uses pcfg_cracker's `prince_ling.py` to derive an optimized PRINCE base wordlist from a trained grammar, then hands it to the existing PRINCE attack. PRINCE-LING picks base words the grammar says are actually productive, so the PRINCE combination space is far less wasteful than pointing PRINCE at a generic wordlist.
* Requires the `pcfg_cracker` submodule and a trained ruleset directory, same as the PCFG attack
* The generated wordlist is cached at `<hcatOptimizedWordlists>/pcfg_prince_ling_<ruleset>.txt` and reused across sessions
* Regenerates only when the ruleset directory is newer than the cached wordlist, so retraining a grammar invalidates the cache automatically
* Generation is written to a temporary file and atomically moved into place; a failed or interrupted run cleans up its partial file and leaves any existing cache intact
* Base wordlist size is capped by `pcfgPrinceLingMaxCandidates` (default 10,000,000)
#### Spoonman Attack
Derives a baseword list and a hashcat rule file from a corpus of known plaintext passwords — a previous engagement's cracked output, a leak dump, or any password list — such that the baseword x rule cross product reconstructs the corpus exactly (see the memory bound below for the one case where it does not). Contributed as issue #169 by @Spoonman1091.
Each password is split into its letters-only lowercased core (the baseword) plus a rule that rebuilds the original from it, using `l`/`u`/`c` for casing, `T{p}` toggles, `${x}`/`^{x}` for trailing and leading characters, and `i{p}{x}` for interior ones.
* When the current session already has cracked plaintexts (`<hash file>.out` exists and is non-empty), a picker offers those as the corpus ahead of a free-form path — the target's own recovered passwords derive rules describing that target's actual conventions, which is exactly what you want to fire back at the remaining uncracked hashes. Deriving from `.out` and then cracking the same hash file appends new plaintexts to that same file, growing the corpus for the next run; that is the intended feedback loop, not corruption. Sessions with no cracked output yet see no picker at all — just today's path prompt
* Prompts for the corpus, then for how much of the rule file to run: top 50% coverage (listed first and recommended), top 75%, top 95%, top 99%, or the full set
* Rules are sorted by how many passwords each one rebuilds, so a truncated file keeps the most productive rules. Coverage is extremely long-tailed: on a 98.2M-password sample, 50% coverage needed 4,120 rules while 95% needed 16,119,661 and 100% needed 21,029,696 — the last few percent typically costs orders of magnitude more rules than the first half, which is why the smallest tier is listed first and is usually the right choice
* Output is written beside the hash file in `<hash file>.spoonman/`, alongside the other ephemeral wordlists: `basewords.txt`, `rules.full.rule`, the capped rule files, and `coverage.txt` with per-milestone rule counts. Derivation is skipped on later runs of the same hash file unless the corpus has been modified since, and the directory is removed on exit by the temp-file cleanup
* Derivation is bounded in memory. Both counters would otherwise grow for the whole read with nothing written until the end, so a corpus large enough to exhaust RAM lost the entire pass to an OOM kill and produced no output; a measured run against a 31 GB corpus reached 14.1 GB resident at 11% of the file and was still accelerating. Each counter is now capped at 20 million distinct keys (about 1.6 GB apiece), and the lowest-frequency keys are discarded once it is exceeded. If that happens, the run says so on the console and in `coverage.txt`, the output reconstructs the retained keys rather than 100% of the corpus, and the coverage percentages are relative to those. Corpora below the cap are unaffected
* Passwords that cannot be expressed as a rule are written verbatim as their own baseword with a `:` no-op, so coverage stays complete. This covers two hashcat limits: rule positions cannot address past index 35, and hashcat rejects any rule with more than 31 functions — silently, when valid rules share the file
* The derivation self-checks every password by reconstructing it in-process, and reports any failures rather than reporting success
* Corpus lines may carry a hash in front of the password, as cracked output does. A leading field is dropped only when it has the shape of a hash (a hex digest at a known length, or a crypt-style `$id$` string), so `hash:salt:plain` is handled while a plaintext or wordlist entry containing a colon survives intact. `$HEX[...]` plaintexts are decoded. If most lines look like an uncracked dump rather than cracked output, `coverage.txt` records the count and the attack warns — the derived basewords and rules would otherwise be meaningless without any error being raised
#### Rosetta Attack
Mines hashcat `--debug-mode 5` logs for the basewords and rules that already cracked something, then runs their full cross product. Powered by [HashcatRosetta](https://github.com/bandrel/HashcatRosetta), the same library behind [Analyze Hashcat Rules](#analyze-hashcat-rules-rule-file-tools-option-5).
No setup is needed to feed it: `_add_debug_mode_for_rules` appends `--debug-mode 5 --debug-file` to every rule-based hashcat invocation hate_crack makes, so the logs accumulate in `hcatDebugLogPath` (`~/.hate_crack/hashcat_debug` by default, one file per session) as a side effect of normal use. A mode 5 log records only candidates that cracked a hash, in the form `baseword:rule:candidate:wordlist`, which is what makes both halves known-productive against this target population; the trailing wordlist field also shows which list is earning its keep on a multi-wordlist run. HashcatRosetta parses mode 4 and mode 5 alike, so logs written before the switch are still read.
The value is in the cross product rather than the recorded pairs. A pair present in a log has already cracked its hash and will not crack another, but a rule that worked on one baseword has usually never been tried against the others — so N basewords and M rules yield close to N x M untried candidates.
The menu first asks how to rank rules — choices 1-3 below, plus a fourth, unrelated mode:
* Rules can be ranked by application frequency, by how many distinct basewords each one worked on, or by how many unique candidates each one generated. Frequency is the default; baseword spread is the better choice when the goal is a rule set that generalizes past the specific words it was learned from
* Only after one of those three is picked does hate_crack list the logs found in `hcatDebugLogPath` newest-first with their sizes; pick one, pick all of them (up to 20), or type a path to a log from elsewhere
* Prompts for how many top rules to keep (default 100) and how many top basewords (default all). Zero means unlimited for either. The keyspace is the product of the two and is printed before hashcat starts
* Output is written beside the hash file in `<hash file>.rosetta/` as `basewords.txt` and `rules.rule`, alongside the other ephemeral wordlists, and the directory is removed on exit by the temp-file cleanup
* Reading stops at 1,000,000 debug lines, since the analyzer needs the whole batch in memory at once. Truncation is reported on the console rather than assumed harmless — logs from a long run routinely exceed this, in which case the newest log is the one worth selecting
* **LLM Mask Attack** (4) - a different mode entirely, and the only one that needs no debug logs. Prompts for a natural-language description of the passwords you expect (length, character patterns, symbols, etc.), sends it to the locally configured Ollama model, writes the returned masks to `<hash file>.hcmask`, and runs a `-a 3` hashcat mask attack against them
#### Wordlist Tools (option 80)
A submenu of wordlist preprocessing utilities using hashcat-utils binaries. All tools read from and write to files on disk. All file and directory path prompts support tab completion.
| Key | Tool | Description |
|-----|------|-------------|
| 1 | Filter by Length | Keep only words between a min and max length (`len.bin`) |
| 2 | Require Char Classes | Keep words that include all char classes in mask (`req-include.bin`). Mask: 1=lower, 2=upper, 4=digit, 8=symbol (additive) |
| 3 | Exclude Char Classes | Remove words containing any char class in mask (`req-exclude.bin`). Same mask encoding |
| 4 | Extract Substring | Cut bytes from each word at a given offset and optional length (`cutb.bin`) |
| 5 | Split by Length | Create per-length files in an output directory (`splitlen.bin`) |
| 6 | Subtract Wordlist | Remove lines from a wordlist that appear in one or more remove files. Mode 1 uses `rli2.bin` (single file); mode 2 uses `rli.bin` (multiple files) |
| 7 | Shard Wordlist | Split a wordlist into N equal, interleaved parts in one run, written as `base.001`…`base.00N` for distributed cracking (`gate.bin`) |
| 8 | Optimize Wordlists | Dedupe and split the selected wordlists into per-length files under an output directory |
| 9 | Download from Hashmob.net | Browse and download wordlists from Hashmob.net into the configured wordlist directory |
| 10 | Download from Weakpass | Browse and download Weakpass wordlist torrents, with automatic extraction |
All binaries are in `hate_crack/hashcat-utils/bin/`.
#### Rule File Tools (option 81)
Preprocesses hashcat rule files using `cleanup-rules.bin` and `rules_optimize.bin` from hashcat-utils, and downloads rule files from Hashmob.net.
* **Clean** (1) - removes invalid syntax and duplicate rules using `cleanup-rules.bin`. Useful after combining rule files or downloading rules from external sources.
* **Optimize** (2) - consolidates redundant operations using `rules_optimize.bin`. Reduces rule file size and improves cracking speed.
* **Clean and optimize** (3) - runs both operations in sequence via a temporary file, then writes the final result.
* **Download rules from Hashmob.net** (4) - fetches rule files into the configured `rulesDirectory`.
* **Analyze Hashcat rules** (5) - opcode frequency analysis of a rule file, powered by HashcatRosetta.
The three preprocessing operations read from an input file and write to a separate output file (original is never modified).
#### Download Rules from Hashmob.net (Rule File Tools option 4)
Downloads the latest rule files from Hashmob.net's rule repository. These rules are curated and optimized for password cracking and can be used with the Quick Crack and Loopback Attack modes.
* Downloads rule sets in parallel using a thread pool (up to 4 concurrent downloads)
* Skips rules already downloaded locally
* Reports download summary with success/failure counts
* Stores rules in the configured rules directory
#### Analyze Hashcat Rules (Rule File Tools option 5)
Powered by HashcatRosetta (https://github.com/bandrel/HashcatRosetta), this feature analyzes hashcat rule files to provide detailed insights into rule composition and complexity.
* Prompts for a rule file path
* Displays frequency analysis of rule opcodes (operations)
* Helps understand what transformations a rule set performs
* Useful for rule debugging and optimization
#### Download Wordlists from Hashmob.net (Wordlist Tools option 9)
Downloads wordlists from Hashmob.net's collection of cracked passwords and commonly used wordlists.
* Interactive menu for browsing available wordlists
* Progress tracking for large downloads
* Stores wordlists in configured wordlist directory
#### Weakpass Wordlist Menu (Wordlist Tools option 10)
Interactive menu for downloading and managing wordlists from Weakpass.com via BitTorrent.
* Browse available Weakpass wordlist torrents
* Download specific wordlists or entire collections
* Automatic extraction of compressed archives
* Progress tracking for torrent downloads
-------------------------------------------------------------------
### Version History
The full, per-release changelog now lives in [CHANGELOG.md](https://github.com/trustedsec/hate_crack/blob/HEAD/CHANGELOG.md).