Azazelx0/grimoire

GitHub: Azazelx0/grimoire

集成14种模式的高级字典生成器,支持Web爬取、目标画像、Hashcat规则、Markov生成、掩码攻击和Wi-Fi字典等功能,采用纯Python实现并配备交互式TUI界面。

Stars: 0 | Forks: 0

# GRIMOIRE 🔮 [![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-blue)](https://python.org) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![GitHub](https://img.shields.io/badge/GitHub-Azazelx0%2Fgrimoire-red)](https://github.com/Azazelx0/grimoire) ## ✨ 功能 | Feature | Description | |---------|-------------| | 🕷 **Web Crawling** | 静态 HTTP + 可选的无头 JS 渲染 (Playwright)。可配置深度、延迟、代理 | | 🎯 **Target Profiling** | CUPP 风格 — 姓名、出生日期、伴侣、宠物、公司 → 个性化字典 | | 🧬 **Mutation Engine** | Leet speak(黑客语)、大小写变体、追加数字/符号/年份、反转、重复 | | 📜 **Hashcat Rules** | 完整的 `.rule` 文件解析器:`:`, `l`, `u`, `c`, `C`, `r`, `d`, `$X`, `^X`, `sXY`, `TN` | | 📧 **Email Harvesting** | 在爬取过程中提取符合 RFC 标准的电子邮件 | | 🔍 **OSINT Scraper** | 从 GitHub 配置文件和公开页面提取关键字 | | 🔀 **Combo Attack** | 通过连接每一对单词来合并两个字典 | | 🎭 **Mask Generator** | 基于模式的生成(`?u?l?l?d?d` → `Ab3c12`) | | 📡 **Wi-Fi Wordlist** | 基于扩展服务集标识符 (ESSID)/供应商的密码生成,包含常见模式 | | 🌍 **Locale Packs** | 特定语言的常见密码(EN, TR, DE, ES, FR, AR) | | � **Wordlist Analysis** | 长度直方图、字符集细分、熵、模式检测 | | 🔗 **Chain Pipeline** | 多步变异:`leet -> numbers(0-99) -> policy(min:8)` | | 📝 **Recipe System** | 基于 YAML 的自动化:爬取 → 配置 → 变异 → 过滤 → 导出 | | 🧬 **Markov Generator** | 在字典上训练,生成统计上可能的密码 | | 🛡 **Policy Filter** | 根据密码要求过滤输出(最小/最大长度、大写字母、数字、特殊字符) | | � **Alecto DB** | 捆绑的默认设备凭据(路由器、IoT、网络设备) | | 📥 **Dict Downloader** | 按类别从 SecLists 获取精选字典 | | 📈 **Dict Improver** | 将现有字典通过变异引擎进行处理 | | 🔄 **Deduplication** | 精确 + 模糊(基于 Levenshtein)去重 | | 📤 **Multi-Format** | 输出:纯文本、JSON(带频率)、Hashcat 规则 | | 🎨 **Rich TUI** | 由 Rich 驱动的精美彩色界面 — 无原始 ANSI 转义码 | | 🔁 **Interactive REPL** | 支持 Tab 补全的 Shell — 无需重启即可变异、导出、分析、配置 | ## 🚀 快速开始 ### 安装 ``` git clone https://github.com/Azazelx0/grimoire.git cd grimoire pip install -r requirements.txt pip install -e . ``` ### 运行 ``` grimoire # Interactive wizard (14 modes) grimoire --help # Full flag reference ``` ### 交互模式 运行不带标志的 `grimoire` 会启动交互模式选择器: ![GRIMOIRE Interactive Menu](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/3be6b3d277054108.png) ## 📖 使用示例 ### Web 爬取 ``` # 基础 crawl grimoire --url https://example.com --depth 2 -o wordlist.txt # 带 mutations + emails grimoire --url https://target.com --depth 3 --emails --mutate --leet -o mutated.txt # JS 重型站点 (需要: pip install playwright && playwright install chromium) grimoire --url https://spa-app.com --mode headless -o js-words.txt # Authenticated + stealth grimoire --url https://intranet.corp.com \ --cookie "PHPSESSID=abc123" \ --proxy socks5://127.0.0.1:9050 \ --random-ua --delay 1000 -o stealth.txt ``` ### 目标 profiling (CUPP 风格) ``` # 交互式 grimoire # → select "Profile Target" # 脚本化 grimoire --profile "name=John last=Smith dob=1990 pet=Rex company=Acme" -o john.txt ``` ### 掩码生成器 ``` # 生成所有 ?u?l?l?d?d 组合 (Aaa00-Zzz99) grimoire --mask "?u?l?l?d?d" -o mask.txt # Charsets: ?l=小写 ?u=大写 ?d=数字 ?s=特殊 ?a=全部 ``` ### 组合攻击 ``` grimoire --combo wordlist1.txt wordlist2.txt -o combined.txt ``` ### OSINT 抓取器 ``` grimoire --osint username -o keywords.txt ``` ### Wi-Fi 字典 ``` grimoire --wifi-essid "NETGEAR42" --wifi-vendor netgear -o wifi.txt ``` ### 链式管道 ``` grimoire --chain "leet -> case -> numbers(0-99) -> policy(min:8)" \ --file input.txt -o chained.txt ``` ### 配方系统 ``` # recipe.yml name: corporate-pentest steps: - crawl: {url: "https://corp.com", depth: 3} - profile: {name: John, company: Acme} - mutate: [leet, case, numbers] - policy: {min: 8, upper: 1, digit: 1} - export: corporate-wordlist.txt ``` ``` grimoire --recipe recipe.yml ``` ### Markov 生成器 ``` grimoire --markov-train wordlist.txt --markov-count 50000 -o markov.txt ``` ### Alecto 默认凭据 ``` grimoire --alecto "cisco" # Search by vendor grimoire --alecto "" # Dump all ``` ### 字典分析 ``` grimoire --stats wordlist.txt ``` ### 语言包 ``` grimoire --locale en,tr,de -o locale-words.txt ``` ### 策略过滤器 ``` grimoire --mask "?l?l?l?l?d?d" --policy "min:6 upper:0 digit:1" -o filtered.txt ``` ## 🖥 REPL 命令 在任何操作之后,GRIMOIRE 都会进入带有 Tab 补全功能的交互式 REPL: ``` grimoire❯ help ``` | Command | Description | |---------|-------------| | `help` | 显示所有命令 | | `stats` / `analyze` | 字典统计 + 直方图 | | `export ` | 导出字典 | | `mutate [--leet] [--case] [--numbers]` | 应用变异 | | `profile` | 启动目标 profiling | | `alecto [search ]` | 浏览默认凭据 | | `download ` | 下载字典类别 | | `improve ` | 改进现有字典 | | `dedup [--fuzzy]` | 去重 | | `policy min:8 upper:1 ...` | 按密码策略过滤 | | `load ` | 从文件加载字典 | | `save ` | 保存字典 | | `set ` | 更改会话设置 | | `clear` | 重置字典 | | `exit` | 退出 | ## 📊 对比 | Feature | CeWL | CUPP | **GRIMOIRE** | |---------|------|------|--------------| | Web crawling | ✅ | ❌ | ✅ (静态 + 无头) | | Target profiling | ❌ | ✅ | ✅ (增强版) | | Mutation engine | ❌ | 基础 | ✅ (完整 + Hashcat 规则) | | Combo attack | ❌ | ❌ | ✅ | | Mask generator | ❌ | ❌ | ✅ | | OSINT scraping | ❌ | ❌ | ✅ | | Wi-Fi wordlists | ❌ | ❌ | ✅ | | Locale packs | ❌ | ❌ | ✅ (6 种语言) | | Wordlist analysis | ❌ | ❌ | ✅ (熵、直方图) | | Chain mutations | ❌ | ❌ | ✅ | | Recipe system | ❌ | ❌ | ✅ (YAML 自动化) | | Markov generator | ❌ | ❌ | ✅ | | Policy filter | ❌ | ❌ | ✅ | | Email harvesting | ✅ | ❌ | ✅ | | Default creds DB | ❌ | ✅ | ✅ (捆绑 Alecto) | | Interactive REPL | ❌ | ❌ | ✅ (Tab 补全) | | Multi-format output | 文本 | 文本 | ✅ (txt/JSON/Hashcat) | | Cross-platform | Ruby | Python | ✅ (Python, 任何操作系统) | | No compilation | ❌ | ✅ | ✅ | ## 📁 项目结构 ``` grimoire/ ├── pyproject.toml # Package config → `grimoire` command ├── requirements.txt # Core dependencies ├── grimoire/ │ ├── cli.py # Click CLI with 40+ flags │ ├── banner.py # Rich Panel ASCII banner │ ├── wizard.py # 14-mode interactive selector │ ├── repl.py # Tab-complete REPL shell │ ├── crawler/ # Static + headless crawlers │ ├── extractor.py # Word/email/meta/JS extraction │ ├── mutator/ # Basic + Hashcat rules + combo │ ├── profiler.py # CUPP-style target profiling │ ├── alecto.py # Default credentials DB │ ├── mask.py # Mask/pattern generator │ ├── osint.py # OSINT social scraper │ ├── wifi.py # Wi-Fi ESSID generator │ ├── locale_packs.py # Language packs │ ├── stats.py # Wordlist analysis │ ├── chain.py # Pipeline mutations │ ├── recipe.py # YAML recipe system │ ├── policy.py # Password policy filter │ ├── markov.py # Markov chain generator │ ├── dedup.py # Exact + fuzzy dedup │ ├── output.py # txt/json/hashcat writers │ └── data/ # Alecto CSV + locale packs ├── docs/ # Reference documentation └── examples/ # Usage scripts + rule files ``` ## 📄 许可证 MIT 许可证。详情请参阅 [LICENSE](LICENSE)。 ## 🤝 贡献 请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 了解指南。 ## 📚 文档 - [Flag 参考](docs/flags.md) - [REPL 命令](docs/repl-commands.md) - [Hashcat 规则语法](docs/rule-syntax.md)
标签:CUPP, DOS头擦除, ESC4, ESC8, Hashcat规则, IPv6支持, Mask攻击, OSINT, Python安全工具, TUI, VEH, Web爬虫, WiFi破解, 字典攻击, 密码变体, 密码字典生成, 密码破解, 数据展示, 特征检测, 白帽黑客, 社会工程学, 红队, 网络安全, 防御加固, 隐私保护, 马尔可夫链, 默认凭证