prakhar0x01/approach
GitHub: prakhar0x01/approach
一个模块化侦察自动化框架,用分层模型覆盖资产发现到漏洞触发,解决被动枚举遗漏的深层攻击面问题。
Stars: 4 | Forks: 1
```
█████╗ ██████╗ ██████╗ ██████╗ ██████╗ █████╗ ██████╗██╗ ██╗
██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔═══██╗██╔══██╗██╔════╝██║ ██║
███████║██████╔╝██████╔╝██████╔╝██║ ██║███████║██║ ███████║
██╔══██║██╔═══╝ ██╔═══╝ ██╔══██╗██║ ██║██╔══██║██║ ██╔══██║
██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ██║╚██████╗██║ ██║
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
```
**Elite Recon Framework — v3.0**
*Built for bug bounty hunters who think in layers.*
[](https://www.gnu.org/software/bash/)
[](https://www.python.org/)
[]()
## 目录
1. [概述](#1-overview)
2. [理念](#2-philosophy)
3. [v3.0 新增功能](#3-whats-new-in-v30)
4. [架构](#4-architecture)
5. [先决条件](#5-prerequisites)
6. [工具依赖](#6-tool-dependencies)
7. [安装](#7-installation)
8. [配置](#8-configuration)
9. [用法](#9-usage)
10. [函数参考](#10-functions-reference)
11. [输出结构](#11-output-structure)
12. [覆盖的边缘情况](#12-edge-cases-covered)
13. [AI 集成](#13-ai-integration)
14. [Discord 通知](#14-discord-notifications)
15. [工作流指南](#15-workflow-guide)
16. [附加资源](#16-additional-resources)
17. [法律免责声明](#17-legal-disclaimer)
## 1. 概述
**Approach** 是一个精英、模块化的侦察自动化框架,专为漏洞赏金猎人和安全研究人员设计。它使用 Bash 和 Python 编写,围绕分层情报模型构建,远超标准的子域名枚举。
v3.0 是完全重写版本。它新增了 15 个功能,覆盖了大多数自动化框架完全忽略的关键边缘情况,集成了通过 Claude API 进行 AI 辅助分类,并在每次运行结束时生成结构化的 Markdown 报告。
核心设计原则源自原始脚本本身的注释:
这正是 v3.0 所做到的。
## 2. 理念
大多数侦察工具回答的问题是:*“存在哪些子域名?”*
Approach 回答一个更难的问题:*“该组织的攻击面在哪里,而他们自己并未完全察觉?”*
公司了解其主要应用程序,但通常不清楚:
- 由排列组合(`api-v2`、`dev`、`us-prod`)生成的遗忘 staging 和开发子域名
- 组织拥有但从未解析过 DNS 的 IP 范围内的基础设施
- 拥有相同代码库但审查力度更低的收购公司域名
- Wayback Machine 上仍包含有效密钥的历史 JavaScript 文件
- 与主域名共享同一 IP 的共托管应用程序
- 以品牌变体命名的开放云存储桶
- 通过 Shodan 上 SSL 证书的 SAN 字段泄露的内部域名
**Approach 覆盖所有这些。** 每个功能都针对被动枚举遗漏的真实缺口而设计。
工作流程围绕四个侦察层级构建:
```
Layer 1 — SCOPE INTELLIGENCE Who are you actually dealing with?
Layer 2 — ASSET DISCOVERY What exists?
Layer 3 — SURFACE MAPPING What's running and what's interesting?
Layer 4 — VULNERABILITY SIGNALS Where do you actually hunt?
```
## 3. v3.0 新增功能
| 功能 | v1.0 | v3.0 |
|---|---|---|
| 子域名来源 | 3(amass、subfinder、crt.sh) | 8(新增 assetfinder、findomain、chaos、rapiddns、otx) |
| 子域名解析 | httpx 直接探测 | puredns(防泛洪感知)→ httpx |
| 排列发现 | 基础 | alterx + goaltdns、net-new 差异 |
| 端口扫描 | 仅对主目标使用 nmap | naabu(60+ 端口)→ 所有拥有 IP 的 nmap |
| JavaScript 分析 | wget + nuclei | katana + LinkFinder + SecretFinder + trufflehog + Wayback |
| 目录爆破 | dirsearch | ffuf + feroxbuster + API 单词表 + 并行子域名 |
| 功能数量 | 6 | 22 |
| 边缘情况覆盖 | 0 明确 | 15+(AXFR、CORS、403 绕过、favicon 哈希、ASN 范围等) |
| AI 集成 | 无 | Claude API(范围解析 + 侦察分类) |
| 告警机制 | 无 | 每个关键发现的 Discord Webhook |
| 输出 | 仅终端 | 结构化目录树 + Markdown 报告 |
| 授权门控 | 无 | `yes` 确认全自动化模式 |
## 4. 架构
```
approach.sh
│
├── Intelligence Layer
│ ├── asn_enum() — ASN ranges + reverse IP lookup
│ ├── reverse_whois() — Sibling domain discovery
│ └── dns_analysis() — AXFR, SPF, DMARC, DKIM, CNAME analysis
│
├── Asset Discovery Layer
│ ├── subdomain_enum() — 8-source parallel enumeration
│ └── permutation_enum() — alterx + goaltdns, net-new diff
│
├── Surface Mapping Layer
│ ├── waf_detect() — WAF, headers, favicon hash
│ ├── port_scan() — naabu → nmap on all owned IPs
│ ├── url_harvest() — gau + waybackurls + katana + uro
│ ├── javascript() — Deep JS + historical Wayback analysis
│ ├── dir_bruteforce() — ffuf + feroxbuster + API wordlist
│ └── param_discover() — paramspider + x8 + JS param extraction
│
├── Vulnerability Signal Layer
│ ├── gf_patterns() — 13 gf patterns on full URL list
│ ├── cors_check() — reflect + null + subdomain origin
│ ├── bypass_403() — header tricks + path normalization
│ ├── takeover_check() — subzy + nuclei takeover templates
│ └── vuln_scan() — nuclei sweep + CVEs + DAST fuzzing
│
├── Intel & Leaks Layer
│ ├── check() — login/admin/CI/monitoring panel detector
│ ├── cloud_enum() — S3/GCP/Azure + GitHub org secrets
│ ├── shodan_intel() — org + SSL + SAN + favicon hash search
│ └── ai_assist() — Claude API scope parsing + recon triage
│
└── Meta
├── generate_report() — Full markdown report
├── full_auto() — Complete pipeline with auth gate
└── fresh_up() — Update all tools
```
## 5. 先决条件
- **操作系统:** 任何 Linux 发行版(推荐 Kali)
- **语言:** Bash 4+、Python 3.8+
- **Go:** 1.21+(用于 ProjectDiscovery 工具)
- **Root 或 sudo:** 用于 nmap 及部分系统级操作
- **API 密钥(可选但推荐):**
- `ANTHROPIC_API_KEY` — 用于 AI 范围解析与分类
- `SHODAN_API_KEY` — 用于 Shodan 情报
- `GITHUB_TOKEN` — 用于 GitHub 代码搜索 dork
- `NOTIFY_DISCORD_WEBHOOK` — 用于实时关键告警
## 6. 工具依赖
### 核心(必需)
| 工具 | 用途 | 安装 |
|---|---|---|
| [subfinder](https://github.com/projectdiscovery/subfinder) | 被动子域名枚举 | `go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest` |
| [httpx](https://github.com/projectdiscovery/httpx) | HTTP 探测 + 指纹识别 | `go install github.com/projectdiscovery/httpx/cmd/httpx@latest` |
| [nuclei](https://github.com/projectdiscovery/nuclei) | 漏洞扫描 | `go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest` |
| [naabu](https://github.com/projectdiscovery/naabu) | 快速端口扫描 | `go install github.com/projectdiscovery/naabu/v2/cmd/naabu@latest` |
| [katana](https://github.com/projectdiscovery/katana) | JS 感知网络爬虫 | `go install github.com/projectdiscovery/katana/cmd/katana@latest` |
| [dnsx](https://github.com/projectdiscovery/dnsx) | DNS 解析与分析 | `go install github.com/projectdiscovery/dnsx/cmd/dnsx@latest` |
| [puredns](https://github.com/d3mondev/puredns) | 防泛洪感知 DNS 解析 | `go install github.com/d3mondev/puredns/v2@latest` |
| [amass](https://github.com/owasp-amass/amass) | 被动子域名枚举 | `go install github.com/owasp-amass/amass/v4/...@latest` |
| [nmap](https://nmap.org) | 服务/版本探测 | `apt install nmap` |
| [ffuf](https://github.com/ffuf/ffuf) | 快速内容发现 | `go install github.com/ffuf/ffuf/v2@latest` |
| [feroxbuster](https://github.com/epi052/feroxbuster) | 递归目录爆破 | `apt install feroxbuster` |
| [dirsearch](https://github.com/maurosoria/dirsearch) | 目录暴力破解 | `git clone https://github.com/maurosoria/dirsearch.git` |
| [gau](https://github.com/lc/gau) | 历史 URL 收集 | `go install github.com/lc/gau/v2/cmd/gau@latest` |
| [waybackurls](https://github.com/tomnomnom/waybackurls) | Wayback Machine URL | `go install github.com/tomnomnom/waybackurls@latest` |
| [uro](https://github.com/s0md3v/uro) | URL 去重 | `go install github.com/ameenmaali/uro@latest` |
| [gf](https://github.com/tomnomnom/gf) | URL 模式匹配 | `go install github.com/tomnomnom/gf@latest` |
| [subzy](https://github.com/LukaSikic/subzy) | 子接管检查 | `go install github.com/LukaSikic/subzy@latest` |
| [assetfinder](https://github.com/tomnomnom/assetfinder) | 被动子域名枚举 | `go install github.com/tomnomnom/assetfinder@latest` |
| [findomain](https://github.com/Findomain/Findomain) | 被动子域名枚举 | 参考 GitHub 发布版本 |
| [chaos](https://github.com/projectdiscovery/chaos-client) | Chaos 数据集查询 | `go install github.com/projectdiscovery/chaos-client/cmd/chaos@latest` |
| [alterx](https://github.com/projectdiscovery/alterx) | 子域名排列 | `go install github.com/projectdiscovery/alterx/cmd/alterx@latest` |
### 增强(推荐)
| 工具 | 用途 | 安装 |
|---|---|---|
| [trufflehog](https://github.com/trufflesecurity/trufflehog) | 已验证密钥扫描 | `go install github.com/trufflesecurity/trufflehog/v3@latest` |
| [LinkFinder](https://github.com/GerbenJavado/LinkFinder) | JS 端点提取 | `git clone https://github.com/GerbenJavado/LinkFinder.git` |
| [SecretFinder](https://github.com/m4ll0k/SecretFinder) | JS 密钥/敏感信息检测 | `git clone https://github.com/m4ll0k/SecretFinder.git` |
| [paramspider](https://github.com/devanshbatham/ParamSpider) | 参数发现 | `git clone https://github.com/devanshbatham/ParamSpider.git` |
| [x8](https://github.com/Sh1Yo/x8) | 隐藏参数暴力破解 | 参考 GitHub 发布版本 |
| [wafw00f](https://github.com/EnableSecurity/wafw00f) | WAF 检测 | `pip install wafw00f` |
| [corsy](https://github.com/s0md3v/Corsy) | CORS 错误配置扫描 | `git clone https://github.com/s0md3v/Corsy.git` |
| [cloud_enum](https://github.com/initstring/cloud_enum) | 云存储桶枚举 | `git clone https://github.com/initstring/cloud_enum.git` |
| [shodan](https://cli.shodan.io/) | Shodan CLI | `pip install shodan` |
| [goaltdns](https://github.com/subfinder/goaltdns) | 子域名排列替代方案 | `go install github.com/subfinder/goaltdns@latest` |
| [whatweb](https://github.com/urbanadventurer/WhatWeb) | 技术指纹识别 | `apt install whatweb` |
| [bypass-403](https://github.com/iamj0ker/bypass-403) | 403 绕过自动化 | `git clone https://github.com/iamj0ker/bypass-403.git` |
| [mmh3](https://pypi.org/project/mmh3/) | Favicon 哈希(Python) | `pip install mmh3` |
| [gh](https://cli.github.com/) | GitHub CLI(代码搜索) | `apt install gh` |
### 解析器
使用高质量的新鲜解析器列表供 puredns:
```
https://github.com/trickest/resolvers
```
## 7. 安装
```
# 克隆仓库
git clone https://github.com/prakhar0x01/approach.git
cd approach
# 可执行文件
chmod +x approach.sh
# 选项 A:从当前目录运行
./approach.sh -h
# 选项 B:全局安装
cp approach.sh /usr/local/bin/approach
approach -h
```
**一次性安装所有 Go 工具:**
```
./approach.sh -fresh
```
这将运行所有核心工具的 `go install` 并更新 nuclei 模板。
## 8. 配置
打开 `approach.sh` 并更新顶部的配置块:
```
# ─── CONFIG ──────────────────────────────────────────────────
WORDLIST="/path/to/your/wordlist.txt"
API_WORDLIST="/path/to/api_wordlist.txt"
NUCLEI_TEMPLATES="/path/to/nuclei-templates"
RESOLVERS="/path/to/resolvers.txt"
THREADS=50
RATE_LIMIT=100
# 可选 — 留空以跳过该功能
SHODAN_API_KEY=""
ANTHROPIC_API_KEY=""
NOTIFY_DISCORD_WEBHOOK=""
GITHUB_TOKEN=""
```
**推荐词表:**
- 内容发现:[SecLists/Discovery/Web-Content/raft-large-words.txt](https://github.com/danielmiessler/SecLists)
- API 发现:[SecLists/Discovery/Web-Content/api/](https://github.com/danielmiessler/SecLists)
- 参数:[SecLists/Discovery/Web-Content/burp-parameter-names.txt](https://github.com/danielmiessler/SecLists)
- 解析器:[trickest/resolvers](https://github.com/trickest/resolvers/blob/main/resolvers.txt)
- 排列:`permutations.txt`(本仓库包含)
## 9. 用法
```
Usage: ./approach.sh [options]
─── Reconnaissance ───
-asn ASN & IP ranges + reverse IP lookup
-whois Reverse WHOIS — find sibling/acquired domains
-sb Subdomain enum (8 sources, parallel, resolve, probe)
-perm Permutation discovery (alterx — finds dev/staging/api-v2)
-dns DNS deep analysis (AXFR, SPF, DMARC, DKIM, wildcards)
-waf WAF detect + security headers + favicon Shodan hash
─── Surface Mapping ───
-ps Port scan (naabu → nmap, all owned IPs, 60+ ports)
-url URL harvest (gau + wayback + katana + uro)
-js JS analysis (katana + LinkFinder + trufflehog + wayback)
-D Dir bruteforce (ffuf + feroxbuster + API wordlist)
-param Param discovery (paramspider + x8 + JS param extraction)
─── Vulnerability Signals ───
-gf GF patterns (xss, sqli, ssrf, lfi, rce, idor, ssti...)
-cors CORS (reflect + null origin + subdomain origin bypass)
-403 403 bypass (header tricks + path normalization)
-tko Subdomain takeover (subzy + nuclei)
-vuln Nuclei (sweep + CVEs + DAST fuzzing)
─── Intel & Leaks ───
-check Detect login/admin/CI/monitoring/db/git panels
-cloud Cloud buckets + GitHub org secrets + wayback secrets
-shodan Shodan (org + SSL + SAN + favicon hash + history)
-ai AI scope parsing (needs program_brief.txt)
-triage AI triage of all recon output
─── Meta ───
-report Generate full markdown recon report
-full Full auto pipeline (everything, with authorization check)
-fresh Update all tools via go install
```
### 示例
```
# 仅子域名枚举
./approach.sh -sb target.com
# 完整表面映射管道
./approach.sh -sb -url -js -param target.com
# 侦察后的漏洞信号
./approach.sh -gf -cors -403 -tko -vuln target.com
# 在接触目标前用 AI 解析程序简报
echo "Program brief text..." > program_brief.txt
./approach.sh -ai target.com
# 运行全部
./approach.sh -full target.com
# 链式调用多个特定功能
./approach.sh -asn -sb -perm -dns -waf -ps target.com
```
## 10. 函数参考
### `-asn` — ASN 与 IP 范围发现
查询 BGPView 获取该组织拥有的所有 ASN,然后获取这些 ASN 下的每个 IP 前缀。对主目标执行反向 IP 查找,以查找同一服务器上的共托管域名。
**为何重要:** 组织拥有的 IP 范围可能从未出现在 DNS 中。Staging 服务器、内部工具和遗忘的应用存在于 ASN 拥有的空间内,对被动子域名枚举不可见。
**输出:** `subdomains/asns.txt`、`subdomains/ip_ranges.txt`、`subdomains/reverse_ip_hosts.txt`
### `-whois` — 反向 WHOIS
查询 ViewDNS 获取与目标实体注册的所有域名。
**为何重要:** 被收购的公司、姐妹品牌和旧域名共享相同的代码库,但受到的关注更少。这些是软目标。
**输出:** `subdomains/reverse_whois.txt`
### `-sb` — 子域名枚举
并行运行 8 个被动来源(amass、subfinder、assetfinder、findomain、chaos、crt.sh、rapiddns、AlienVault OTX)。合并结果、去重、使用 puredns(防泛洪感知)解析,并通过 httpx 探测。
同时执行泛洪 DNS 检测 — 若被动结果可能被假阳性污染会发出警告。
**输出:** `subdomains/all_subs_raw.txt`、`subdomains/resolved.txt`、`subdomains/live_hosts.txt`
### `-perm` — 基于排列的发现
使用 `alterx` 生成数千个子域名排列变体(dev、api-v2、staging、us-prod、vault、jenkins、grafana...)并针对所有已解析域名进行解析。使用 puredns。计算 **净新增差异** — 完全未被被动枚举捕获的排列子域名。
**为何重要:** 被动枚举发现已知主机。排列发现从未被索引过的主机。`api-v2.target.com` 和 `dev.target.com` 属于此类。
**输出:** `subdomains/permuted.txt`、`subdomains/permuted_resolved.txt`、`subdomains/permuted_new_only.txt`
### `-dns` — DNS 深度分析
执行以下操作:
- 完整 DNS 记录转储(A、AAAA、CNAME、MX、NS、TXT、SOA、CAA)
- 对每个名称服务器尝试区域传输(AXFR)
- SPF 记录审计 — 检测 `+all`(灾难性)和 `~all`(薄弱)
- DMARC 审计 — 检测缺失和 `p=none`(未强制执行)
- DKIM 检查常见选择器
- 对 12 个已知易受接管的服务检测悬挂 CNAME
- 泛洪 DNS 检测
**输出:** `dns/dns_records.txt`、`dns/email_issues.txt`、`dns/email_security.txt`、`dns/dangling_cnames.txt`
### `-waf` — WAF 与技术指纹识别
使用 wafw00f 检测 WAF。审计安全头(HSTS、CSP、X-Frame-Options、X-Content-Type-Options、Referrer-Policy、Permissions-Policy)。计算 favicon 的 mmh3 哈希用于 Shodan 搜索。
**为何 Favicon 哈希重要:** `http.favicon.hash:` 可在 Shodan 上查找全球使用该相同应用程序的实例,包括未受保护且位于基础设施角落的实例。
**输出:** `waf/wafw00f.txt`、`waf/headers.txt`、`waf/missing_headers.txt`、`waf/favicon.txt`、`waf/whatweb.json`
### `-ps` — 端口扫描
从已解析域名中提取所有唯一 IP 并提取 ASN 范围。使用 naabu 扫描 60+ 端口(速度快),然后仅对确认开放的端口运行 nmap `-sV -sC`(准确度高)。探测非标准端口上的 HTTP 服务。对关键暴露项告警(Elasticsearch :9200、Redis :6379、MongoDB :27017、Docker :2375 等)。
**输出:** `ports/all_ips`、`ports/naabu_open.txt`、`ports/nmap_services.txt`、`ports/nonstandard_http.txt`
### `-url` — URL 收集
通过 gau(Wayback + CommonCrawl + OTX)收集历史 URL 并使用 waybackurls。配合 katana 进行主动爬取(支持 JS 渲染)。使用 uro 去重。提取参数化 URL、API 路径以及具有敏感扩展名的文件(.bak、.env、.sql、.key、.pem 等)。
**输出:** `urls/all_urls.txt`、`urls/param_urls.txt`、`urls/api_paths.txt`、`urls/interesting_extensions.txt`
### `-js` — JavaScript 深度分析
使用 katana 爬取(过滤掉 vendor/library 文件)。下载所有自定义 JS 文件。同时从 Wayback Machine 下载历史 JS — 早已“删除”的秘密仍存在于存档中。运行 LinkFinder(端点提取)、SecretFinder(密钥/敏感信息检测)和 trufflehog `--only-verified`(零误报的密钥检测)。运行 nuclei 暴露模板。
**输出:** `js/js_urls.txt`、`js/downloads/`、`js/linkfinder_endpoints.txt`、`js/secrets.txt`、`js/trufflehog.json`
### `-D` — 目录暴力破解
运行 ffuf(快速、自动校准)、feroxbuster(递归深度 3)、针对 API 的 ffuf 以及并行 dirsearch(针对前 20 个活跃子域名)。
**输出:** `urls/ffuf.json`、`urls/feroxbuster.txt`、`urls/ffuf_api.json`
### `-param` — 参数发现
运行 paramspider 和 x8(隐藏参数暴力破解)。执行参数频率分析。提取 JS 文件中的潜在参数名。
**输出:** `params/paramspider.txt`、`params/x8_params.txt`、`params/param_frequency.txt`、`params/js_params.txt`
### `-gf` — GF 模式匹配
在完整 URL 列表上运行 13 个 GF 模式:`xss`、`sqli`、`ssrf`、`redirect`、`lfi`、`rce`、`idor`、`ssti`、`debug_logic`、`cors`、`upload-fields`、`interestingparams`、`img-traversal`。生成每个模式的候选计数摘要。
**为何重要:** 这是在手动测试前最快的分类步骤。它能在数秒内区分信号与噪声,并明确告诉你应优先测试哪些 URL。
**输出:** `patterns/gf_*.txt`、`patterns/gf_summary.txt`
### `-cors` — CORS 错误配置
测试三种不同的 CORS 绕过场景:
1. **反射的 Origin + 凭证** — 发送 `Origin: https://evil.com`,检查是否反射并带有 `Access-Control-Allow-Credentials: true`(高严重性)
2. **Null Origin 绕过** — 发送 `Origin: null`,检查是否接受 null Origin
3. **子域名 Origin 信任** — 发送 `Origin: https://evil.target.com`,检查是否有任意子域名被信任。若任意子域名存在 XSS,则构成关键链
**输出:** `cors/cors_vulns.txt`、`cors/corsy_raw.txt`
### `-403` — 403 绕过
收集 ffuf 输出中的所有 403 URL(若无可回退到常见管理路径)。测试 10 种基于头部的绕过(`X-Original-URL`、`X-Forwarded-For`、`X-Real-IP`、`X-Host` 等)以及多种路径规范化变体(`/..;/`、`%20`、`%09`、大写路径、`%2f` 编码)。发现任意 200 响应即告警并通知。
**输出:** `vulns/403_urls.txt`、`vulns/403_bypasses.txt`
### `-tko` — 子域名接管
对全部已解析子域名运行 subzy 和 nuclei 接管模板。发现可接管项时告警并通知。
**输出:** `vulns/subzy.txt`、`vulns/nuclei_takeovers.txt`
### `-vuln` — 漏洞扫描
三阶段 nuclei 扫描:
1. 广泛扫描 — 暴露面、错误配置、漏洞、默认登录
2. CVE 模板 — 严重与高危 CVE
3. DAST 模糊测试 — 对参数化 URL 使用 nuclei DAST 模板
**输出:** `vulns/nuclei_sweep.txt`、`vulns/nuclei_cves.txt`、`vulns/nuclei_dast.txt`
### `-check` — 有趣面板检测器
探测所有活跃主机,检测 11 类面板:登录/认证、管理面板、仪表盘、API 探索器(Swagger、GraphQL)、开发/测试实例、CI/CD 工具(Jenkins、GitLab、CircleCI)、监控(Grafana、Kibana、Prometheus)、数据库 UI(phpMyAdmin、Adminer)、密钥管理(Vault、Keycloak)、文件管理器以及 Git 接口。
**输出:** `urls/interesting_panels.txt`
### `-cloud` — 云枚举与 Git 泄露
对目标名称使用 16 种关键词变体枚举 S3、GCP、Azure 存储桶。对 GitHub 组织运行 trufflehog 查找已验证密钥。运行 GitHub 代码搜索 dork 查找密码、API 密钥、令牌与私钥。扫描下载的 Wayback JS 文件查找已验证密钥。
**输出:** `cloud/cloud_interesting.txt`、`cloud/github_secrets.json`、`cloud/github_dorks.txt`、`cloud/wayback_secrets.json`
### `-shodan` — Shodan 情报
执行四次 Shodan 查询:组织搜索、SSL 证书 CN 搜索(查找证书中的内部域名)、SAN 字段搜索(揭示内部基础设施)、主 IP 的历史主机数据,以及 favicon 哈希搜索以全局查找相同应用程序的实例。
需要配置 `SHODAN_API_KEY`。
**输出:** `ports/shodan_org.txt`、`ports/shodan_ssl.txt`、`ports/shodan_san.txt`、`ports/shodan_host.txt`、`ports/shodan_favicon.txt`
### `-ai` — AI 范围解析
将 `program_brief.txt` 发送至 Claude API(claude-sonnet)。提取:范围内资产、范围外资产、禁止测试类型、披露要求、奖励等级、技术栈提示、需避免的红旗以及推荐的首个攻击面。
**使用方法:**
```
# 保存程序简报
cat > program_brief.txt << 'EOF'
[Paste your HackerOne/Bugcrowd program brief here]
EOF
# 用 Claude 解析
./approach.sh -ai target.com
```
需要配置 `ANTHROPIC_API_KEY`。
### `-triage` — AI 侦察分类
在完成侦察后、开始手动测试前,将你的侦察结果(活跃主机、开放端口、DNS 记录、GF 分类摘要、Nuclei 结果)发送给 Claude 进行智能分析。返回前 5 个攻击面及具体测试步骤、暗示薄弱环节的模式,以及你可能遗漏的内容。
**在完成侦察后运行。**
需要配置 `ANTHROPIC_API_KEY`。
**输出:** `report/ai_triage.txt`
### `-report` — 报告生成
生成结构化的 Markdown 报告,汇总所有侦察统计、关键发现、活跃主机、关键 Nuclei 结果、GF 模式候选计数、有趣面板以及下一步检查清单。
**输出:** `report/recon_report.md`
## 11. 输出结构
每次运行都会创建一个带时间戳的输出目录:
```
recon-target.com-20250413-142300/
│
├── subdomains/
│ ├── all_subs_raw.txt — All subdomains from all sources
│ ├── resolved.txt — DNS-verified live subdomains
│ ├── live_hosts.txt — HTTP-probed live hosts with metadata
│ ├── permuted_new_only.txt — Net-new subdomains from permutation
│ ├── asns.txt — ASNs owned by org
│ ├── ip_ranges.txt — IP prefixes owned by org
│ └── reverse_whois.txt — Sibling domains via reverse WHOIS
│
├── dns/
│ ├── dns_records.txt — Full DNS dump
│ ├── email_security.txt — SPF, DMARC, DKIM records
│ ├── email_issues.txt — Missing or misconfigured email security
│ └── dangling_cnames.txt — Potential takeover candidates
│
├── waf/
│ ├── wafw00f.txt — WAF detection results
│ ├── headers.txt — HTTP response headers
│ ├── missing_headers.txt — Absent security headers
│ ├── favicon.txt — Favicon mmh3 hash for Shodan
│ └── whatweb.json — Tech stack fingerprint
│
├── ports/
│ ├── all_ips.txt — All unique IPs across subdomains
│ ├── naabu_open.txt — Open ports (ip:port format)
│ ├── nmap_services.txt — Service/version detection
│ ├── nonstandard_http.txt — HTTP on non-standard ports
│ └── shodan_*.txt — Shodan intelligence files
│
├── urls/
│ ├── all_urls.txt — All collected URLs (deduplicated)
│ ├── param_urls.txt — URLs with parameters
│ ├── api_paths.txt — API endpoint paths
│ ├── interesting_extensions.txt — Backup/config/secret files
│ └── interesting_panels.txt — Login/admin/monitoring panels
│
├── js/
│ ├── js_urls.txt — All JS file URLs
│ ├── downloads/ — Downloaded JS files (current + wayback)
│ ├── linkfinder_endpoints.txt — Extracted endpoints from JS
│ ├── secrets.txt — Potential secrets/keys
│ └── trufflehog.json — Verified secrets (trufflehog)
│
├── params/
│ ├── paramspider.txt — Discovered parameters
│ ├── x8_params.txt — Hidden parameters
│ ├── param_frequency.txt — Most common params across all URLs
│ └── js_params.txt — Parameters extracted from JS
│
├── patterns/
│ ├── gf_xss.txt — XSS candidate URLs
│ ├── gf_sqli.txt — SQLi candidate URLs
│ ├── gf_ssrf.txt — SSRF candidate URLs
│ ├── gf_*.txt — (13 patterns total)
│ └── gf_summary.txt — Count per pattern
│
├── cors/
│ ├── cors_vulns.txt — CORS vulnerabilities found
│ └── corsy_raw.txt — Raw corsy output
│
├── vulns/
│ ├── nuclei_sweep.txt — Broad nuclei findings
│ ├── nuclei_cves.txt — CVE findings
│ ├── nuclei_dast.txt — DAST fuzzing findings
│ ├── subzy.txt — Takeover results
│ ├── 403_urls.txt — 403 target URLs
│ └── 403_bypasses.txt — Successful 403 bypasses
│
├── cloud/
│ ├── cloud_interesting.txt — Open/interesting cloud storage
│ ├── github_secrets.json — Verified GitHub secrets
│ ├── github_dorks.txt — GitHub dork results
│ └── wayback_secrets.json — Historical secrets from Wayback JS
│
└── report/
├── summary.md — Run metadata
├── recon_report.md — Full generated report
└── ai_triage.txt — AI recon triage output
```
## 12. 覆盖的边缘情况
这些是标准自动化框架容易遗漏的场景。Approach 全部覆盖:
| 边缘情况 | 功能 | 重要性 |
|---|---|---|
| 组织拥有的 IP 范围(未出现在 DNS 中) | `-asn` | 内部应用隐藏于此 |
| 被收购的公司域名 | `-whois` | 相同代码库,审查更少 |
| 泛洪 DNS 导致的假阳性 | `-sb` | 静默污染被动结果 |
| DNS 区域传输(AXFR) | `-dns` | 关键信息泄露(如配置) |
| SPF `+all 配置错误 | `-dns` | 任何人可冒充发信 |
| DMARC `p=none`(未强制执行) | `-dns` | 钓鱼攻击无告警 |
| Favicon 哈希 → Shodan | `-waf` | 查找未受保护的相同应用实例 |
| 非标准 HTTP 端口 | `-ps` | 管理面板隐藏在 8888 等端口 |
| Elasticsearch / Redis / MongoDB 暴露 | `-ps` | 未认证访问,高危 P1 |
| Wayback Machine 中的历史密钥 | `-js` | 已“删除”的秘密仍永久存档 |
| 排列发现的子域名 | `-perm` | `dev`、`api-v2`、`staging` 从未被索引 |
| URL 文件扩展名泄露(.bak / .env / .sql) | `-url` | 配置与备份文件暴露 |
| GF 模式预分类 | `-gf` | 从数千 URL 中快速提取信号 |
| 空 Origin CORS 绕过 | `-cors` | 常见于手动测试遗漏 |
| 子域名 Origin CORS 信任 | `-cors` | XSS 任意位置 + 此项 = 关键链 |
| 基于头部的 403 绕过 | `-403` | 管理面板隐藏在 403 后 |
| 路径规范化绕过 | `-403` | `/..;/` 与 `%2f` 常绕过 WAF |
| Shodan 中的 SSL SAN 字段 | `-shodan` | 内部域名明文泄露 |
| GitHub 组织已验证密钥 | `-cloud` | 真实凭证,零误报 |
| 云存储桶变体枚举 | `-cloud` | `target-dev`、`target-backup`、`target-infra` |
## 13. AI 集成
Approach 集成 Anthropic Claude API 用于两个独立目的:
### 范围解析(`-ai`)
在执行任何操作前,将 `program_brief.txt` 提交给 Claude:
```
# 保存程序简报
cat > program_brief.txt << 'EOF'
[Paste your HackerOne/Bugcrowd program brief here]
EOF
# 用 Claude 解析
./approach.sh -ai target.com
```
Claude 提取结构化的“一页范围说明”,涵盖:范围内资产、范围外资产、禁止测试类型、披露要求、奖励等级、技术栈提示、需避免的红旗以及推荐的首个攻击面。
### 侦察分类(`-triage`)
完成侦察后,在开始手动测试前运行 AI 分类:
```
./approach.sh -triage target.com
```
Claude 接收你的活跃主机、开放端口、DNS 记录、GF 分类摘要与 Nuclei 结果,返回优先级最高的 5 个攻击面及具体测试步骤、暗示薄弱环节的模式,以及你可能遗漏的内容。
两者均需:
```
export ANTHROPIC_API_KEY="your_key_here"
# 或在 approach.sh 中的配置块中设置
```
## 14. Discord 通知
在配置块中设置你的 Webhook URL,即可接收实时关键告警:
```
NOTIFY_DISCORD_WEBHOOK="https://discord.com/api/webhooks/YOUR/WEBHOOK"
```
对以下情况自动通知:区域传输成功、无 SPF/DMARC、存在可接管子域名、CORS 携带凭证、空 Origin CORS 绕过、403 绕过、暴露关键服务(Elasticsearch、Redis、MongoDB、Docker)、开放云存储桶、已验证 GitHub 密钥、排列净新增发现。
## 15. 工作流指南
**对新目标的推荐顺序:**
```
# 1. 先解析范围 — 在接触任何内容之前
./approach.sh -ai target.com
# 2. 情报收集(你在与谁打交道?)
./approach.sh -asn -whois -dns target.com
# 3. 资产发现
./approach.sh -sb -perm target.com
# 4. 技术指纹 + 端口扫描
./approach.sh -waf -ps target.com
# 5. 表面映射
./approach.sh -url -js -D -param target.com
# 6. 漏洞信号
./approach.sh -gf -cors -403 -tko -vuln target.com
# 7. 情报与泄露
./approach.sh -check -cloud -shodan target.com
# 8. 在手动测试前进行 AI 分类
./approach.sh -triage target.com
# 9. 生成报告
./approach.sh -report target.com
```
**或一次性运行全部(需授权确认):**
```
./approach.sh -full target.com
```
## 16. 附加资源
- [`basic_approach.md`](basic_approach.md) — 手动测试技巧与速查命令
- [`permutations.txt`](permutations.txt) — 排列暴力破解词表
**GF 模式:**
- 安装 GF 模式:`git clone https://github.com/1ndianl33t/Gf-Patterns ~/.gf`
**Nuclei 模板:**
- 官方:`nuclei -update-templates`
- 社区:[https://github.com/projectdiscovery/nuclei-templates](https://github.com/projectdiscovery/nuclei-templates)
**解析器:**
- [trickest/resolvers](https://github.com/trickest/resolvers) — 每日更新,使用 `resolvers.txt`
**显著说明:**
## 17. 法律免责声明
**本工具仅限授权安全测试使用。**
仅在你拥有明确书面授权的目标上使用 Approach — 通过漏洞赏金计划(如 HackerOne、Bugcrowd、Intigriti 等)或已签署的渗透测试协议。
未经授权对未获许可的系统使用本工具在大多数司法管辖区属违法行为,可能导致刑事起诉。
作者不对本工具的任何误用承担责任。你必须确保你的测试已获授权、在范围内并符合相应计划的操作规则。
**阅读程序简介。保持在范围内。负责任地披露。**
使用 💀 构建,由 [Prakhar0x01](https://github.com/prakhar0x01) 编写
*若此工具为你节省时间,请为仓库加星。*
标签:amass, bash脚本, dirsearch, ESC6, httpx, HTTP探测, SEO, shell脚本, subfinder, 使用教程, 侦察框架, 域枚举, 子域名枚举, 安全测试, 应用安全, 开发环境, 技术栈, 攻击性安全, 数据统计, 日志审计, 端口扫描, 系统安全, 网络安全, 自动化侦察, 自动化流程, 逆向工具, 配置指南, 隐私保护