ExploitCraft/ReconNinja
GitHub: ExploitCraft/ReconNinja
一个 21 阶段自动化侦察框架,整合子域名枚举、端口扫描、漏洞检测和 AI 分析,为渗透测试和漏洞赏金提供一站式攻击面发现能力。
Stars: 10 | Forks: 2
# ReconNinja
**21 阶段自动化侦察框架,用于授权安全测试。**
[](https://github.com/ExploitCraft/ReconNinja/releases)
[](https://python.org)
[](tests/)
[](LICENSE)
[](https://github.com/ExploitCraft)
[](http://doc.emonpersonal.xyz/)
📄 **文档地址 [doc.emonpersonal.xyz](https://doc.emonpersonal.xyz/)**
[](CHANGELOG.md)
## 功能简介
ReconNinja 将侦察任务的每个阶段自动化为单个命令。只需指定一个域名或 IP,它便会驱动完整的 pipeline —— passive OSINT、端口扫描、Web 发现、漏洞扫描、云情报、凭证 hunting 以及 AI 驱动的威胁分析 —— 随后生成 HTML、JSON 和 Markdown 报告。
## 安装
```
# 从 GitHub(始终最新)
pip install git+https://github.com/ExploitCraft/ReconNinja.git
# 从 PyPI
pip install ReconNinja
# 从源码安装(推荐)
git clone https://github.com/ExploitCraft/ReconNinja.git
cd ReconNinja && chmod +x install.sh && ./install.sh
# 带可选依赖项
pip install "ReconNinja[full]" # AI providers + Shodan + dnspython
pip install "ReconNinja[ai]" # AI providers only
pip install "ReconNinja[dns]" # dnspython for zone transfer
```
## 快速开始
```
# 交互模式 — 引导式设置
ReconNinja
# 标准扫描
ReconNinja -t example.com
# 完整 21 阶段 pipeline
ReconNinja -t example.com --profile full_suite -y
# v5 情报(无需密钥)
ReconNinja -t example.com --whois --wayback --ssl -y
# v6 新模块(无需密钥)
ReconNinja -t example.com --github-osint --js-extract \
--cloud-buckets --dns-zone --waf --cors -y
# 完整 v6 带通知
ReconNinja -t example.com --profile full_suite \
--shodan --shodan-key KEY --vt --vt-key KEY \
--ai --ai-provider groq --ai-key KEY \
--github-osint --github-token TOKEN \
--notify slack://hooks.slack.com/services/xxx \
-y
# 对比两次扫描
ReconNinja --diff reports/example.com/20260101/report.json \
reports/example.com/20260301/report.json
```
## 扫描配置
| Profile | 执行内容 |
|---|---|
| `fast` | Top 100 端口,无脚本 |
| `standard` | Top 1000 端口,脚本 + 版本检测 *(默认)* |
| `thorough` | 所有端口,OS 检测,激进脚本 |
| `stealth` | SYN 扫描,低时序,无 banners |
| `web_only` | httpx + 目录扫描 + nuclei |
| `port_only` | RustScan + Masscan + Nmap |
| `full_suite` | 全部 21 个阶段 |
| `custom` | 交互式构建器 |
## Pipeline — 21 个阶段
```
Phase 1 Passive Recon subdomain enum (amass, subfinder, crt.sh)
Phase 2 RustScan ultra-fast port discovery (all 65535 ports)
Phase 2b Async TCP pure-Python fallback, no root required
Phase 3 Masscan optional SYN sweep (root required)
Phase 4 Nmap deep service / version / script analysis
Phase 4b CVE Lookup NVD API CVE matching on detected services
Phase 5 httpx live web detection + tech fingerprint
Phase 5b WAF Detection passive headers + wafw00f (v6 NEW)
Phase 5c CORS Scanner misconfiguration probe (v6 NEW)
Phase 6 Dir Scan feroxbuster → ffuf → dirsearch fallback
Phase 6b JS Extraction endpoint + secret extraction from JS (v6 NEW)
Phase 7 WhatWeb technology fingerprinting
Phase 8 Nikto classic web vulnerability scanner
Phase 9 Nuclei template-based vulnerability detection
Phase 10 Screenshots aquatone → gowitness fallback
Phase 11 AI Analysis Groq / Ollama / Gemini / OpenAI
Phase 12 Intelligence WHOIS · Wayback · SSL · VirusTotal · Shodan
Phase 13a GitHub OSINT secret / config file exposure (v6 NEW)
Phase 13b Cloud Buckets AWS S3 / Azure / GCS enumeration (v6 NEW)
Phase 13c DNS Zone Transfer AXFR vulnerability check (v6 NEW)
Phase 14 Plugins drop .py into plugins/ to extend
Phase 15 Reports HTML · JSON · Markdown
```
## v6.0.0 更新内容
### 修复 8 个 Bug
| # | 严重程度 | 修复内容 |
|---|---|---|
| 1 | **Critical** | `subdomains.py` — `_dns_brute` 参数传递顺序错误;`BUILTIN_SUBS` 落入 `out_file` 槽位 → 运行时 `TypeError` |
| 2 | **High** | `orchestrator.py` — rustscan 端口未持久化;在 `--resume` 时 `all_open_ports` 为空 → Nmap 被完全跳过 |
| 3 | **High** | `updater.py` — 全新安装时 `backup` 变量在赋值前被引用 → `UnboundLocalError` |
| 4 | **High** | `orchestrator.py` — AI fallback `_generate_ai_analysis` 曾是死代码;条件始终为 `True` → 无 Key 用户在报告中看到原始错误对象 |
| 5 | **Medium** | `ports.py` — banner 抓取器立即向每个端口发送 `HEAD / HTTP/1.0`;SSH/FTP/SMTP/Redis 断开连接 → 所有非 HTTP 端口 banner 捕获失败 |
| 6 | **Medium** | `orchestrator.py` — aquatone 接收到 `sub_file` (裸主机名) 而非 `url_file` (完整 URL) → 截图损坏 |
| 7 | **Medium** | `cve_lookup.py` — NVD 速率限制延迟仅在命中时触发;无结果查询爆发超过 5 req/30s → 静默 403s |
| 8 | **Low** | `utils/updater.py` — 过时重复文件,从未被导入,pip subprocess 缺少 `timeout=300` → 已删除 |
### 6 个新侦察模块
| 模块 | Flag | 描述 |
|---|---|---|
| GitHub OSINT | `--github-osint` | 搜索 GitHub 中暴露的 secrets、API keys、配置文件 |
| JS Extraction | `--js-extract` | 爬取活动页面,下载 JS 文件,提取 endpoints + secrets |
| Cloud Buckets | `--cloud-buckets` | 探测 AWS S3、Azure Blob、GCS 的公开/已认证 buckets |
| DNS Zone Transfer | `--dns-zone` | 针对所有 nameservers 的 AXFR 漏洞检查 |
| WAF Detection | `--waf` | Passive header + wafw00f 指纹识别 |
| CORS Scanner | `--cors` | 针对性 Origin 探测以发现 ACAO 配置错误 |
### 2 个新实用工具
| 工具 | Flag | 描述 |
|---|---|---|
| Scan Diff | `--diff A.json B.json` | 比较两次扫描报告 —— 新端口、新漏洞、新子域名 |
| Notifications | `--notify URL` | 扫描过程中向 Slack、Discord 或任何 webhook 发送警报 |
## 所有 Flags
```
Target
-t, --target Domain, IP, CIDR, or path to list file
-p, --profile Scan profile (see above)
-y, --yes Skip confirmation (CI/automation)
Port scanning
--all-ports Scan all 65535 ports
--top-ports N Top N ports (default: 1000)
--timing T1-T5 Nmap timing (default: T4)
--rustscan Enable RustScan pre-scan
--masscan Enable Masscan sweep (root)
--masscan-rate N Masscan pps (default: 5000)
--async-concurrency N Async TCP concurrency (default: 1000)
--async-timeout N Async TCP timeout seconds (default: 1.5)
Web & discovery
--httpx Live service detection
--whatweb WhatWeb fingerprinting
--ferox Feroxbuster directory scan
--nikto Nikto scanner
--nuclei Nuclei vulnerability templates
--aquatone Screenshots
--subdomains Subdomain enumeration
--wordlist-size small | medium | large
Vulnerability intelligence
--cve NVD CVE lookup for detected services
--nvd-key KEY NVD API key (50 req/30s vs 5)
v5 integrations
--shodan Shodan host intelligence
--shodan-key KEY Shodan API key
--vt VirusTotal reputation
--vt-key KEY VirusTotal API key
--whois WHOIS lookup (no key)
--wayback Wayback Machine URL discovery (no key)
--ssl SSL/TLS certificate analysis (no key)
v6 new modules
--github-osint GitHub secret/config exposure search
--github-token KEY GitHub token (raises rate limit 60→5000/hr)
--js-extract JS endpoint and secret extraction
--cloud-buckets Cloud bucket enumeration (AWS/Azure/GCS)
--dns-zone DNS zone transfer (AXFR) check
--waf WAF detection
--cors CORS misconfiguration scanner
AI analysis
--ai Enable AI threat analysis
--ai-provider groq | ollama | gemini | openai (default: groq)
--ai-key KEY API key for AI provider
--ai-model MODEL Override default model
Output & notifications
--output DIR Output directory (default: reports/)
--output-format FMT all | html | json | md | txt (default: all)
--exclude PHASES Comma-separated phases to skip
--notify URL Webhook alerts: slack://... discord://... https://...
--timeout N Global per-op timeout seconds (default: 30)
--rate-limit N Seconds between requests (default: 0)
Scan management
--resume FILE Resume from state.json checkpoint
--diff A.json B.json Compare two scan reports
--update Check GitHub for updates
--force-update Update even if already latest
--check-tools Show tool availability
```
## 输出
每次扫描都会创建一个带有时间戳的文件夹:
```
reports/
└── example.com_20260320_120000/
├── report.html ← dark-mode dashboard
├── report.json ← full machine-readable results
├── report.md ← markdown summary
├── scan_config.json ← exact config used
├── scan.log ← full execution log
├── state.json ← resume checkpoint
├── subdomains/
├── nmap/
├── nuclei/
├── js_extract/ ← v6: downloaded JS files
├── cloud_buckets/ ← v6: bucket findings
├── dns_zone/ ← v6: zone transfer records
├── waf/ ← v6: WAF detection output
└── cors/ ← v6: CORS findings
```
## 扫描差异对比
```
# 运行基线扫描
ReconNinja -t example.com -y
# 更改后再次运行
ReconNinja -t example.com -y
# 查看具体变更
ReconNinja --diff reports/example.com/20260101_120000/report.json \
reports/example.com/20260320_120000/report.json
```
输出:新开放端口、已关闭端口、新子域名、新漏洞、新技术、变更的服务版本。
## 通知
```
# Slack
ReconNinja -t example.com --notify slack://hooks.slack.com/services/T.../B.../xxx -y
# Discord
ReconNinja -t example.com --notify discord://discord.com/api/webhooks/xxx/yyy -y
# 通用 JSON webhook
ReconNinja -t example.com --notify https://your-server.com/webhook -y
```
在扫描过程中针对以下情况触发警报:发现关键端口、关键漏洞、公开云 buckets、CORS 问题、GitHub 泄露、Zone Transfer 漏洞以及扫描完成。
## 恢复中断的扫描
```
# 扫描在 Phase 9 后崩溃 — 从上次检查点恢复
ReconNinja --resume reports/example.com_20260320_120000/state.json
```
所有结果(端口、findings、v5 情报、v6 新模块数据)在每个阶段后都会 checkpoint,并在恢复时完全还原。
## 插件系统
将 `.py` 文件放入 `plugins/` 即可在所有阶段完成后扩展 pipeline。
```
# plugins/my_check.py
PLUGIN_NAME = "my_check"
PLUGIN_VERSION = "1.0"
def run(target, out_folder, result, cfg):
print(f"Custom: {len(result.github_findings)} GitHub findings")
print(f"Custom: {len(result.bucket_findings)} bucket findings")
```
## 工具依赖
仅需要 `rich`。所有外部工具均为可选 —— ReconNinja 会检测可用性并优雅地回退。
```
ReconNinja --check-tools
```
可选工具:`nmap`、`rustscan`、`masscan`、`amass`、`subfinder`、`httpx`、`feroxbuster`、`ffuf`、`dirsearch`、`whatweb`、`nikto`、`nuclei`、`aquatone`、`gowitness`、`wafw00f`、`dig`
可选 Python 包:`dnspython` (zone transfer)、`shodan`、`groq`、`openai`、`google-generativeai`
## 开发
```
git clone https://github.com/ExploitCraft/ReconNinja.git
cd ReconNinja
chmod +x install.sh && ./install.sh
# 运行测试
python3 -m pytest tests/ -v
python3 -m pytest tests/test_orchestrator.py -v
python3 -m pytest tests/test_models.py -v
```
## HackerInc/ExploitCraft 生态系统的一部分
| 工具 | 描述 |
|------|-------------|
| [envleaks](https://github.com/ExploitCraft/envleaks) | Codebase & git history scanner (此仓库) |
| [gitdork](https://github.com/ExploitCraft/gitdork) | Google/Shodan dork generator |
| [wifi-passview](https://github.com/ExploitCraft/wifi-passview) | 跨平台 WiFi credential dumper |
| **ReconNinja** | ReconNinja v6 — 21 阶段侦察框架 |
| [VaultHound](https://github.com/ExploitCraft/VaultHound) | Secret & credential scanner |
## 许可证
MIT — 详见 [LICENSE](LICENSE)
**[ExploitCraft](https://github.com/ExploitCraft)** · Bangladesh · Building tools that matter
📄 完整文档地址 **[doc.emonpersonal.xyz](http://doc.emonpersonal.xyz/)**
标签:AI安全, Chat Copilot, CIDR扫描, CORS检测, CTI, ESC4, ESC6, GitHub, GitHub情报, HTML报告, OSINT, Python安全工具, Sigma 规则, SOC, WAF识别, Web侦察, 云存储检测, 侦察框架, 域名分析, 威胁分析, 子域名枚举, 实时处理, 密码管理, 开源网络情报, 恶意行为检测, 插件系统, 数据统计, 无线安全, 白帽工具, 端口扫描, 系统安全, 结构化查询, 网络安全, 自动化侦查工具, 自动化安全, 调试插件, 运行时操纵, 逆向工具, 隐私保护