Fonners/AI-Subdomain-Enumerator
GitHub: Fonners/AI-Subdomain-Enumerator
一款集成AI预测与LLM智能字典生成的子域名枚举工具,将被动侦察、NLP关键词提取、智能变异引擎和DNS暴力破解整合为完整流水线。
Stars: 0 | Forks: 0
# 🗺️ Atlas — AI 驱动的子域名枚举器
一款功能强大的子域名枚举工具,集成了被动侦察、AI 预测、NLP 关键词提取、基于 LLM 的字典生成以及智能变异引擎——同时保持最终字典精简且可用于 DNS 查询。
## ⚡ 快速开始
```
# 安装 Atlas
curl -fsSL https://raw.githubusercontent.com/Fonners/AI-Subdomain-Enumerator/main/install.sh | bash
# 设置您的 Anthropic API key
export ANTHROPIC_API_KEY=sk-ant-...
# 运行
atlas -d example.com
```
就是这样。Atlas 会处理剩下的事情。
## ✨ 功能特性
| 模块 | 功能 |
|---|---|
| **subfinder** | 通过 OSINT 来源进行被动子域名发现 |
| **SubWiz** | 基于已知子域名进行 AI 子域名预测 |
| **CeWL 风格爬虫** | 纯 Python 网页爬虫——无 Ruby 依赖 |
| **NLTK NLP** | 从爬取内容中进行词形还原的关键词提取 |
| **Claude (LLM)** | 上下文感知的字典生成 + 关键词扩充 |
| **变异引擎** | 智能后缀替换、环境前缀后缀及部分重组 |
| **puredns** | 高速 DNS 暴力破解解析 |
| **httpx** | 带状态码和技术检测的存活主机探测 |
## 🚀 安装
### 选项 1 —— 单行安装(推荐)
```
curl -fsSL https://raw.githubusercontent.com/Fonners/AI-Subdomain-Enumerator/main/install.sh | bash
```
这会下载最新版本,将其安装到 `/usr/local/bin/atlas`,以便您可以在任何地方将其作为命令运行,并自动安装所有 Python 依赖项。
### 选项 2 —— 手动安装
**Python 依赖项**
```
pip install requests html2text nltk subwiz anthropic --break-system-packages
```
**Go 工具**
```
go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install github.com/d3mondev/puredns/v2@latest
go install github.com/projectdiscovery/httpx/cmd/httpx@latest
```
**API 密钥**
```
export ANTHROPIC_API_KEY=sk-ant-...
```
要使 API 密钥永久生效,请将导出行添加到您的 `~/.bashrc` 或 `~/.zshrc` 中。
## 🔄 保持更新
Atlas 会在您每次运行时自动检查更新。如果有新版本可用,您会在工具运行前看到此信息:
```
╔══════════════════════════════════════════════════════╗
║ Update available! v1.0.0 -> v1.1.0 ║
║ Run: sudo apt update && sudo apt upgrade atlas ║
║ Or: pip install --upgrade atlas ║
╚══════════════════════════════════════════════════════╝
```
然后工具会继续正常运行——警告信息永远不会阻碍您。如果您已是最新版本,则不会显示任何内容。如果您没有网络,则会静默跳过检查。
要随时检查当前版本:
```
atlas --version
```
## 🛠️ 使用方法
```
atlas -d example.com
```
### 常用示例
```
# 针对目标进行基本运行
atlas -d example.com
# 自定义输出目录
atlas -d example.com -o ./results
# 提高最终 wordlist 上限(默认值:5000)
atlas -d example.com --wordlist-max 10000
# 收紧 mutation engine 预算(默认值:2000)
atlas -d example.com --mutation-budget 500
# 仅生成 wordlist — 跳过 DNS resolution
atlas -d example.com --wordlist-only
# 通过内联方式传递 API key,而非通过 env var
atlas -d example.com -k sk-ant-...
# 跳过特定步骤
atlas -d example.com --no-llm --no-subwiz
# 检查已安装版本
atlas --version
```
## ⚙️ 所有参数
| 参数 | 默认值 | 描述 |
|---|---|---|
| `-d`, `--domain` | *(必填)* | 目标域名 |
| `-o`, `--output` | `atlas_` | 输出目录 |
| `-m`, `--model` | `claude-sonnet-4-6` | 要使用的 Claude 模型 |
| `-k`, `--api-key` | 环境变量 | Anthropic API 密钥 |
| `--wordlist-max` | `5000` | 最终字典大小的硬性上限 |
| `--mutation-budget` | `2000` | 变异引擎可添加的最大条目数 |
| `--subwiz-timeout` | `300` | SubWiz 的超时时间(秒) |
| `--wordlist-only` | `false` | 生成字典后停止,跳过 DNS |
| `--version` | — | 打印当前版本并退出 |
| `--no-subfinder` | — | 跳过 subfinder |
| `--no-subwiz` | — | 跳过 SubWiz |
| `--no-scrape` | — | 跳过网页爬取 |
| `--no-nltk` | — | 跳过 NLTK 提取 |
| `--no-llm` | — | 跳过所有 Claude 步骤 |
| `--no-mutate` | — | 跳过变异引擎 |
| `--no-puredns` | — | 跳过 DNS 暴力破解 |
| `--no-httpx` | — | 跳过存活主机探测 |
## 🧬 变异引擎工作原理
与 alterx 可能生成数百万种排列不同,内置变异引擎在每个阶段都使用带有硬性限制的三种针对性策略:
1. **后缀替换** —— 用语义等价词替换已知的词尾。
`ethical-hacking` → `ethical-hacker`, `ethical-hackers`, `ethical-hack`
2. **环境前后缀** —— 在开头/结尾添加常见的环境标签。
`api` → `dev-api`, `staging-api`, `api-v2`, `api-internal`
3. **部分重组** —— 分割带连字符的标签,并在所有发现的子域名之间交叉组合各部分。
`ethical-hacking` + `red-team` → `ethical-team`, `red-hacking`
**防爆炸控制:**
- 每个标签最多 **8 个变异**
- 每次运行最多 **2000 个总变异**(可通过 `--mutation-budget` 覆盖)
- 部分重组限制为 **60 个采样部分**,以避免 O(n²) 爆炸
- 字典最终 **5000 条目的硬性上限**(可通过 `--wordlist-max` 覆盖)
## 📁 输出文件
所有文件默认写入 `atlas_/`:
| 文件 | 内容 |
|---|---|
| `passive_subfinder.txt` | 原始 subfinder 结果 |
| `subwiz_predictions.txt` | SubWiz AI 预测 |
| `scraped_content.txt` | 从目标爬取的原始文本 |
| `nltk_keywords.txt` | NLP 提取的关键词 |
| `llm_wordlist.txt` | Claude 生成的子域名候选 |
| `llm_enriched_keywords.txt` | Claude 关键词扩充结果 |
| `mutation_candidates.txt` | 变异引擎输出 |
| `combined_wordlist.txt` | 最终合并且有上限的字典 |
| `resolved_subdomains.txt` | puredns 解析的存活子域名 |
| `all_subdomains.txt` | 被动 + 解析结果,已去重 |
| `httpx_results.json` | 带状态/技术信息的 httpx JSON 输出 |
## 📋 环境要求摘要
- Python 3.10+
- Go 1.19+ (用于 subfinder, puredns, httpx)
- 用于 Claude 步骤的 [Anthropic API 密钥](https://console.anthropic.com/)
## ⚠️ 法律免责声明
本工具仅用于**授权的安全测试**。在对任何目标运行枚举之前,请务必确保您拥有明确的书面许可。作者不对滥用行为承担责任。
## 🙏 致谢
- 灵感来源于 **ai4eh (AI for Ethical Hacking)** 研讨会
- 被动侦察由 [subfinder](https://github.com/projectdiscovery/subfinder) 提供支持
- AI 预测由 [SubWiz](https://github.com/ARPSyndicate/subwiz) 提供
- DNS 解析由 [puredns](https://github.com/d3mondev/puredns) 提供
- 存活探测由 [httpx](https://github.com/projectdiscovery/httpx) 提供
- LLM 字典生成由 [Claude](https://www.anthropic.com/claude) (Anthropic) 提供
标签:AI 安全工具, Bug Bounty, Claude, CVE检测, DLL 劫持, DNS 暴力破解, ESC4, Go 语言, Httpx, LLM, NLP, OSINT, Puredns, Python, Unmanaged PE, 侦察工具, 变异引擎, 可自定义解析器, 大语言模型, 子域名接管, 子域名枚举, 密码管理, 无后门, 日志审计, 智能预测, 系统安全, 网站爬虫, 网络安全, 运行时操纵, 逆向工具, 隐私保护