recon-and-methodology

recon-and-methodology

热门

资产收集与渗透测试方法论手册。适用于对新目标进行资产梳理、接口/端点发现、技术栈指纹识别以及制定结构化的漏洞挖掘与测试计划。

1516Star
196Fork
更新于 2026/6/16
SKILL.md
只读
名称
recon-and-methodology
描述

资产收集与渗透测试方法论手册。适用于对新目标进行资产梳理、接口/端点发现、技术栈指纹识别以及制定结构化的漏洞挖掘与测试计划。

SKILL: Recon and Methodology — 资深漏洞赏金猎人实战手册

AI 加载指令:来自顶尖漏洞猎人的系统化侦查与挖洞方法论。涵盖子域名枚举、端点/接口发现、技术指纹识别,以及发现他人忽略漏洞的解题思维。核心要点:大多数高危漏洞源于系统化的覆盖面梳理,而非单纯依赖巧劲 Payload。


1. 侦查层级结构 (RECON HIERARCHY)

目标选择 (Target Selection)
└── 范围界定 (Scope Definition - 授权/赏金资产)
    └── 资产发现 (Asset Discovery - 子域名、IP、主域)
        └── 技术指纹识别 (Tech Fingerprinting - 运行组件)
            └── 端点发现 (Endpoint Discovery - 梳理攻击面)
                └── 漏洞测试 (Vulnerability Testing - 按漏洞类型分类)

2. 子域名枚举(关键第一步)(SUBDOMAIN ENUMERATION)

被动收集(不向目标发送 DNS 查询)

# Subfinder(聚合多数据源):
subfinder -d target.com -o subdomains.txt

# Amass 被动模式:
amass enum -passive -d target.com

# Certsh(证书透明度日志查询):
curl -s "https://crt.sh/?q=%.target.com&output=json" | jq -r '.[].name_value' | sort -u

# SecurityTrails API, Shodan:
# Web: https://securitytrails.com/list/apex_domain/target.com

主动收集(DNS 爆破与解析)

# Massdns + 字典爆破:
massdns -r /path/to/resolvers.txt -t A -o S -w output.txt \
  <(cat wordlist.txt | sed 's/$/.target.com/')

# ffuf 用于子域名爆破:
ffuf -w subdomains-wordlist.txt -u https://FUZZ.target.com \
  -mc 200,301,302,403 -H "Host: FUZZ.target.com"

# DNSx 批量解析:
cat subdomains.txt | dnsx -a -resp -o resolved.txt

# 推荐字典:SecLists/Discovery/DNS/

虚拟主机发现 (Virtual Host Discovery)

# ffuf vhost 爆破模式:
ffuf -w wordlist.txt -u https://target.com \
  -H "Host: FUZZ.target.com" -mc 200,301,403

# gobuster vhost 模式:
gobuster vhost -u https://target.com -w wordlist.txt

3. 服务与端口发现 (SERVICE AND PORT DISCOVERY)

# 快速端口扫描(常用端口):
nmap -T4 -F target.com -oN ports.txt

# 对已解析的子域名进行全面扫描:
cat resolved_ips.txt | nmap -iL - --open -p 80,443,8080,8443,8888,3000,5000 -oG scan.txt

# httpx 用于 HTTP 服务存活性探测:
cat subdomains.txt | httpx -title -tech-detect -status-code -o live_hosts.txt

# masscan 大网段高速扫描:
masscan -p 80,443,8080,8443 10.0.0.0/8 --rate=1000

4. Web 技术栈指纹识别 (WEB TECHNOLOGY FINGERPRINTING)

# 使用 Wappalyzer(浏览器插件)或:
whatweb https://target.com

# httpx 开启指纹识别:
httpx -u https://target.com -tech-detect

# 手动检查响应头:
curl -sI https://target.com | grep -i "server\|x-powered-by\|x-generator\|cf-ray"

# 常见指纹来源:
- Server 响应头: nginx/1.18, Apache/2.4, IIS/10.0
- X-Powered-By 响应头: PHP/7.4, ASP.NET
- Cookies 字段: PHPSESSID (PHP), JSESSIONID (Java), _rails_session (Rails)
- HTML 注释: <!-- Drupal 9 -->
- Meta 标签生成器: <meta name="generator" content="WordPress 6.2">
- JS 前端框架文件: /static/js/angular.min.js

5. 端点 / 接口发现 (ENDPOINT DISCOVERY)

目录爆破 (Directory Brute Force)

# ffuf(速度最快):
ffuf -u https://target.com/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt \
  -mc 200,301,302,403 -t 50 -o dirs.txt

# Gobuster:
gobuster dir -u https://target.com -w wordlist.txt -x php,html,js,json

# feroxbuster(支持递归扫描):
feroxbuster -u https://target.com -w wordlist.txt -x php,html,txt -r

参数挖掘 (Parameter Discovery)

# Arjun(隐藏参数挖掘工具):
arjun -u https://target.com/api/endpoint

# x8:
x8 -u https://target.com/api/endpoint -w params-wordlist.txt

JS 源码提取 (JavaScript Source Mining)

# 从 JS 文件提取接口端点:
gau target.com | grep '\.js$' | httpx -mc 200 | xargs -I{} curl -s {} | \
  grep -oE '"/[a-zA-Z0-9/_-]+"' | sort -u

# LinkFinder:
python3 linkfinder.py -i https://target.com -d -o output.html

# GetAllURLs (gau):
gau target.com | sort -u > all_urls.txt

# Wayback URLs:
waybackurls target.com | sort -u > wayback_urls.txt

API 端点发现 (API Endpoint Discovery)

# 常见 API 路径爆破:
ffuf -u https://target.com/FUZZ -w /SecLists/Discovery/Web-Content/api/api-endpoints.txt

# Swagger/OpenAPI 探针测试:
test: /swagger.json /api-docs /openapi.json /v2/api-docs /.well-known/ /docs/

# GraphQL 探针测试:
test: /graphql /gql /v1/graphql /api/graphql

6. 源码资产收集 (SOURCE CODE RECON)

GitHub / GitLab 泄露排查

# trufflehog(搜索 Git 历史记录中的敏感凭据):
trufflehog git https://github.com/target-org/target-repo

# gitleaks:
gitleaks detect --source /path/to/cloned/repo

# GitHub 手动搜索语法:
# site:github.com "target.com" "api_key" OR "secret" OR "password"
# site:github.com "target.com" ".env" OR "config.php" OR "db_password"

# GitHub Dork 常用语法:
# "target.com" extension:env
# "target.com" filename:*.config password
# org:target-org secret OR password OR apikey

暴露的环境配置文件 (Exposed Environment Files)

# 检查常见暴露路径:
https://target.com/.env
https://target.com/.git/config
https://target.com/config.json
https://target.com/config.yaml
https://target.com/credentials.json
https://target.com/secrets.json
https://target.com/wp-config.php
https://target.com/backup.sql
https://target.com/backup.zip

7. zseano 测试方法论 (ZSEANO'S TESTING METHODOLOGY)

核心理念

  1. 深耕单一项目而非广撒网——彻底熟悉并掌握应用程序的业务逻辑
  2. 构建企业画像——梳理其技术栈、开发团队习惯与业务流程
  3. 关注死角与盲区——重点检查错误页面、管理员路径、历史遗留版本以及移动端 API
  4. 顺藤摸瓜分析过滤——如果输入在某处受到了过滤,说明底层必存在对应处理逻辑,极有可能被绕过

单页面 / 功能测试流程 (Testing Sequence)

针对每个输入点:
1. 测试无害 HTML 标签(如 <h2>、<img>) → 观察响应中是否原样反射?
2. 测试不完整标签 → 观察后端如何处理?(如 <iframe src=//evil.com )
3. 测试编码绕过 → 例如 %0d, %0a, %09, <%00
4. 观察最终输出(不只是 HTTP 响应) → 你的输入最终出现在渲染结果的什么位置?
5. 将相同的输入尝试于所有结构相似的页面(共享代码逻辑 → 共享潜在漏洞)
6. 检查移动端或 API 端点中是否存在同名参数(通常防御策略较弱)

参数深度解析 (Parameter Insights)

- 每个参数都在讲述一个故事:“服务端拿这个参数做了什么?”
- 文件名参数 (Filename) → 涉及到操作系统交互 → 路径穿越 (Path Traversal) / 命令注入 (CMDi)
- URL/地址参数 (URL/location) → 触发 HTTP 请求抓取 → 服务端请求伪造 (SSRF)
- 模板/HTML 参数 → 传入渲染函数 → 服务端模板注入 (SSTI)
- XML 字段 → 传递给解析器 → XML 外部实体注入 (XXE)
- SQL 过滤条件 → 参与数据库查询 → SQL 注入 (SQLi)
- 用户提交内容 → 存储至数据库 → 存储型 XSS

8. 漏洞赏金项目甄选与时间分配 (BUG BOUNTY PROGRAM TRIAGE)

高价值目标选择

✓ 选择资产范围广的项目(如 *.target.com)
✓ 选择对 P2/P3 级别漏洞正常计费付费的项目(不仅限于 RCE)
✓ 选择近期有技术栈架构调整的项目(技术迁移 = 产生新漏洞)
✓ 选择处于活跃开发阶段的项目(新功能上线 = 新增攻击面)
× 避开:长期未更新、仅包含已知 CVE 的老旧代码库(往往已被刷爆)
× 避开:限制极严、资产范围过于狭窄的项目(攻击面过小)

高概率漏洞功能聚焦优先级 (High-Value Feature Focus)

优先级 1:身份认证、密码重置、双因素认证 (2FA) → 导致账号劫持 (Account Takeover)
优先级 2:文件上传、个人资料编辑、API 接口 → 导致存储型 XSS、越权 (IDOR)
优先级 3:后台管理面板、用户管理功能 → 导致链路越权 (BFLA)、权限提升
优先级 4:支付流程、订阅服务 → 导致业务逻辑漏洞
优先级 5:导入/导出、模板渲染功能 → 导致 XXE、SSTI

9. Nuclei 模板自动化扫描 (NUCLEI TEMPLATES)

# 对目标运行所有模板:
nuclei -u https://target.com -t /nuclei-templates/ -o nuclei-results.txt

# 按特定分类扫描:
nuclei -u https://target.com -t cves/ -severity critical,high
nuclei -u https://target.com -t exposures/
nuclei -u https://target.com -t misconfiguration/

# 批量扫描子域名列表:
cat subdomains.txt | nuclei -t exposures/ -t misconfiguration/ -o exposed.txt

10. 常见配置错误 - 捡漏/快速出洞 (COMMON MISCONFIGURATIONS)

□ CORS 跨域配置错误: 带有 Access-Control-Allow-Origin: * 且允许 credentials → CSRF + 数据窃取
□ S3 Bucket 公开访问: curl https://target.s3.amazonaws.com/
□ 目录遍历 / 列表暴露: 响应体中包含 "Index of /"
□ .git 目录暴露: curl https://target.com/.git/config
□ .env 配置文件暴露: curl https://target.com/.env
□ 调试模式暴露: 生产环境泄露 Stack Trace 堆栈追踪(导致源码暴露)
□ 默认凭据: 管理后台存在 admin:admin、admin:password
□ phpinfo.php 页面暴露: curl https://target.com/phpinfo.php
□ 备份文件遗留: config.bak、database.sql.gz、app.zip
□ GraphQL 内省查询启用: POST /graphql {"query":"{__schema{types{name}}}"}
□ 后台管理入口暴露: /admin /manager /console /phpmyadmin /wp-admin

11. 常用工具速查表 (QUICK REFERENCE TOOLS)

分类 工具
子域名枚举 (Subdomain enum) subfinder, amass, massdns
端口扫描 (Port scan) nmap, masscan
HTTP 存活探测 (HTTP probe) httpx
目录爆破 (Dir brute) ffuf, feroxbuster, gobuster
JS 挖掘 (JS mining) LinkFinder, gau, waybackurls
敏感信息扫描 (Secret scan) trufflehog, gitleaks
参数 Fuzzing (Parameter fuzz) arjun, x8
漏洞扫描 (Vuln scan) nuclei
代理 / 抓包拦截 (Proxy/intercept) Burp Suite Pro
JWT 攻击 (JWT attacks) jwt_tool
SQL 注入 (SQLi) sqlmap
XSS 漏洞 (XSS) dalfox, XSStrike
SSRF 漏洞 (SSRF) SSRFmap, Gopherus

12. Java 中间件指纹矩阵 (JAVA MIDDLEWARE FINGERPRINT MATRIX)

中间件 (Middleware) 探测路径 (Detection Path) 核心特征与利用项 (Key Indicators)
Apache Tomcat /manager/html, /manager/status 默认弱口令: tomcat:tomcat, admin:admin
JBoss / WildFly /jmx-console/, /web-console/ JMX MBean 访问权、WAR 包部署
WebLogic /console/, /wls-wsat/ 7001/7002 端口上的 T3 协议、IIOP
Spring Boot Actuator /actuator/, /actuator/env, /actuator/heapdump JSON 接口列表、堆转储文件包含敏感凭据
Spring Boot (变体路径) /actuator/jolokia, /actuator/gateway/routes Jolokia JMX 桥接、Gateway 路由注入
Jenkins /script, /manage Groovy 脚本控制台、Cookie 中泄露 API Token
GlassFish /common/, /theme/ 4848 端口管理后台,默认空密码
Jetty /jolokia/ JMX 接口访问
Resin /resin-admin/ 管理后台入口

Spring Boot Actuator 漏洞利用优先级

/actuator/env          → 泄露环境变量(数据库凭据、API Key 等)
/actuator/heapdump     → 下载 JVM 内存堆转储 → 在内存数据中检索明文密码
/actuator/jolokia      → JMX 接口 → 可能通过 MBean 操作达成 RCE
/actuator/gateway/routes → Spring Cloud Gateway 路由 → SpEL 表达式注入 (CVE-2022-22947)
/actuator/configprops  → 获取所有配置属性详情
/actuator/mappings     → 获取所有 URL 路由映射(发现隐藏接口端点)
/actuator/beans        → 获取所有注册的 Spring Bean
/actuator/threaddump   → 线程转储(可能在堆栈信息中泄露 Session Token / 密钥)

13. 信息泄露检测清单 (INFORMATION LEAK DETECTION CHECKLIST)

版本控制与备份泄露 (Version Control & Backup Leaks)

/.git/HEAD                    → Git 源码仓库暴露
/.svn/entries                 → SVN 元数据泄露
/.svn/wc.db                   → SVN SQLite 数据库泄露
/.hg/requires                 → Mercurial 源码残留
/.bzr/README                  → Bazaar 源码残留
/.DS_Store                    → macOS 目录结构文件泄露

备份文件常见路径 (Backup File Patterns)

/backup.zip    /backup.tar.gz    /backup.sql
/wwwroot.rar   /www.zip          /web.zip
/db.sql        /database.sql     /dump.sql
/config.php.bak    /config.php~    /config.php.swp
/.config.php.swp   /wp-config.php.bak
/.env          /.env.bak         /.env.production

API 文档与调试端点 (API Documentation & Debug)

/swagger-ui.html              → Swagger/OpenAPI 交互式文档
/swagger-ui/                  → Swagger UI 界面
/api-docs                     → API 文档泄露
/graphql                      → GraphQL Playground 交互环境
/graphiql                     → GraphQL IDE 调试环境
/debug/                       → 调试端点暴露
/phpinfo.php                  → PHP 配置信息泄露
/server-status                → Apache 运行状态暴露
/server-info                  → Apache 服务器详细信息
/nginx_status                 → Nginx 运行状态暴露

云服务与基础设施 (Cloud & Infrastructure)

/.aws/credentials             → AWS 认证凭据泄露
/.docker/config.json          → Docker 镜像仓库认证凭据
/robots.txt                   → 禁止爬取路径(提示敏感路径清单)
/sitemap.xml                  → 站点全量 URL 列表
/crossdomain.xml              → Flash 跨域策略文件
/.well-known/      

<!-- truncated for translation batch; full body continues in source -->