retgere5/BruteForceHelper
GitHub: retgere5/BruteForceHelper
一套用于密码组合生成与字典优化过滤的Python安全工具集,帮助安全研究者在授权测试中高效准备和精简密码字典。
Stars: 1 | Forks: 0
# 🛠️ BruteForce Helper 工具


一套用于密码分析和字典优化的强大工具集。_仅供学习参考。_
## 📋 目录
* [功能](#-features)
* [安装说明](#-installation)
* [工具](#-tools)
* [PassGenerator](#-passgenerator)
* [WordlistOptimizer](#-wordlistoptimizer)
* [使用示例](#-usage-examples)
* [免责声明](#-disclaimer)
* [许可证](#-license)
## ✨ 功能
### 🔐 PassGenerator
* ⚡ 高速组合生成
* 📊 实时进度跟踪及彩色输出
* 💾 高效的内存管理
* 🔄 大小写修饰符:
* `-AB`: 转换为大写 (test -> TEST)
* `-Ab`: 首字母大写 (test -> Test)
* `-ba`: 文本反转 (test -> tset)
* `-Ba`: 反转并首字母大写 (test -> Tset)
* `-BA`: 反转并大写 (test -> TSET)
* 🔢 长度控制:
* `-m`: 最小长度
* `-M`: 最大长度
* 🎯 词边界:
* `-ws`: 添加前缀
* `-we`: 添加后缀
* 🔠 Leet speak 转换 (`-L337`)
* 🗜️ 可选的 gzip 压缩输出 (`-z`)
* ⚙️ JSON 配置文件 (`-c`)
* 🧮 内存控制:`--limit`, `--max-memory`, `--no-dedup`, `--disk-dedup`
* 🔄 支持断点续传 (`--resume`)
* 🎨 彩色交互式 UI
* 🚫 防重复机制
* 📝 支持 UTF-8 编码
### 🔍 WordlistOptimizer
* 🎯 多种过滤选项
* 🔬 字典分析模式 (`--analyze`)
* ⚙️ 非交互式配置模式 (`--config`)
* 🗜️ 透明的 gzip 输入/输出 (`.gz`)
* 📈 实时统计
* ⏸️ 检查点系统
* 💪 多进程支持
* 🧠 智能过滤推荐
* 📊 详细的进度跟踪
* 🌈 彩色交互式 UI
* 🌍 多语言支持 (英语/土耳其语)
* 💡 基于字典大小的智能过滤建议
* 🔄 会话保存与加载
* 📊 高级统计与报告
* ⚡ 性能优化
## 🚀 安装说明
```
# Clone 仓库
git clone https://github.com/retgere5/BruteForceHelper.git
# 导航到目录
cd BruteForceHelper
# 安装所需包
pip install -r requirements.txt
```
### 🧪 运行测试
```
# 安装开发依赖(添加 pytest)
pip install -r requirements-dev.txt
# 运行测试套件
pytest
```
## 🛠️ 工具
### 🔑 PassGenerator
利用高级功能生成所有可能的密码组合。
```
python PassGenerator.py -w [words/chars] [options]
```
#### 选项:
* `-w, --words`: 用于生成组合的单词或字符(必填)
* `-o, --output`: 输出文件名(默认:combinations.txt)
* `-m, --min-length`: 最小组合长度(默认:1)
* `-M, --max-length`: 最大组合长度
* `-AB`: 转换为大写
* `-Ab`: 首字母大写
* `-ba`: 文本反转
* `-Ba`: 反转并首字母大写
* `-BA`: 反转并大写
* `-L337`: 转换为 leet speak
* `-ws, --word-start`: 添加前缀
* `-we, --word-end`: 添加后缀
* `-z, --gzip`: 输出 gzip 压缩文件 (`.gz`)
* `-c, --config`: 从 JSON 配置文件加载选项(命令行参数可覆盖)
* `--limit`: 生成指定数量的唯一组合后停止
* `--max-memory`: 当内存去重集合超过指定大小时停止
* `--no-dedup`: 跳过去重(常量内存;输出可能包含重复项)
* `--resume`: 记录检查点,以便在中断时可以恢复运行
* `--disk-dedup`: 通过 SQLite 在磁盘上进行去重(限制内存,速度较慢)
#### 示例:
```
# 带大小写修饰符的基本用法
python PassGenerator.py -w test -AB -Ab
# 输出: test, TEST, Test
# 带长度控制
python PassGenerator.py -w a b c -m 2 -M 4
# 输出: aa, aaa, aaaa, ab, aba, ...
# 带单词边界
python PassGenerator.py -w test -ws admin_ -we _2023
# 输出: admin_test_2023
# 复杂组合
python PassGenerator.py -w test user -m 4 -M 8 -AB -L337
# 输出: test, TEST, T3ST, user, USER, U53R, testuser, ...
# 多项功能
python PassGenerator.py -w retgere 5 Prophet -m 6 -M 12 -AB -ba -Ab -Ba
# 输出: retgere, RETGERE, eregter, Retgere, retgere5, Prophet, ...
# 限制唯一组合的数量
python PassGenerator.py -w a b c --limit 1000
# 限制 dedup set 使用的内存(达到时停止生成)
python PassGenerator.py -w a b c d e f --max-memory 512
# 不进行 deduplication 的流式输出(恒定内存,可能出现重复行)
python PassGenerator.py -w a b c --no-dedup
# 可恢复运行:如果中断(Ctrl+C),重新运行相同命令以继续
python PassGenerator.py -w a b c d --resume -o big.txt
# 对于 RAM 来说过大的集合在磁盘上进行 Deduplicate(内存受限,速度较慢)
python PassGenerator.py -w a b c d e --disk-dedup
# 压缩输出 (.gz)
python PassGenerator.py -w test -AB -z -o wordlist.txt
# 写入 wordlist.txt.gz
# 从 JSON config 文件(CLI 参数仍会覆盖单个值)
python PassGenerator.py -c config.json
```
PassGenerator 的 `config.json` 示例:
```
{
"words": ["test", "admin"],
"min_length": 4,
"max_length": 12,
"AB": true,
"L337": true,
"output": "wordlist.txt",
"gzip": true
}
```
### 🔍 WordlistOptimizer
通过高级过滤选项清理并优化您的字典。
```
# 交互式
python WordlistFixer.py
# 非交互式,从 JSON config
python WordlistFixer.py --config config.json --lang en
# 分析 wordlist(长度分布、字符组成)
python WordlistFixer.py --analyze rockyou.txt --lang en
```
WordlistOptimizer 的 `config.json` 示例(缺失的过滤键默认关闭;`input` 为必填):
```
{
"input": "rockyou.txt",
"output": "cleaned.txt.gz",
"min_length_filter": true,
"repetitive_chars": true,
"keep_stats": true
}
```
#### 交互式设置:
1. 🌍 选择您的语言(英语/土耳其语)
2. 📁 选择输入/输出文件(使用 `.gz` 名称进行 gzip 压缩的输入或输出)
3. ⚙️ 选择过滤选项:
* 长度过滤器
* 模式过滤器
* 字符类型过滤器
* 常用词过滤器
4. 🎯 配置优化设置
5. 📊 查看实时统计信息和过滤效果
#### 过滤器组:
* **基础安全**
* 最小长度过滤器
* 重复字符过滤器
* 模式重复过滤器
* **基于字符**
* 仅数字过滤器
* 仅字母过滤器
* 单一字符类型过滤器
* **基于模式**
* 连续字符过滤器
* 键盘模式过滤器
* 特殊模式过滤器
* **基于格式**
* 年份模式过滤器
* 日期模式过滤器
* 电话号码过滤器
* **基于单词**
* 常用词过滤器
* Leet speak 过滤器
## 💡 使用示例
## ⚠️ 免责声明
此工具**仅供学习参考**。用户需自行确保在使用此工具测试任何系统时已获得许可。对于因使用本程序而造成的任何误用或损害,创作者概不负责。
## 📝 许可证
本项目基于 MIT 许可证授权 - 详情请参阅 [LICENSE](LICENSE) 文件。
由 retgere5 用 ❤️ 制作
点击展开使用示例
### PassGenerator ``` # 生成数字 0-9 的所有组合 python PassGenerator.py -w 0 1 2 3 4 5 6 7 8 9 -m 4 # 生成特殊字符的组合 python PassGenerator.py -w "@" "#" "$" "%" -o special_chars.txt ``` ### WordlistOptimizer * 移除常见模式 * 按长度过滤 * 移除连续字符 * 剔除键盘模式 * 移除单一字符类型 * 特定语言的过滤 * 基于字典大小的智能推荐 * 实时过滤效果跟踪标签:Python, 安全规则引擎, 密码分析, 密码字典, 无后门, 逆向工具