Making6/reconaut

GitHub: Making6/reconaut

一款模块化的 Python 侦察编排框架,通过纯 Python 原生层与外部工具适配器实现从 OSINT 到 Web 指纹识别的全流程自动化侦察并生成多格式报告。

Stars: 0 | Forks: 0

# reconaut [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/22d24c215e235339.svg)](https://github.com/Making6/reconaut/actions/workflows/ci.yml) ![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) [![Lint: ruff](https://img.shields.io/badge/lint-ruff-261230.svg)](https://github.com/astral-sh/ruff) ![Types: mypy](https://img.shields.io/badge/types-mypy%20strict-blue.svg) ![Docker](https://img.shields.io/badge/docker-ready-2496ED.svg) ## 为什么选择 reconaut 市面上已经有了成熟的侦察框架(如 reconFTW、Osmedeus、BBOT)。reconaut **并不**试图 在功能上超越它们——它是对同一问题的一次清晰、工程化实践,展示了 侦察方法论与稳健的软件设计: - 🧩 **模块化与可扩展** — 每个侦察步骤都是一个自注册的 `Module`;每个外部 工具都是统一的 `Adapter`。添加一个工具只需一个小文件。 - 🐍 **开箱即用** — 纯 Python 实现的 **原生层** (crt.sh, RDAP/WHOIS, DNS, HTTP 探测, TLS 检查, TCP 扫描, Wayback) 意味着 reconaut 即使在**零外部二进制文件**的 裸 Windows 环境下也能进行有用的侦察。 - ⬆️ **平滑升级** — 当安装了更好的工具(如 `nmap`, `httpx`, `sslscan`)时, 匹配的适配器会**自动取代**其原生回退方案。缺少工具时绝不会崩溃; `reconaut check-tools` 会告诉你需要安装什么。 - ⚡ **异步编排** — 阶段按顺序执行,同一阶段内的模块并发运行, 数据从一个阶段流向下一个阶段 (子域名 → 解析 → 存活主机 → 端口 → TLS …)。 - 🔒 **默认安全** — 默认进行被动扫描;主动阶段需要显式使用 `--active` 标志并 进行授权确认。 - ✅ **像生产级代码一样工程化** — 完全的类型检查 (`mypy --strict`),代码检查/格式化 (`ruff`),单元测试 (`pytest`),在 GitHub Actions 上配置了 CI,并作为 Docker 镜像发布。 ## 架构 ``` flowchart LR T["Target
domain · IP · URL"] --> P["Passive OSINT"] P --> D["DNS"] D --> HD["Live hosts"] HD --> PS["Ports & services"] PS --> TL["TLS / SSL"] TL --> WF["Web fingerprint"] WF --> CD["Content discovery"] CD --> SC["Screenshots"] SC --> VL["Vuln templates"] VL --> R["Reports
JSON · MD · HTML"] ``` 分层设计 — 引擎与模块通信;模块使用纯 Python 原生层或外部工具的 轻量级适配器: ``` flowchart TD CLI["CLI · Typer + Rich"] --> ENG["Engine
async orchestrator"] ENG --> MOD["Modules
one per recon step"] MOD --> NAT["Native layer
pure Python, no binary"] MOD --> ADP["Adapters
wrap external tools"] ADP --> EXT["nmap · httpx · subfinder
sslscan · nuclei · gobuster · …"] ENG --> REP["Reporters
JSON · Markdown · HTML"] ``` 更多细节请参阅 [docs/architecture.md](docs/architecture.md)。 ## 演示 ``` $ reconaut scan scanme.nmap.org --active -p full _ __ ___ ___ ___ _ __ __ _ _ _ / /_ | '__/ _ \/ __/ _ \| '_ \ / _` | | | || __| | | | __/ (_| (_) | | | | (_| | |_| || |_ |_| \___|\___\___/|_| |_|\__,_|\__,_| \__| reconaut · modular reconnaissance orchestration framework ▶ Passive OSINT (3 modules) ▶ DNS enumeration (2 modules) ▶ Live-host discovery (1 module) ▶ Port & service scan (1 module) 45.33.32.156: 2/198 ports open ▶ TLS / SSL analysis (1 module) ▶ Web fingerprinting (1 module) Scan summary Target scanme.nmap.org Subdomains 2 Hosts 2 Web assets 1 URLs 83 Findings 1 Modules run 9 Duration 24.9s Reports written: output/scanme.nmap.org_.../reconaut-report.{json,md,html} ``` 📄 该次运行的**示例报告**(已提交至仓库中): [Markdown](docs/samples/reconaut-report.md) (在 GitHub 上渲染) · [HTML](docs/samples/reconaut-report.html) (在浏览器中打开) · [JSON](docs/samples/reconaut-report.json) ## 安装 ### Docker (推荐 — 打包了所有外部工具) ``` docker build -t reconaut . docker run --rm -v "$PWD/output:/app/output" reconaut scan example.com ``` 多阶段镜像内置了 `nmap`, `subfinder`, `httpx`, `sslscan`, `nuclei`, `gobuster`, `naabu`, `amass`, `gau` 等,因此无需任何主机配置即可使用所有模块。 ### Python (原生核心,可在各平台运行 — Windows/macOS/Linux) ``` pipx install . # or: pip install . reconaut --help ``` 原生(纯 Python)模块可直接工作。安装外部工具以解锁适配器 — 运行 `reconaut check-tools` 查看当前可用工具及如何安装其余工具。 ## 用法 ``` reconaut scan example.com # passive scan (default), profile "standard" reconaut scan example.com -p passive # OSINT + DNS only, no contact with the target reconaut scan example.com --active -p full # full active pipeline (asks for authorization) reconaut scan 192.0.2.10 --active -p full -f json -f html reconaut check-tools # which external tools are installed reconaut list-modules # recon modules in this build reconaut list-profiles # built-in scan profiles ``` | 配置文件 | 阶段 | 是否主动? | |---|---|---| | `passive` | OSINT + DNS | 从不连接目标 | | `standard` *(默认)* | OSINT, DNS, 存活主机, TLS, Web 指纹识别 | 主动部分需要 `--active` | | `web` | standard + 内容发现,**无端口扫描** (非常适合 Web 应用) | 主动部分需要 `--active` | | `full` | 除漏洞模板外的所有内容 | 主动部分需要 `--active` | | `full-vuln` | 包含 nuclei 在内的所有内容 | 主动部分需要 `--active` | 全局标志放在命令**之前** (例如 `reconaut -v --no-banner scan …`)。 完整参考和 YAML 配置格式请参阅 [docs/usage.md](docs/usage.md)。 ## 编排的工具 | 阶段 | 原生 (内置) | 外部工具适配器 | |---|---|---| | 被动 OSINT | crt.sh, RDAP/WHOIS, Wayback | `subfinder`, `amass`, `gau` | | DNS | 记录 + 解析 (dnspython) | — | | 存活主机 | HTTP 探测 | `httpx` | | 端口与服务 | 异步 TCP 连接扫描 | `nmap`, `naabu` | | TLS / SSL | 证书 + 协议 (cryptography) | `sslscan` | | Web 指纹识别 | 安全标头 | (httpx tech-detect) | | 内容发现 | — | `gobuster` | | 漏洞模板 | — | `nuclei` | `reconaut check-tools` 列出了完整的目录 (22 个工具) 及其安装提示。 ## 安全与伦理 - **默认被动。** 主动阶段(端口扫描、内容发现、漏洞模板等)仅在 使用 `--active` 时运行,并且会有一个交互式提示要求你确认授权(在自动化场景下使用 `--yes` 跳过 确认)。 - **可识别身份。** 原生 HTTP 请求会发送 `reconaut/…` 的 User-Agent。 - **无意外情况。** 缺失的工具会平滑降级到原生模块 — 它们绝不会导致运行崩溃。 ## 开发 ``` pip install -e ".[dev]" ruff check . && ruff format --check . # lint + format mypy src # strict type checking pytest -q # unit tests (parsers, config, engine — offline) pre-commit install # optional: run ruff on every commit ``` CI (GitHub Actions) 会在 Python 3.11 & 3.12 上运行 lint、类型检查和测试,并构建 Docker 镜像。 ## 本项目展示了什么 一个紧凑但真实的代码库展示了:插件/注册表架构,具有 有限并发的 `asyncio` 编排,通过 **pydantic v2** 模型实现的端到端严格类型检查,对 第三方工具输出的防御性解析(基于固定数据进行测试),平滑降级,使用 **Jinja2** 生成多格式报告,多阶段 **Dockerfile**,GitHub Actions CI — 以及对 授权和伦理深思熟虑、文档化的立场。 ## 许可证 [MIT](LICENSE) © Thomas NOYON ([@Making6](https://github.com/Making6))。 仅供授权的安全测试和教育用途使用。
标签:Docker, ESC4, GitHub, OSINT, Python, 动态调用, 安全规则引擎, 安全防御评估, 实时处理, 密码管理, 无后门, 网络调试, 自动化, 计算机取证, 请求拦截, 逆向工具