haza-3301/Recon-Engine
GitHub: haza-3301/Recon-Engine
一款异步模块化的子域名枚举框架,为 bug bounty 与渗透测试提供高性能、可扩展的资产侦察能力。
Stars: 6 | Forks: 2
# Recon-Engine



## 主要功能
- **模块化与可扩展** — 无需更改核心即可扩展 plugin API 和 CLI tool
- **异步** — 所有数据源并行运行 (`asyncio` + `httpx`)
- **实时进度 CLI** — 实时状态表格 (`rich`)
- **多格式输出** — TXT、CSV、JSON、Burp、Nmap gnmap、HTML
- **结果缓存** — JSON + SHA256 校验和 + 文件锁(非加密)
- **域名验证** — 自动过滤 + 支持 IDN/Punycode
- **类型化 plugin 契约** — `BaseAPIPlugin` / `BaseToolPlugin` (v9)
## 安装说明
```
git clone https://github.com/haza-3301/Recon-Engine.git
cd Recon-Engine
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# 可选:安装外部工具(subfinder、findomain 等)
python install.py install
```
## 使用方法
```
# 默认:full pipeline → recon.txt(单个文件,无中间产物)
python3 recon.py padang.go.id -t 300
# 输出到其他路径
python3 recon.py padang.go.id -t 300 -o hasil/recon.txt
# 仅活跃主机名(枚举 + 过滤 + dnsx + httpx 探测,无指纹)
python3 recon.py padang.go.id -t 300 --enum-only
```
| 模式 | Pipeline | `recon.txt` 内容 |
|------|----------|-----------------|
| **default** | enum → filter → dnsx → httpx (fingerprint) | URL + status, title, IP — **无 [FAILED]** |
| **`--enum-only`** | enum → filter → dnsx → httpx (`-silent`) | 纯净的 live Hostname |
磁盘上没有 `raw.txt`、`subs.txt`、`dnsx.txt` 或 `live.txt` — 所有阶段均在内存中执行。
## 二进制文件 (`tools_bin/`)
可移植 — 路径相对于 repo 根目录,无硬编码的本地 user/目录。
| 文件 | 功能 |
|------|--------|
| `pd-httpx` | ProjectDiscovery httpx |
| `dnsx` | ProjectDiscovery dnsx |
```
python3 install.py install # unduh dari GitHub ke tools_bin/
python3 recon.py example.com --show-tools
# 可选:从您自己的目录复制
python3 install.py sync-tools /path/to/bin
```
## v9 架构
```
main.py (CLI)
│
├── core/config.py ReconConfig (dataclass)
├── core/cache.py CacheManager
├── core/orchestrator.py ReconOrchestrator — async plugin runner
├── core/plugin_loader.py Discovery + lint
├── core/base_plugin.py BaseAPIPlugin / BaseToolPlugin
├── core/output_writer.py Multi-format export
└── plugins/
├── api/ HTTP sources
└── tools/ CLI wrappers
```
**流程:**
```
Input domain → load plugins → [cache hit?] → ReconOrchestrator.gather()
→ validasi & dedup → [resolve IP / ASN] → write_output → cache write
```
## 内置 Plugin
| Plugin | 类型 | 来源 | 备注 |
|--------|------|--------|---------|
| crt.sh | API | Certificate transparency | — |
| CertSpotter | API | certspotter.com | — |
| AlienVault OTX | API | Passive DNS | — |
| HackerTarget | API | hostsearch | 纯文本 (`is_json=False`) |
| Chaos | API | ProjectDiscovery | 环境变量 `CHAOS_KEY` |
| subfinder | Tool | ProjectDiscovery | PATH / `tools_bin/` |
| assetfinder | Tool | tomnomnom | Go binary |
| findomain | Tool | Findomain | Binary |
| Wayback | Built-in | web.archive.org | Flag `--wayback` |
## 添加 Plugin
### API(`plugins/api/myplugin.py`)
```
from typing import Any, Set
from core.base_plugin import BaseAPIPlugin
class Plugin(BaseAPIPlugin):
def __init__(self):
self.name = "My API"
self.url = "https://api.example.com/subdomains/{domain}"
self.api_key_env = "MY_API_KEY" # opsional
def parse(self, data: Any) -> Set[str]:
if not isinstance(data, dict):
return set()
return set(data.get("hosts", []))
```
### Tool(`plugins/tools/mytool.py`)
```
from typing import List
from core.base_plugin import BaseToolPlugin
class Plugin(BaseToolPlugin):
def __init__(self):
self.name = "mytool"
def get_command(self, domain: str) -> List[str]:
return ["mytool", "-d", domain]
```
验证:`python3 main.py --lint-plugins`
## 输出
| 格式 | Flag | 内容 |
|--------|------|-----|
| `.txt` | `-o out.txt` | Subdomain (+ IP/ASN) |
| `.json` | `-o out.json` | 嵌套字典 |
| `.csv` | `-o out.csv` | subdomain, ip, asn, org |
| `.burp` | `-o out.burp` | Hostname 列表 |
| `.gnmap` | `-o out.gnmap` | Nmap 目标列表 |
| `.html` | `-o out.html` | Jinja2 报告 |
## 开发
```
pip install -r requirements.txt
pytest plugins/tests -v
python3 main.py --lint-plugins
```
测试结构:`plugins/tests/`
## 贡献
请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
## 许可证
MIT — 请参阅 [LICENSE](LICENSE)。
标签:Bug Bounty, GitHub, Linux安全, Python, 可自定义解析器, 子域名枚举, 异步框架, 无后门, 系统安全, 计算机取证, 运行时操纵, 逆向工具