Somchandra17/TrashRecon

GitHub: Somchandra17/TrashRecon

一款 Docker 化的自动化侦察框架,将 17 款安全工具串联成完整的信息收集流水线,帮助安全人员快速建立目标资产全景图。

Stars: 3 | Forks: 1

# TrashRecon TrashRecon 是一款面向安全研究人员和渗透测试人员的自动化侦察框架。它在 Docker 内部通过单条命令串联 10 个阶段的 17 款工具,以实现子域名枚举、DNS 记录提取、ASN/CIDR 范围映射、端口扫描、截图、子域名接管检查、端点爬取、漏洞模式搜索、暴露 API 密钥扫描,以及可选的 nuclei 运行。 ## 功能特性 - **子域名枚举 (Subdomain Enumeration)** — puredns (暴力破解)、subfinder、amass、assetfinder、waybackurls 和 waymore 并行运行 - **通配符 DNS 检测 (Wildcard DNS Detection)** — 如果目标存在通配符 DNS,在枚举前发出警告 - **HTTP 探测** — httpx 根据状态码筛选存活主机 - **DNS 记录提取** — 通过 dnsx 提取 A 记录、CNAME 记录和原始 IP - **ASN 与 CIDR 映射** — 通过 asnmap 将发现的 IP 映射到自治系统 (Autonomous Systems) 和 CIDR 范围 - **端口扫描** — 通过 smap 对独立 IP 进行全端口扫描 (0–65535) - **截图捕捉** — 使用 aquatone 对所有存活主机进行截图 - **子域名接管检查** — subzy 检查 CNAME 悬空引用 - **端点爬取** — katana 爬取存活主机的端点(可选,交互式) - **漏洞模式搜索** — gf 匹配 14 种模式 (XSS, SQLi, SSRF, SSTI, LFI, RCE, IDOR 等) - **API 密钥扫描** — secretx 扫描端点中暴露的密钥(可选,交互式) - **Nuclei 扫描** — 针对存活主机的 nuclei 漏洞扫描器(可选,交互式) - **彩色终端输出** — 每个阶段都有清晰、带颜色编码的状态消息 - **扫描日志记录** — 带有时间戳的完整日志保存到每个扫描文件夹 (`trashrecon.log`) - **结构化 JSON 输出** — `results.json` 包含所有发现结果,可供其他工具使用 - **恢复支持** — 针对同一域名重新运行时,已完成的步骤会自动跳过 ## 阶段流程 ``` Phase 1 · Subdomain Enumeration (puredns + 5 passive tools in parallel) Phase 2 · DNS Record Extraction (A, CNAME, IPs via dnsx) Phase 3 · ASN & CIDR Enumeration (asnmap) Phase 4 · Port Scanning (smap, all ports) Phase 5 · Screenshots (aquatone + chromium) Phase 6 · Subdomain Takeover Check (subzy) Phase 7 · Endpoint Crawling (katana — interactive, can skip) Phase 8 · GF Pattern Enumeration (14 patterns — only if Phase 7 ran) Phase 9 · API Key Scanning (secretx — interactive, only if Phase 7 ran) Phase 10 · Nuclei Vulnerability Scan (nuclei — interactive, independent) ``` ## 输出文件 所有结果均保存至 `~/TrashRecon//` (在 Docker 中绑定挂载): | 文件 | 描述 | |------|-------------| | `final_subdomains.txt` | 来自所有来源的去重子域名 | | `workingdomains.txt` | 存活主机 (HTTP 200/3xx) | | `a_records.txt` | 带响应的 A 记录 | | `cname.txt` | CNAME 记录 | | `IPs.txt` | 独立 IP | | `asn_info.json` | 每个 IP 的 ASN 数据 (JSONL) | | `cidr_ranges.txt` | 独立的 CIDR 范围 | | `port_scan.json` | 全端口扫描结果 | | `aquatone/` | 截图和 HTML 报告 | | `subdomains_takeover.txt` | 子域名接管结果 | | `endpoints.txt` | 爬取到的端点 | | `GF/` | 每种模式的 GF 结果 (xss.txt, sqli.txt 等) | | `api.txt` | 暴露的 API 密钥 | | `nuclei.jsonl` | Nuclei 发现结果 (JSONL) | | `results.json` | 所有内容的结构化摘要 | | `trashrecon.log` | 带时间戳的扫描日志 | ## 安装说明 ### Docker (推荐) ``` docker pull 0xs0m/trashrecon:latest ``` ``` docker run --rm -v ~/TrashRecon:/root/TrashRecon trashrecon example.com ``` 或者交互式运行 (提示输入域名): ``` docker run -it --rm -v ~/TrashRecon:/root/TrashRecon trashrecon ``` ### 从源码构建 ``` git clone https://github.com/Somchandra17/TrashRecon.git cd TrashRecon docker buildx build -t trashrecon . docker run --rm -v ~/TrashRecon:/root/TrashRecon trashrecon example.com ``` ## 更新字典与解析器 内置的 `resolvers.txt` 和 `subdomains-top1million-110000.txt` 是在构建时打包进 Docker 镜像的。若要在重新构建前刷新它们: ``` ./update-lists.sh docker buildx build -t trashrecon . ``` 该脚本会从 [trickest/resolvers](https://github.com/trickest/resolvers) 和 [danielmiessler/SecLists](https://github.com/danielmiessler/SecLists) 拉取最新版本。如果下载失败,则保留现有文件。 ## 工具列表 TrashRecon 在 Docker 镜像中捆绑了以下工具: | 工具 | 用途 | |------|---------| | [puredns](https://github.com/d3mondev/puredns) | 使用 massdns 进行 DNS 暴力破解 | | [subfinder](https://github.com/projectdiscovery/subfinder) | 被动子域名发现 | | [amass](https://github.com/owasp-amass/amass) | 子域名枚举 (v3) | | [assetfinder](https://github.com/tomnomnom/assetfinder) | 资产发现 | | [waybackurls](https://github.com/tomnomnom/waybackurls) | Wayback Machine URL 提取 | | [waymore](https://github.com/xnl-h4ck3r/waymore) | 扩展归档 URL 收集 | | [httpx](https://github.com/projectdiscovery/httpx) | HTTP 探测与过滤 | | [dnsx](https://github.com/projectdiscovery/dnsx) | DNS 记录提取 | | [asnmap](https://github.com/projectdiscovery/asnmap) | IP 到 ASN/CIDR 映射 | | [smap](https://github.com/s0md3v/Smap) | 基于 Shodan 的端口扫描 | | [aquatone](https://github.com/Abhinandan-Khurana/aquatone) | 截图捕捉 | | [subzy](https://github.com/PentestPad/subzy) | 子域名接管检测 | | [katana](https://github.com/projectdiscovery/katana) | 端点爬取 | | [gf](https://github.com/tomnomnom/gf) + [patterns](https://github.com/1ndianl33t/Gf-Patterns) | 漏洞模式匹配 | | [secretx](https://github.com/Somchandra17/secretx) | API 密钥扫描 | | [nuclei](https://github.com/projectdiscovery/nuclei) | 漏洞扫描 | | [massdns](https://github.com/blechschmidt/massdns) | 高性能 DNS 解析器 | ## 许可证 MIT — 详见 [LICENSE](LICENSE)。
标签:API密钥泄露, Aquatone, ASN映射, Chrome Headless, Docker, GitHub, Google, Httpx, Kubernetes安全, Nuclei, SQLi检测, XSS检测, 域名收集, 域名爆破, 子域名接管, 子域名枚举, 安全防御评估, 密码管理, 应用安全, 截图捕获, 插件系统, 敏感信息扫描, 数据统计, 日志审计, 端口扫描, 系统安全, 网络安全, 自动化侦察, 请求拦截, 逆向工具, 隐私保护