awillard1/listminer
GitHub: awillard1/listminer
从密码数据中自动提取模式,为 Hashcat 和 John the Ripper 生成优化破解规则的 Python 工具。
Stars: 1 | Forks: 0
# ListMiner — PasswordRuleMiner — 密码工件生成器
**版本:** 2026(增强版,包含高级规则生成 + John the Ripper 支持)
## 概述
`PasswordRuleMiner`(也称为 **ListMiner**)是一个基于 Python 的工具,旨在从现有的密码数据集中生成 **Hashcat 和 John the Ripper (JtR) 规则、掩码以及基于用户名的密码工件**。
**主要特性:**
* 处理单个或多个 potfile 和 hash 文件(支持目录递归)
* **新特性:** 使用 `--rules` 选项为 Hashcat 和 John the Ripper **生成规则**
* 基于真实用户名生成前插和后补规则
* 从各种哈希格式(包括 DOMAIN\USER、NTLM、SHA 和 Kerberos)中提取健壮的用户名
* 生成掩码以及年/季节规则以加快破解速度
* 输出统计信息、基础词典和多个预评分的规则文件
* **新特性:** 使用 `concurrent.futures` 进行**并行处理**,加速规则生成
* **新特性:** 针对字符替换攻击的 **Leet-speak 变异规则**(a→@、e→3、s→$ 等)
* **新特性:** 基于 BFS 的复杂规则生成,用于多步转换覆盖
* **新特性:** 基于 Trie 的基础分析,用于增强密码模式提取
* **新特性:** 基于编辑距离的评分,用于计算最优转换开销
* **新特性:** 高级 Hashcat 操作,包括指定位置切换 (T)、按位移 (L/R)、交换、插入
* **新特性:** 自定义词典集成,支持可选的拼写检查 (`pyenchant`)
* **新特性:** 统计分析和规则有效性跟踪
* **新特性:** 高级操作 —— 多字符交换、数字序列、前插/后补组合
* **新特性:** 详细调试模式,提供详细的执行日志
* 提供详细的进度更新,包含 `tqdm` 进度条和线程安全的日志
## 安装说明
需要 Python 3.8+ 以及用于增强功能的可选依赖项。
### 基础安装
```
pip install tqdm
```
### 可选:拼写检查支持
用于通过拼写检查增强词典生成:
```
pip install pyenchant
```
将 `listminer.py` 保存到您的工作目录。
## 运行说明
### 命令行选项
```
usage: listminer.py [-h] -p POT [POT ...] [-hf [HASHFILE ...]] [-o OUTPUT]
[--no-cache] [--clear-cache] [--max-workers MAX_WORKERS]
[-w [WORDLIST ...]] [-v] [--rules {hashcat,john,both}]
PasswordRuleMiner — Artifact Generator with Advanced Features
options:
-h, --help show this help message and exit
-p POT, --pot POT Potfile(s) or directory of potfiles (required)
-hf HASHFILE, --hashfile HASHFILE
Hashfile(s) or directory of hash files
-o OUTPUT, --output OUTPUT
Output directory (default: listminer)
--no-cache Disable caching of processed files
--clear-cache Clear cache and exit
--max-workers MAX_WORKERS
Maximum number of parallel workers (default: min(8, CPU count))
-w WORDLIST, --wordlist WORDLIST
Custom wordlist file(s) for enhanced base generation
-v, --verbose Enable verbose/debug mode with detailed logging
--rules {hashcat,john,both}
Output rule format: 'hashcat' (default), 'john' (John the Ripper), or 'both'
```
示例:
```
python3 listminer.py -p /mnt/c/PenTesting/data/potfiles/ -hf /mnt/c/PenTesting/data/hashes/ -o /mnt/c/PenTesting/password-cracking/listminer/2026-01/ -v --rules hashcat --max-workers 12
```
### 缓存更新
## ListMiner 现在包含智能文件缓存功能,以提高重复执行时的效率。缓存通过跳过未更改的文件来加速后续任务。
其他功能和示例与文档中详述的包括新增强密钥的内容保持一致。
标签:Bitdefender, DOS头擦除, Hashcat, John the Ripper, Leet Speak变异, Levenshtein距离, Potfile分析, Python安全工具, Trie树算法, 代码示例, 凭据转储分析, 域名侦查, 密码安全, 密码破解, 密码规则生成, 掩码生成, 数据分析, 模式提取, 离线破解攻击, 网络安全, 逆向工具, 隐私保护