hyperpolymath/dicti0nary-attack
GitHub: hyperpolymath/dicti0nary-attack
一款用于授权安全测试的密码生成与哈希破解研究工具,专注于测试用户自认为「安全」的非传统字典密码变体。
Stars: 2 | Forks: 1
// SPDX-License-Identifier: MPL-2.0
// 版权所有 (c) Jonathan D.A. Jewell
= 🔐 dicti0nary-attack
image:https://img.shields.io/badge/OpenSSF-Best_Practices-green?logo=openssourcesecurity[OpenSSF Best Practices,link="https://www.bestpractices.dev/en/projects/new?repo_url=https://github.com/hyperpolymath/dicti0nary-attack"]
image:https://img.shields.io/badge/License-MPL_2.0--1.0-blue.svg[License: MPL-2.0,link="https://github.com/hyperpolymath/palimpsest-license"]
大家都知道,如果一个密码出现在字典里,它是很容易被破解的。_dicti0nary-attack_ 对这一概念进行了幽默的反转——它是一个用于生成和测试**不在**传统字典中的密码的强大工具,重点关注那些用户自认为能让密码“安全”的创意变体。
image:https://img.shields.io/badge/License-MPL_2.0--1.0-blue.svg[License: MPL-2.0,link="https://github.com/hyperpolymath/palimpsest-license"]
link:https://img.shields.io/badge/Chapel-2.3+-purple.svg[![Chapel]](https://chapel-lang.org/)
link:https://img.shields.io/badge/Rust-2021-orange.svg[![Rust]](https://www.rust-lang.org/)
link:https://img.shields.io/badge/ReScript-11+-red.svg[![ReScript]](https://rescript-lang.org/)
link:https://img.shields.io/badge/RSR-Bronze%20(86%25[![RSR Compliance]-yellow.svg)](RSR_COMPLIANCE.md)
link:https://img.shields.io/badge/offline--first-100%25-green.svg[![Offline-First]](RSR_COMPLIANCE.md#5-offline-first--compliant)
== ⚠️ 法律声明
_本工具仅供授权的安全测试使用。_
授权使用范围包括:
- ✅ 获得明确书面许可的渗透测试
- ✅ 对您拥有的系统进行安全审计
- ✅ CTF (夺旗赛) 竞赛
- ✅ 学术研究与教育
- ✅ 对您自己的数据进行密码强度分析
未经授权访问计算机系统是_非法的_,可能会根据计算机欺诈和滥用法受到刑事起诉。
== ✨ 功能
=== 密码生成器
- _Leetspeak 生成器_:通过字符替换(a→4, e→3, o→0 等)来转换单词
- _语音生成器_:使用语音替换(for→4, to→2, you→u)
- _模式生成器_:创建基于模式的密码(键盘位移、序列、日期模式)
- _随机生成器_:生成真正的非字典随机密码
- _马尔可夫链生成器_:基于训练数据的统计密码生成
=== 哈希破解
- _多算法支持_:MD5, SHA1, SHA224, SHA256, SHA384, SHA512, BLAKE2b, BLAKE2s
- _并行处理_:支持多核以实现更快的破解
- _批量操作_:同时破解多个哈希
- _进度追踪_:实时统计和进度监控
=== 附加功能
- 🎨 _丰富的 CLI 界面_:带有进度条和表格的精美终端 UI
- 🌐 _Web 界面_:基于浏览器的 GUI,便于生成和破解密码
- 📊 _全面的统计数据_:详细的性能指标和报告
- 🔧 _灵活的配置_:YAML/JSON 配置文件
- 📝 _多种输出格式_:文本、JSON、CSV、HTML 报告
- 🐳 _Docker 支持_:容器化部署
- 🧪 _广泛的测试套件_:使用 pytest 实现高代码覆盖率
- ⚡ _性能基准测试_:内置基准测试工具
- 🏆 _兼容 RSR 框架_:青铜级(86% 兼容)
- 📴 _Offline-First_:核心功能无需互联网即可工作
- 🔒 _安全第一_:兼容 RFC 9116,全面的安全策略
== 📦 安装
=== 前置条件
* **Chapel** 2.3+ - https://chapel-lang.org/download.html[下载 Chapel]
* **Rust** 2021 edition - https://rustup.rs/[通过 rustup 安装]
* **Deno**(用于 Web 开发)- https://deno.land/[安装 Deno]
* **just** 任务运行器 - https://just.systems/[安装 just]
=== 从源码构建
## [source,bash]
git clone https://github.com/Hyperpolymath/dicti0nary-attack.git
cd dicti0nary-attack
# 初始化开发环境
just init
# 构建 Chapel + Rust CLI
just build
# 为 Web 界面构建 WASM
## just build-wasm
=== 使用 Podman/Docker
## [source,bash]
# 使用 Podman 构建(首选)
podman build -t dicti0nary-attack -f Containerfile .
podman run --rm dicti0nary-attack just info
# 或者使用 Docker
## docker build -t dicti0nary-attack .
docker run --rm dicti0nary-attack just info
=== 使用 Podman Compose
## [source,bash]
# 运行 CLI
podman-compose run dicti0nary-cli just info
# 运行 Web 界面(静态服务器)
## podman-compose up dicti0nary-static
== 🚀 快速开始
=== 生成密码
## [source,bash]
# 生成 1000 个 leetspeak 密码
dicti0nary generate -g leetspeak -n 1000
# 保存到文件
dicti0nary generate -g pattern -n 5000 -o passwords.txt
# 自定义长度限制
## dicti0nary generate -g random -n 100 --min-length 12 --max-length 20
=== 破解密码哈希
## [source,bash]
# 使用模式生成器破解 SHA256 哈希
dicti0nary crack 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8 -a sha256 -g pattern
# 使用并行处理
dicti0nary crack -a sha256 -g leetspeak -p --workers 8
# 使用自定义字典
## dicti0nary crack -a md5 -w wordlists/custom.txt
=== 创建字典
## [source,bash]
# 创建 leetspeak 字典
dicti0nary create-wordlist wordlists/leetspeak.txt -g leetspeak -n 50000
# 创建语音字典
## dicti0nary create-wordlist wordlists/phonetic.txt -g phonetic -n 10000
=== 对密码进行哈希处理
## [source,bash]
# 使用 SHA256 哈希
dicti0nary hash-password "mypassword"
# 使用 MD5 哈希
## dicti0nary hash-password "mypassword" -a md5
=== 运行 Web 界面
## [source,bash]
# 提供静态 Web 界面
just serve-static
# 或者使用 Deno
## deno task serve
在浏览器中访问 http://localhost:8080。
== 📚 文档
- link:docs/USAGE.md[使用指南] - 全面的使用说明
- link:docs/API.md[API 文档] - Python API 参考
- link:docs/PLUGINS.md[插件指南] - 插件开发指南
- link:config/README.md[配置指南] - 配置选项
- link:RSR_COMPLIANCE.md[RSR 合规性] - 标准合规报告
- link:SECURITY.md[安全策略] - 漏洞报告
- link:CONTRIBUTING.md[贡献指南] - 贡献准则
== 🎯 用例
=== 安全审计
测试用户是否在使用常见的非字典密码模式:
## [source,bash]
## dicti0nary create-wordlist audit.txt -g leetspeak -n 100000
dicti0nary crack -w audit.txt -a sha256
=== CTF 竞赛
快速测试常见模式:
## [source,bash]
## dicti0nary crack -a md5 -g pattern -p
=== 密码研究
生成用于密码强度分析的数据集:
## [source,bash]
## dicti0nary create-wordlist data/leetspeak.txt -g leetspeak -n 50000
dicti0nary create-wordlist data/phonetic.txt -g phonetic -n 50000
dicti0nary create-wordlist data/patterns.txt -g pattern -n 50000
== 🏗️ 架构
## [source,text]
## dicti0nary-attack/
├── src/ # 主源代码
│ ├── main.rs # Rust CLI 入口点
│ ├── dicti0nary.chpl # Chapel 主程序
│ ├── generators/ # Chapel 生成器模块
│ │ ├── Leetspeak.chpl # Leetspeak 转换
│ │ ├── Phonetic.chpl # 语音替换
│ │ ├── Pattern.chpl # 基于模式的生成
│ │ ├── Random.chpl # 随机生成
│ │ └── Markov.chpl # 马尔可夫链生成
│ └── crackers/ # 哈希破解引擎
│ └── HashCracker.chpl # 多算法破解器
├── crates/ # Rust workspace crates
│ ├── core/ # 类型定义与 traits
│ ├── generators/ # Rust 生成器实现
│ └── crackers/ # Rust 破解引擎
├── web/ # 静态 Web 界面
│ ├── index.html # 主 HTML
│ ├── src/ # ReScript 源代码
│ │ ├── App.res # 应用逻辑
│ │ ├── Generators.res # 密码生成器
│ │ ├── Hash.res # 哈希工具
│ │ └── WasmLoader.res # WASM 模块加载器
│ └── static/ # 静态资源
│ ├── css/ # CSS-first 样式
│ ├── js/ # 编译后的 ReScript 输出
│ └── wasm/ # Chapel 编译的 WASM
├── config/ # 配置文件
│ ├── dicti0nary.ncl # Nickel 配置
│ └── *.yaml # YAML 配置
├── tests/ # Chapel 测试套件
├── docs/ # 文档
├── wordlists/ # 示例字典
├── Justfile # 任务自动化
├── Cargo.toml # Rust workspace manifest
├── Chapel.toml # Chapel 配置
├── rescript.json # ReScript 配置
└── deno.json # Deno 配置
== 🔧 配置
创建一个配置文件 (`config.yaml`):
## [source,yaml]
generators:
leetspeak:
max_substitutions: 3
min_length: 6
max_length: 16
pattern:
min_length: 6
max_length: 16
cracker:
algorithm: sha256
workers: 8
batch_size: 5000
## 输出:
format: json
directory: output
save_stats: true
与命令一起使用:
## [source,bash]
## dicti0nary --config config.yaml generate -g leetspeak -n 1000
== 🧪 测试
运行测试套件:
## [source,bash]
# 运行 Chapel 测试
just test
# 运行覆盖率测试
just test-cov
# 运行 Rust 测试
cargo test
# 监视模式(需要 entr)
## just test-watch
== 📊 基准测试
运行性能基准测试:
## [source,bash]
# 运行 Chapel 基准测试
just bench
# 运行 Rust 基准测试
## cargo bench
== 🐳 容器使用
=== 构建镜像(首选 Podman)
## [source,bash]
# Podman(首选)
podman build -t dicti0nary-attack -f Containerfile .
# Docker
## docker build -t dicti0nary-attack .
=== 运行 CLI
## [source,bash]
## podman run --rm dicti0nary-attack just info
=== 行 Web 界面
## [source,bash]
## podman-compose up dicti0nary-static
访问 http://localhost:8080
== 🛠️ 开发
=== 配置开发环境
## [source,bash]
# 克隆仓库
git clone https://github.com/Hyperpolymath/dicti0nary-attack.git
cd dicti0nary-attack
# 初始化(安装依赖,建立目录)
just init
# 安装 pre-commit hooks
just setup-hooks
# 构建 ReScript(Web 界面)
deno task build:rescript
# 用于开发的监视模式
## deno task watch:rescript
=== 可用的 just 命令
## [source,bash]
## just # 列出所有命令
just build # 编译 Chapel 源码
just build-wasm # 编译为 WASM
just build-all # 构建所有内容
just test # 运行 Chapel 测试
just test-cov # 带覆盖率的测试
just bench # 性能基准测试
just format # 格式化 Chapel 代码
just lint # 检查 Chapel 代码
just quality # 所有质量检查
just clean # 移除构建产物
just serve-static # 提供 Web 界面
just podman-build # 构建容器
just validate-rsr # 检查 RSR 合规性
just nickel-eval # 评估 Nickel 配置
just stats # 显示项目统计信息
== 🤝 贡献
欢迎贡献!请确保:
1. 所有测试通过:`just test` 和 `cargo test`
2. 代码已格式化:`just format` 和 `cargo fmt`
3. 没有 lint 错误:`just lint` 和 `cargo clippy`
4. ReScript 编译成功:`deno task build:rescript`
5. 文档已更新
== 📄 许可证
本项目采用 GNU General Public License v3.0 授权 - 有关详细信息,请参阅 link:LICENSE[LICENSE] 文件。
== 🙏 致谢
- 灵感来源于对更好的密码安全测试工具的需求
- 使用 Chapel、Rust、ReScript 和 Nickel 构建
- 由 WASM 提供支持,实现 Offline-First 的浏览器执行
- 感谢安全研究社区
== 📞 联系与支持
- _问题_:link:https://github.com/Hyperpolymath/dicti0nary-attack/issues[GitHub Issues]
- _文档_:link:docs/[docs/]
- _许可证_:GPL-3.0
== 🔒 安全通知
本工具旨在帮助安全专业人员识别弱密码。绝不能用于:
- 获取对任何系统的未经授权访问
- 破解您没有测试权限的密码
- 任何非法或不道德的目的
在测试您不拥有的任何系统之前,请务必获得明确的书面许可。
_带着 ❤️ 为安全研究社区而制作_
标签:Chapel, DOS头擦除, Rust, VEH, 可视化界面, 字典攻击, 密码生成器, 密码破解, 网络流量审计, 请求拦截