Cyber-note/Full-Bug-Bounty-Hunting-Methodology-2026
GitHub: Cyber-note/Full-Bug-Bounty-Hunting-Methodology-2026
一套系统化的 2026 年 Web 应用程序漏洞赏金挖掘与红队侦察方法论,将攻击面发现按情报操作逻辑划分为十三个递进阶段。
Stars: 324 | Forks: 65
# 🕵️♂️ 完整的漏洞赏金挖掘与红队方法论 2026
由 Cybernote 创建,一名有志向的红队操作员和漏洞赏金猎人。此仓库记录了我在 Web 应用程序安全测试中的方法论、笔记和工作流程。
## 理念
大多数猎人将 Recon(侦察)视为一份清单。而我将其视为一次**情报行动**。
目标不是运行每一个工具——而是比任何人都更快、更深入地映射完整的攻击面。每一个阶段都在为下一个阶段提供养料。每一个发现都是一个转折点。
此方法论按**信噪比**排序:从广泛和被动开始,然后在你发送任何 exploit 之前进行积极地缩小范围。
## 📌 目录
1. [阶段 1 — 被动子域名枚举](#phase-1--passive-subdomain-enumeration)
2. [阶段 2 — 主动子域名枚举与爆破](#phase-2--active-subdomain-enumeration--bruteforce)
3. [阶段 3 — 基础设施映射(ASN / CIDR / IP)](#phase-3--infrastructure-mapping-asn--cidr--ips)
4. [阶段 4 — WAF 绕过与源站 IP 发现](#phase-4--waf-bypass--origin-ip-discovery)
5. [阶段 5 — 合并、解析与存活主机检测](#phase-5--merge-resolve--alive-host-detection)
6. [阶段 6 — 虚拟主机枚举](#phase-6--virtual-host-enumeration)
7. [阶段 7 — URL 与 Endpoint 发现](#phase-7--url--endpoint-discovery)
8. [阶段 8 — JavaScript 分析与机密信息提取](#phase-8--javascript-analysis--secret-extraction)
9. [阶段 9 — 目录与敏感文件发现](#phase-9--directory--sensitive-file-discovery)
10. [阶段 10 — GitHub 与源代码情报](#phase-10--github--source-code-intelligence)
11. [阶段 11 — 端口扫描与服务指纹识别](#phase-11--port-scanning--service-fingerprinting)
12. [阶段 12 — 自动化漏洞扫描](#phase-12--automated-vulnerability-scanning)
13. [阶段 13 — 子域名接管检测](#phase-13--subdomain-takeover-detection)
14. [字典参考](#wordlists-reference)
15. [OSINT 平台参考](#osint-platforms-reference)
## ⚙️ 前置条件与环境
在执行以下命令之前,请确保你的环境变量已被正确导出:
```
export DNS_WORDLIST="/path/to/subdomains-wordlist.txt"
export WEB_WORDLIST="/path/to/directories-wordlist.txt"
export GITHUB_TOKEN="your_github_personal_access_token"
export PDCP_API_KEY="your_projectdiscovery_chaos_key"
```
## 阶段 1 — 被动子域名枚举
### 核心工具
```
# subfinder — 快速的、基于 API 的被动枚举
subfinder -d target.com -all -recursive -o subs_subfinder.txt
# assetfinder — 查找相关域名和子域名
echo target.com | assetfinder -subs-only > subs_assetfinder.txt
# amass — 深度 OSINT 引擎
amass enum -d target.com -o subs_amass.txt
amass enum -d target.com -brute -w $DNS_WORDLIST -o subs_amass_brute.txt
# findomain — 多源被动侦察
findomain -t target.com -u subs_findomain.txt
# chaos — ProjectDiscovery 的精选数据集(需要 API key)
export PDCP_API_KEY=YOUR_KEY
chaos -d target.com -o subs_chaos.txt
# github-subdomains — 挖掘开发者代码以寻找隐藏的 endpoint
github-subdomains -d target.com -t $GITHUB_TOKEN -o subs_github.txt
```
### 证书透明度(SSL)
最被低估的被动来源之一——签发的每一个 SSL 证书都是公开记录。
```
curl -s "https://crt.sh/?q=%25.target.com&output=json" \
| jq -r '.[].name_value' \
| sed 's/\*\.//g' \
| tr ',' '\n' \
| grep -oE "[A-Za-z0-9._-]+\.target\.com" \
| sort -u > subs_crt.txt
```
### 聚合工具(一次性运行所有内容)
```
# subenum — 一键封装多个工具
./subenum.sh -d target.com \
-u wayback,crt,abuseipdb,Findomain,Subfinder,Amass,Assetfinder \
-o subs_subenum.txt
# 针对目标列表
./subenum.sh -l targets.txt \
-u wayback,crt,abuseipdb,Findomain,Subfinder,Amass,Assetfinder \
-o subs_subenum.txt
```
## 阶段 2 — 主动子域名枚举与爆破
### DNS 爆破
```
# puredns — 使用公共解析器的高速 DNS 解析
sudo wget -q https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txt
puredns bruteforce $DNS_WORDLIST target.com -r resolvers.txt -o subs_puredns.txt
# dnsx — 带有 wildcard 过滤的轻量级 DNS 解析器
dnsx -silent -d target.com -w $DNS_WORDLIST -o subs_dnsx.txt
# dnscan — 基于 Python,适用于更慢、更隐蔽的扫描
python dnscan.py -d target.com -w $DNS_WORDLIST -t 300 | tee subs_dnscan.txt
```
### 子域名排列与预测
```
# gotator — 从已知子域名生成排列组合
gotator -sub subs_all.txt -perm permutations.txt -depth 1 -numbers 3 -md | sort -u > subs_permuted.txt
# 由 puredns 解析它们
puredns resolve subs_permuted.txt -r resolvers.txt -o subs_permuted_alive.txt
```
### 使用 ffuf 进行子域名 Fuzzing
```
# 标准子域名 fuzzing
ffuf -u https://FUZZ.target.com -w $DNS_WORDLIST -mc 200,301,302,403
# 连字符模式 (dev-target.com, api-target.com)
ffuf -u https://FUZZ-target.com -w $DNS_WORDLIST -mc 200,301,302,403
# 前缀模式 (www-old, www-beta, www-test)
ffuf -u https://FUZZwww.target.com -w $DNS_WORDLIST -mc 200,301,302,403
```
### 实时证书监控
```
# gungnir — 实时 certificate transparency 监控
gungnir -d target.com
```
## 阶段 3 — 基础设施映射(ASN / CIDR / IP)
### 步骤 1 — 查找 ASN
```
# asnmap — 将域名解析为 ASN
asnmap -d target.com
# 手动 whois 方法
dig target.com +short # get an IP first
whois | grep -i "origin\|as\|route"
# spk — 按名称查找公司的所有 ASN
spk -json -s "Tesla"
```
**Web 替代方案:**
- https://bgp.he.net — 按公司名称搜索
- https://bgp.tools — 清晰的界面
- https://asnlookup.com — 按组织名称、ASN 或 CIDR 搜索
### 步骤 2 — ASN 到 IP 范围(CIDR)
```
# asnmap — 直接提取 CIDR
asnmap -a AS33905 -silent
# 基于 whois 的方法 — 也从路由数据库中提取
whois -h whois.radb.net -- '-i origin AS33905' \
| grep -Eo "([0-9.]+){4}/[0-9]+" \
| sort -u > cidr_ranges.txt
# 强力操作:解析 CIDR 范围内每个 IP 的 PTR 记录
whois -h whois.radb.net -- '-i origin AS20461' \
| grep -Eo "([0-9.]+){4}/[0-9]+" \
| mapcidr -silent \
| dnsx -ptr -resp-only -retry 3 -silent > ptr_domains.txt
# metabigor — 从多个来源提取注册到组织的所有 IP
echo "Tesla" | metabigor net --org
echo "ASN33905" | metabigor net --asn
```
### 步骤 3 — CIDR 到单个 IP
```
# mapcidr — 将 CIDR 干净地拆分为单个 IP
echo 10.10.10.0/24 | mapcidr
# prips — 为范围生成完整的 IP 列表
prips 2.18.48.0/21 > ips_asn.txt
```
### 步骤 4 — IP 范围的反向 DNS
```
# dnsx PTR — 从 IP 块解析主机名
echo 66.211.170.0/23 | dnsx -silent -resp-only -ptr
# hakrevdns — 大规模反向 DNS
hakrevdns -d target.com -R resolvers.txt
# resolveDomains — 检查子域名是否解析为存活 IP
resolveDomains -d all_subs.txt > resolved.txt
awk '{print $3}' resolved.txt | sort -u > unique_ips.txt
```
### TLD 扩展
```
# tldbrute — 发现所有已注册的 TLD 变体
tldbrute -d target.com
# 完整的 IANA TLD 列表方法
wget -q https://data.iana.org/TLD/tlds-alpha-by-domain.txt
cat tlds-alpha-by-domain.txt \
| tr '[:upper:]' '[:lower:]' \
| while read t; do echo "target.$t"; done \
| httpx -mc 200 > tlds_alive.txt
# 在子域名列表中应用相同的逻辑
cat all_subs.txt | while read sub; do
cat tlds-alpha-by-domain.txt \
| tr '[:upper:]' '[:lower:]' \
| sed "s/^/$sub./"
done | dnsx -silent > subs_tld_expanded.txt
```
## 阶段 4 — WAF 绕过与源站 IP 发现
### 方法 1 — Favicon Hash(最可靠)
公司在其所有基础设施中重复使用相同的 favicon。该 hash 是一个你可以在 Shodan 中搜索的指纹。
```
# favUp — 通过 favicon hash + Shodan 查找源 IP
python3 favUp.py -ff favicon.ico --shodan-cli
python3 favUp.py --web target-behind-cloudflare.com -sc
# favirecon — 轻量级 favicon 侦察
favirecon -u https://target.com/ -v
# FavFreak — 识别子域名列表中唯一的 favicon hash
# 任何具有不同 hash 的 = 不同的基础设施 = 值得调查
cat subs.txt | python3 favfreak.py
```
**手动方法:**
1. 访问 https://favicons.teamtailor-cdn.com/ → 粘贴目标 URL → 获取 favicon
2. 访问 https://favicon-hash.kmsec.uk/ → 粘贴 favicon URL → 获取 hash
3. 搜索 Shodan:`http.favicon.hash:-382492124`
**如果某个 IP 返回了你目标的 favicon 但不是 Cloudflare 的 IP → 那就是你的源站服务器。**
### 方法 2 — 历史 DNS 记录
```
# originiphunter — 查询多个来源的历史 IP
echo "target.com" | originiphunter
cat domains.txt | originiphunter
```
**用于查找历史 IP 的 OSINT 来源:**
- https://securitytrails.com — DNS 历史记录
- https://viewdns.info/reverseip/ — 反向 IP 查询
- https://search.censys.io — 搜索 `parsed.names: target.com`
- https://www.shodan.io — 搜索 `ssl.cert.subject.cn:target.com`
- https://netlas.io — 深度基础设施搜索
### 方法 3 — Google Analytics ID
```
# 发现 ID 和关联域名
cat subdomains.txt | analyticsrelationships
# 手动查找
# https://builtwith.com/relationships/target.com
# https://api.hackertarget.com/analyticslookup/?q=target.com
# https://api.hackertarget.com/analyticslookup/?q=UA-16316580
```
## 阶段 5 — 合并、解析与存活主机检测
### 合并所有子域名来源
```
cat subs_*.txt ptr_domains.txt subs_permuted_alive.txt \
| anew \
| tee all_subs.txt
wc -l all_subs.txt
```
### 使用 httpx 进行存活主机检测
```
# 基础 — 只获取存活主机
cat all_subs.txt | httpx -silent -o alive_subs.txt
# 丰富 — 状态码、标题、web server、响应大小
cat all_subs.txt | httpx \
-status-code -content-length -web-server -title \
-follow-redirects -o alive_enriched.txt
# 按状态过滤 — 只要 200
cat all_subs.txt | httpx -status-code -follow-redirects -match-code 200
# 过滤掉干扰 — 排除 400
cat all_subs.txt | httpx -status-code -follow-redirects -filter-code 400
# 响应码逻辑
# 404 → 尝试 waybackurls + fuzzing
# 403 → 尝试绕过技术
```
### 可视化侦察 — 截取所有内容
```
# gowitness — 截取所有存活主机的屏幕截图
gowitness file -f alive_subs.txt -P ./screenshots/ --no-http
# eyewitness — 带报告功能
python3 EyeWitness.py -f alive_subs.txt --web -d ./eyewitness_output
```
### CMS 检测
```
# whatweb — 指纹识别 CMS 和技术
whatweb -i alive_subs.txt -a 3 -t 50 --log-brief=cms_results.txt
# wappalyzer CLI — 技术栈指纹识别
wappalyzer https://target.com
```
## 阶段 6 — 虚拟主机枚举
```
# 在发现的 IP 上对内部 virtual hosts 进行 Fuzz
ffuf -u http:// \
-w $DNS_WORDLIST \
-H "Host: FUZZ.target.com" \
-fs 0 \
-mc 200,301,302,401,403
# HTTPS 变体
ffuf -u https://target.com \
-w $DNS_WORDLIST \
-H "Host: FUZZ.target.com" \
-mc 200,301,302,401,403
```
### 访问 VHOST 目标
```
# 方法 1 — 直接使用带 Host header 的 curl
curl -H "Host: dev.target.com" http://
# 方法 2 — /etc/hosts 注入(用于浏览器访问)
sudo nano /etc/hosts
# 添加:23.7.244.99 dev.target.com internal.target.com admin.target.com
# 然后在浏览器中打开:http://dev.target.com
# 尝试 OWASP Top 10:IDOR、Auth、Logic、API 滥用
```
### 通过 SSL 证书将 IP 解析为主机名
```
# hosthunter — 从 IP 列表上的 SSL 证书中提取主机名
python3 hosthunter.py ips.txt
# httpx — 检查哪些 IP 提供 web 内容
cat ips.txt | httpx -ports 80,443,8080,8000,8888 -status-code -title
```
## 阶段 7 — URL 与 Endpoint 发现
### 历史 URL 收集
```
# waybackurls
cat alive_subs.txt | waybackurls > urls_wayback.txt
# waymore — 更智能,按日期过滤并限制结果
waymore -i alive_subs.txt -mode U -l 1000 -from 2021 -oU urls_waymore.txt
# gau — 从多个来源聚合
cat alive_subs.txt | gau --threads 200 > urls_gau.txt
# gauplus — 改进的 gau
gauplus -t 200 -random-agent < alive_subs.txt > urls_gauplus.txt
```
### 主动爬取
```
# katana — 现代的感知 JS 的爬虫(综合最佳)
katana -u alive_subs.txt \
-jc -kf all -d 5 \
-headless -fx -aff \
-fs rdn -f url -silent > urls_katana.txt
# gospider
gospider -S alive_subs.txt -t 20 -d 3 --js --sitemap --robots -o ./gospider_output/
gospider -S alive_subs.txt \
| sed -n 's/.*\(https:\/\/[^ ]*\)]*.*/\1/p' >> urls_gospider.txt
# hakrawler
cat alive_subs.txt | hakrawler -subs -u -insecure > urls_hakrawler.txt
```
### 参数发现
```
# paramspider — 从 Wayback 数据中查找参数
paramspider -d target.com -o urls_params.txt
# x8 — 通过 HTTP 响应比较发现隐藏参数
x8 -u "https://target.com/endpoint" -o urls_x8.txt
```
### 合并所有 URL
```
cat urls_wayback.txt urls_waymore.txt urls_gau.txt urls_gauplus.txt \
urls_katana.txt urls_gospider.txt urls_hakrawler.txt urls_params.txt \
| anew \
| tee all_urls.txt
wc -l all_urls.txt
```
### 提取高价值 URL 分类
```
# JavaScript 文件
cat all_urls.txt | grep -iE '\.js(\?|$)' | grep -iv '\.json' | sort -u > js_urls.txt
# API endpoint
cat all_urls.txt | grep -Ei '\.(json|xml|graphql|gql)(\?|$)' > api_urls.txt
# 后端文件 (PHP, ASP, JSP)
cat all_urls.txt | grep -Ei '\.(php|asp|aspx|jsp|cfm|cgi)(\?|$)' > backend_urls.txt
# 登录和 auth 流程
cat all_urls.txt | grep -Ei "login|signin|auth|oauth|reset|password" > auth_urls.txt
# 文件上传 endpoint
cat all_urls.txt | grep -Ei "upload|file|download|image|media" > upload_urls.txt
# 管理面板
cat all_urls.txt | grep -Ei "admin|dashboard|internal|manage" > admin_urls.txt
# 敏感文件扩展名
cat all_urls.txt | grep -Ei '\.(env|bak|config|sql|log)(\?|$)' > sensitive_urls.txt
# IDOR 候选(带数字 ID 的 URL)
cat all_urls.txt | grep -Ei '[0-9]{2,}' > idor_candidates.txt
# 开放重定向候选
cat all_urls.txt | grep -Ei "redirect|callback|goto|return|dest=|r=|u=|url=" > redirect_urls.txt
# 云凭证暴露
cat all_urls.txt | grep -Ei "aws|s3|bucket|gcp|azure|token|apikey|secret" > cloud_urls.txt
# 一次性获取所有感兴趣的内容
cat all_urls.txt | urinteresting
```
### 提取与过滤参数
```
# 提取所有带参数的 URL
cat all_urls.txt | grep "=" | anew params.txt
# 准备进行 fuzzing
cat all_urls.txt | grep "=" | qsreplace "FUZZ" | anew param_fuzz.txt
# 按参数名去重(移除值噪声)
cat all_urls.txt | grep '=' | sed 's/=[^&]*/=/g' | sort -u > params_clean.txt
# 使用 arjun 发现隐藏参数
arjun -i backend_urls.txt -o arjun_params.json
arjun -u https://target.com/endpoint -m POST
```
### 查找存活 URL
```
cat all_urls.txt | httpx -status-code -content-length -silent > live_urls.txt
```
## 阶段 8 — JavaScript 分析与机密信息提取
### 从 JS 中提取机密信息
```
# subjs — 从 URL 列表中提取 JS 文件
cat all_urls.txt | subjs | tee js_files.txt
# mantra — 基于 regex 的 JS 密钥扫描器
cat js_urls.txt | mantra
# jsecret — 在 JS 文件中查找敏感模式
cat js_urls.txt | jsecret
# jsleak — 并发 JS 密钥扫描器
cat js_urls.txt | xargs -P 20 -I {} \
jsleak -s -l -k -e {} >> jsleak_output.txt
# 对任何 JS 文件进行快速的 regex 扫描
grep -E "api[_-]?key|token|secret|password|bearer|client_id" target.js
```
### Source Map 利用
```
# 通过 Wayback 查找 .map 文件
curl -s "https://web.archive.org/cdx/search/cdx?url=*.target.com/*&collapse=urlkey&output=text&fl=original&filter=original:.*.js.map$"
# 下载并提取
wget https://target.com/static/app.js.map
node -e "
const map = require('./app.js.map');
map.sources.forEach((src, i) => {
require('fs').writeFileSync(src.split('/').pop(), map.sourcesContent[i]);
});
"
```
### TruffleHog — 深度 Git 历史扫描
```
# 扫描公共 GitHub 仓库(即使几分钟前删除也能找到密钥)
trufflehog git https://github.com/target/repo --results=verified
# 扫描整个组织
trufflehog github --org=target \
--token=$GITHUB_TOKEN \
--only-verified \
--threads=20 \
--json > trufflehog_target.json
# 扫描本地文件系统
trufflehog filesystem ./js_files/ --json > trufflehog_local.json
```
### LazyEgg
```
# 从 JS 文件中爬取并提取链接、API、IP
python lazyegg.py https://target.com
python lazyegg.py https://target.com/js/auth.js
# 与 waybackurls 结合以实现深度覆盖
waybackurls target.com \
| grep '\.js$' \
| awk -F '?' '{print $1}' \
| sort -u \
| xargs -I{} bash -c 'python lazyegg.py "{}" --js_urls --domains --ips' \
> lazyegg_output.txt
```
## 阶段 9 — 目录与敏感文件发现
### dirsearch
```
# 全功能目录扫描
dirsearch -u https://target.com \
-e php,asp,aspx,jsp,json,xml,txt,log,ini,cfg,conf,bak,old,backup,zip,tar,gz,rar,sql,swp,db \
-t 80 -r -R 3 \
--deep-recursive \
--random-agent \
--full-url \
-i 200,204,301,302,307,308,401,403 \
-x 404,500,502,503,504 \
-o dirsearch_results.txt
# 一次扫描所有存活子域名
dirsearch -l alive_subs.txt \
--full-url \
-e php,env,json,yaml,bak,zip,sql,conf \
-o dirsearch_all.txt
```
### ffuf
```
# 标准目录 fuzzing
ffuf -u https://target.com/FUZZ \
-w $WEB_WORDLIST \
-t 80 \
-e .html,.php,.asp,.aspx,.js,.json,.xml,.config,.bak,.old,.zip,.rar \
-mc 200,204,301,302,307,401,403 \
-of json -o ffuf_dirs.json
# 递归 fuzzing
ffuf -u https://target.com/FUZZ \
-w $WEB_WORDLIST \
-recursion -recursion-depth 3 \
-mc 200,204,301,302,307,401,403
# 403 绕过 — 尝试备用 header
ffuf -u https://target.com/admin \
-w https://github.com/Karanxa/Bug-Bounty-Wordlists/raw/main/403_header_payloads.txt \
-H "FUZZ" \
-mc 200,301,302
# 通过 IP header 伪造绕过 WAF
ffuf -u https://target.com/FUZZ \
-w $WEB_WORDLIST \
-H "X-Forwarded-For: 127.0.0.1" \
-H "X-Forwarded-Host: 127.0.0.1" \
-H "X-Custom-IP-Authorization: 127.0.0.1" \
-H "X-Original-URL: /FUZZ" \
-mc 200,301,302,307,401
# 智能自动校准(击败 wildcard 200 响应)
ffuf -u https://target.com/FUZZ \
-w $WEB_WORDLIST \
-mc all -fc 404 -ac -sf -s
```
### feroxbuster
```
feroxbuster -u https://target.com \
-w $WEB_WORDLIST \
-t 300 -k -d 3 \
-x php,html,json,js,log,txt,bak,old,zip,tar,gz
```
### Wayback 敏感文件挖掘
```
# 定义明确的敏感文件模式 — 在每个目标上运行
waybackurls https://target.com \
| grep -E "\.(xls|xlsx|csv|sql|db|bak|backup|old|tar\.gz|tgz|zip|7z|rar|pdf|pem|key|crt|env|json|yml|yaml|conf|config|git|htpasswd|log|dump|DS_Store)" \
| sort -u > sensitive_wayback.txt
```
### 备份文件检查器
```
# bfac — 查找意外暴露的备份文件
bfac --url https://target.com \
--detection-technique all \
--level 3 \
--exclude-status-codes 404,500
```
### GitHub Endpoint — 查找泄露的 API 路径
```
# github-endpoints — 挖掘开发者仓库中的内部路径
github-endpoints -q -k -d target.com -t $GITHUB_TOKEN
# 示例发现:var api_url = "https://dev-test.target.com/api/v1/debug"
```
### Robots.txt 历史记录
```
# roboxtractor — 检索历史 robots.txt 以查找隐藏路径
cat alive_subs.txt | roboxtractor -m 1 -wb
```
### 从 404 到黄金 — 历史页面恢复
```
# 步骤 1:收集历史 URL
waybackurls https://target.com | grep "webstat" > old_pages.txt
# 步骤 2:检查 Wayback Machine 快照
# https://web.archive.org/web/*/https://target.com/webstat/*
# 步骤 3:重新爬取该路径周围链接的资源
gospider -s https://target.com -a -r \
| grep -oE 'https?://[^[:space:]"]+' \
| grep "/webstat/"
```
### Google 表格泄露狩猎
```
# 组织意外暴露了内部表格
site:*.target.com intext:"docs.google.com/spreadsheets"
site:docs.google.com/spreadsheets "target.com"
site:docs.google.com/spreadsheets "@target.com"
site:docs.google.com/spreadsheets "password" "target.com"
```
## 阶段 10 — GitHub 与源代码情报
### GitDorker — 针对性 GitHub 搜索
```
python3 GitDorker.py \
-tf $GITHUB_TOKEN \
-q target.com \
-d dorks/medium_dorks.txt \
-o gitdorker_results.txt
# 也可以使用在元数据中发现的员工姓名进行搜索
python3 GitDorker.py -tf $GITHUB_TOKEN -q "john.doe@target.com" -d dorks/medium_dorks.txt
```
**Dork 资源:**
- https://github.com/Proviesec/github-dorks
- https://mr-koanti.github.io/github.html
### TruffleHog — 已验证的机密信息检测
```
# 扫描组织 — 即使在已删除的 commit 中也能找到密钥
trufflehog github \
--org=target \
--token=$GITHUB_TOKEN \
--only-verified \
--threads=20 \
--json > trufflehog_target.json
# Docker 变体
docker run --rm -it trufflesecurity/trufflehog:latest \
github --only-verified --org=target
```
### shhgit — 实时 GitHub 监控
```
# 全局监控常见的密钥模式
shhgit --search-query \
'path:*.env OR "DB_PASSWORD=" OR "AWS_ACCESS_KEY_ID=" OR "-----BEGIN RSA PRIVATE KEY-----"'
# 实时监控特定的目标组织
shhgit --search-query \
'target.com (path:*.env OR "DB_PASSWORD=" OR "api_key=")'
```
### git-wild-hunt — 文件扩展名搜索
```
# 在目标的仓库中查找特定文件类型
python git-wild-hunt.py -s "org:Target extension:json filename:creds language:JSON"
python git-wild-hunt.py -s "org:Target extension:sql filename:backup"
python3 git-wild-hunt.py -s "target.com gitlab_token"
```
### GitLab — 私有基础设施
```
# 发现 GitLab 实例
# 尝试:gitlab.target.com | git.target.com | code.target.com
# 使用找到的 token 进行认证
curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
"https://gitlab.target.com/api/v4/user"
# 列出可访问的项目
curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
"https://gitlab.target.com/api/v4/projects?membership=true&simple=true"
# 在所有可访问的仓库中进行深度密钥扫描
gitleaks detect \
--source https://gitlab.target.com \
--access-token $GITLAB_TOKEN -v
```
### 元数据提取
```
# metafinder — 下载公共文档并提取元数据
# 揭示:用户名、软件版本、内部文件路径、邮箱模式
metafinder -d "target.com" -l 10 -go -bi -ba -o metadata.txt
# 也可以在子域名上尝试
metafinder -d "dev.target.com" -l 10 -go -bi -ba -o metadata_dev.txt
```
**这为何重要:** PDF 的元数据可能会泄露 `C:\Users\john.doe\Projects\InternalAPI\` —— 这是一个用户名和项目名,你可以将其用于进一步的侦察。
## 阶段 11 — 端口扫描与服务指纹识别
### 步骤 1 — 快速端口扫描(Top 1000)
```
# naabu — 极快的基于 Go 的 port scanner
naabu -l unique_ips.txt \
-exclude-ports 80,443 \
-rate 2000 \
-o open_ports.txt
# 直接针对子域名列表
naabu -list alive_subs.txt -p - -rate 1000 -c 50 -o ports_full.txt
```
### 步骤 2 — 全端口扫描(65535)
```
naabu -l unique_ips.txt \
-p - \
-exclude-ports 80,443,8080,8000,8888 \
-o ports_fullscan.txt
```
### 步骤 3 — 服务版本检测
```
# nmap — 在发现的开放端口上进行版本 + 默认脚本扫描
nmap -sV -sC -iL open_ports.txt -oN nmap_versions.txt
# 在一个 pipeline 中结合 naabu + nmap
naabu -list unique_ips.txt -p - -rate 1000 -c 50 \
-nmap-cli 'nmap -sV -sC' \
-o ports_with_services.txt
```
### 步骤 4 — 针对服务的漏洞扫描
```
# nuclei — 扫描网络层漏洞
nuclei -l unique_ips.txt \
-t nuclei-templates/network/ \
-H "X-Forwarded-For: 127.0.0.1" \
-mhe 4 -rl 30 -es info
# Nessus (GUI) — 如果可用,将完整的 CIDR 范围提供给它
# 输入:2.18.48.0/21
# 让它扫描 CVE、配置错误和凭证问题
```
## 阶段 12 — 自动化漏洞扫描
### nuclei — CVE 与错误配置检测
```
# 扫描所有存活子域名的已知 CVE + 暴露
nuclei -l alive_subs.txt \
-t nuclei-templates/http/ \
-severity critical,high,medium \
-H "X-Forwarded-For: 127.0.0.1" \
-H "X-Forwarded: 127.0.0.1" \
-mhe 4 -rl 30 -es info \
-o nuclei_results.txt
# 专门针对暴露的模板
nuclei -l alive_subs.txt \
-t nuclei-templates/http/exposures/ \
-o nuclei_exposures.txt
# Tor proxy — 每次请求轮换 IP,绕过所有速率限制
nuclei -u https://target.com \
-p socks5://127.0.0.1:9050
```
### SQL 注入
```
# 在带参数的 URL 上使用 sqlmap
sqlmap -u "https://target.com/page.php?id=1" \
--dbs --banner --batch --random-agent
# 来自保存的请求文件(Burp 导出)
sqlmap -r request.txt --dbs --banner --batch --random-agent
```
### 子域名接管检查
请参阅 [阶段 13](#phase-13--subdomain-takeover-detection)。
### API Key 验证流水线
```
# 在 JS/JSON/config 文件中查找 API key,然后验证它们
echo "https://target.com" \
| gau \
| grep -E '\.js$|\.json$|\.xml$|\.env$|\.config$' \
| httpx -silent -mc 200 \
| parallel -j 50 "curl -s {} \
| grep -oP '(?:api[_-]?key|secret|token)[\"'\''']?\s*[:=]\s*[\"'\''']?([A-Za-z0-9_\-]{20,})' \
| tee -a api_keys.txt"
```
## 阶段 13 — 子域名接管检测
```
# subzy — 快速的接管扫描器
subzy run --targets all_subs.txt --hide_fails --vuln \
| grep -v -E "Akamai|available|\-"
# dnsx — 获取所有子域名的 CNAME 记录
dnsx -retry 3 -a -aaaa -cname -ns -ptr -mx -soa \
-resp -silent \
-l all_subs.txt \
| tee dns_records.txt
```
**需要寻找的内容:**
```
api.target.com [CNAME] clusters.heroku.com ← check if registered
help.target.com [CNAME] target.zendesk.com ← check if available
cdn.target.com [CNAME] storage.s3.amazonaws.com ← check bucket name
```
### 验证接管候选目标
```
# 深入调查可疑的子域名
dig help.target.com CNAME
# 检查 Google Dig Tool
# https://toolbox.googleapps.com/apps/dig/#TXT/
# 如果没有 TXT 记录 → 该子域名就可以被抢占了
```
### S3 接管流水线
```
subfinder -d target.com -silent \
| dnsx -silent -cname \
| grep "s3.amazonaws" \
| httpx -mc 404 \
| while read sub; do
aws s3 mb "s3://${sub#https://}" && echo "CLAIMED: $sub"
done
```
## 字典参考
| 用途 | 路径 |
|---|---|
| DNS — Top 100K | `/usr/share/wordlists/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt` |
| DNS — Jhaddix | `/usr/share/wordlists/seclists/Discovery/DNS/dns-Jhaddix.txt` |
| DNS — Top 1M | `/usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt` |
| DNS — CommonSpeak2 | `/usr/share/wordlists/commonspeak2-wordlists-master/subdomains/subdomains.txt` |
| DNS — Best | `sudo wget https://wordlists-cdn.assetnote.io/data/manual/best-dns-wordlist.txt` |
| Web — Large Dirs | `/usr/share/wordlists/seclists/Discovery/Web-Content/raft-large-directories.txt` |
| Web — Large Files | `/usr/share/wordlists/seclists/Discovery/Web-Content/raft-large-files.txt` |
| Web — Common | `/usr/share/wordlists/seclists/Discovery/Web-Content/common.txt` |
| Web — Medium | `/usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt` |
| 参数 | `/usr/share/wordlists/seclists/Discovery/Web-Content/burp-parameter-names.txt` |
## OSINT 平台参考
| 平台 | 主要用途 |
|---|---|
| https://securitytrails.com | DNS 历史记录,子域名数据 |
| https://shrewdeye.app | 快速被动子域名查找器 |
| https://netlas.io | 深度基础设施搜索 |
| https://urlscan.io | URL 和页面分析 |
| https://search.censys.io | 互联网范围的主机扫描 |
| https://www.shodan.io | IoT 和服务发现 |
| https://otx.alienvault.com | 威胁情报 |
| https://crt.sh | 证书透明度日志 |
| https://bgp.he.net | ASN 和 BGP 路由数据 |
| https://search.dnslytics.com/cidr | 基于 CIDR 的域名查询 |
| https://viewdns.info | 反向 IP 和 DNS 历史记录 |
| https://www.virustotal.com | 多源域名情报 |
| https://builtwith.com | 技术栈和 GA ID 查询 |
| https://api.hackertarget.com | 分析关系映射 |
| https://asnlookup.com | 按组织名称搜索 ASN |
| https://bgp.tools | 现代化 BGP/ASN 浏览器 |
| https://subdomainfinder.c99.nl | 快速子域名查询 |
| https://www.favihash.com | 手动 favicon hash 生成器 |
*方法论构建自真实实战。此处的每一个命令都已在实际目标上运行过。*
### 📄 许可证
基于 MIT 许可证授权。由 **Cybernote** 创建与维护 © 2026。
标签:Cutter, Docker部署, GitHub, meg, 信息安全, 实时处理, 密码管理, 数据展示, 日志审计, 红队, 资产测绘, 逆向工具