关于 Red Team Tools and Methodology
面向安全研究人员的测试技能,整理了侦察、漏洞发现和漏洞赏金工作流,涵盖自动化流程与手动应用分析,并强调遵守项目范围。
主要功能
- 01子域名枚举与存活主机发现
- 02技术指纹识别与内容发现
- 03漏洞和 API 测试流程
- 04自动化 XSS 与侦察流程
- 05范围、速率限制和结果验证指引
适用场景
- 01梳理目标的子域名和存活主机
- 02发现后续测试所需的端点和技术
- 03扫描获准测试的目标以查找常见漏洞
- 04整理并验证漏洞赏金报告结果
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ davila7/ claude-code-templates --skill red-team-tools-and-methodology安装后在 Claude Code 中输入/red-team-tools-and-methodology确认已加载。
详细介绍
红队工具与方法论
目的
实现顶尖安全研究人员验证过的方法论和工具工作流,以高效开展侦察、漏洞发现和漏洞赏金狩猎。自动化常见任务,同时全面覆盖攻击面。
输入/前提条件
- 目标范围定义(域名、IP 范围、应用)
- 基于 Linux 的攻击机器(Kali、Ubuntu)
- 漏洞赏金计划规则与范围
- 已安装工具依赖项(Go、Python、Ruby)
- 各类服务的 API 密钥(Shodan、Censys 等)
输出/交付物
- 全面的子域名枚举结果
- 活跃主机发现与技术指纹识别
- 已识别的漏洞和攻击向量
- 自动化侦察流水线输出
- 用于报告的调查结果文档
核心工作流
1. 项目跟踪与信息收集
设置侦察跟踪:
# Create project structure
mkdir -p target/{recon,vulns,reports}
cd target
# Find acquisitions using Crunchbase
# Search manually for subsidiary companies
# Get ASN for targets
amass intel -org "Target Company" -src
# Alternative ASN lookup
curl -s "https://bgp.he.net/search?search=targetcompany&commit=Search"
2. 子域名枚举
全面发现子域名:
# Create wildcards file
echo "target.com" > wildcards
# Run Amass passively
amass enum -passive -d target.com -src -o amass_passive.txt
# Run Amass actively
amass enum -active -d target.com -src -o amass_active.txt
# Use Subfinder
subfinder -d target.com -silent -o subfinder.txt
# Asset discovery
cat wildcards | assetfinder --subs-only | anew domains.txt
# Alternative subdomain tools
findomain -t target.com -o
# Generate permutations with dnsgen
cat domains.txt | dnsgen - | httprobe > permuted.txt
# Combine all sources
cat amass_*.txt subfinder.txt | sort -u > all_subs.txt
3. 活跃主机发现
识别有响应的主机:
# Check which hosts are live with httprobe
cat domains.txt | httprobe -c 80 --prefer-https | anew hosts.txt
# Use httpx for more details
cat domains.txt | httpx -title -tech-detect -status-code -o live_hosts.txt
# Alternative with massdns
massdns -r resolvers.txt -t A -o S domains.txt > resolved.txt
4. 技术指纹识别
识别技术,以便实施有针对性的攻击:
# Whatweb scanning
whatweb -i hosts.txt -a 3 -v > tech_stack.txt
# Nuclei technology detection
nuclei -l hosts.txt -t technologies/ -o tech_nuclei.txt
# Wappalyzer (if available)
# Browser extension for manual review
5. 内容发现
查找隐藏的端点和文件:
# Directory bruteforce with ffuf
ffuf -ac -v -u https://target.com/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
# Historical URLs from Wayback
waybackurls target.com | tee wayback.txt
# Find all URLs with gau
gau target.com | tee all_urls.txt
# Parameter discovery
cat all_urls.txt | grep "=" | sort -u > params.txt
# Generate custom wordlist from historical data
cat all_urls.txt | unfurl paths | sort -u > custom_wordlist.txt
6. 应用分析(Jason Haddix 方法)
热区优先级:
- 文件上传 - 测试注入、XXE、SSRF、Shell 上传
- 内容类型 - 在 Burp 中筛选 multipart 表单
- API - 查找隐藏方法和缺少身份验证的情况
- 个人资料部分 - 存储型 XSS、自定义字段
- 集成 - 通过第三方服务实现 SSRF
- 错误页面 - 非常规注入点
分析问题:
- 应用如何传递数据?(参数、API、混合)
- 应用在哪些地方涉及用户?(UID、UUID 端点)
- 网站是否支持多租户或用户等级?
- 是否有独特的威胁模型?
- 网站如何处理 XSS/CSRF?
- 网站过去是否有公开的漏洞分析文章/漏洞利用?
7. 自动化 XSS 狩猎
# ParamSpider for parameter extraction
python3 paramspider.py --domain target.com -o params.txt
# Filter with Gxss
cat params.txt | Gxss -p test
# Dalfox for XSS testing
cat params.txt | dalfox pipe --mining-dict params.txt -o xss_results.txt
# Alternative workflow
waybackurls target.com | grep "=" | qsreplace '"><script>alert(1)</script>' | while read url; do
curl -s "$url" | grep -q 'alert(1)' && echo "$url"
done > potential_xss.txt
8. 漏洞扫描
# Nuclei comprehensive scan
nuclei -l hosts.txt -t ~/nuclei-templates/ -o nuclei_results.txt
# Check for common CVEs
nuclei -l hosts.txt -t cves/ -o cve_results.txt
# Web vulnerabilities
nuclei -l hosts.txt -t vulnerabilities/ -o vuln_results.txt
9. API 枚举
用于 API 模糊测试的词表:
# Enumerate API endpoints
ffuf -u https://target.com/api/FUZZ -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt
# Test API versions
ffuf -u https://target.com/api/v1/FUZZ -w api_wordlist.txt
ffuf -u https://target.com/api/v2/FUZZ -w api_wordlist.txt
# Check for hidden methods
for method in GET POST PUT DELETE PATCH; do
curl -X $method https://target.com/api/users -v
done
10. 自动化侦察脚本
#!/bin/bash
domain=$1
if [[ -z $domain ]]; then
echo "Usage: ./recon.sh <domain>"
exit 1
fi
mkdir -p "$domain"
# Subdomain enumeration
echo "[*] Enumerating subdomains..."
subfinder -d "$domain" -silent > "$domain/subs.txt"
# Live host discovery
echo "[*] Finding live hosts..."
cat "$domain/subs.txt" | httpx -title -tech-detect -status-code > "$domain/live.txt"
# URL collection
echo "[*] Collecting URLs..."
cat "$domain/live.txt" | waybackurls > "$domain/urls.txt"
# Nuclei scanning
echo "[*] Running Nuclei..."
nuclei -l "$domain/live.txt" -o "$domain/nuclei.txt"
echo "[+] Recon complete!"
快速参考
必备工具
| 工具 | 用途 |
|---|---|
| Amass | 子域名枚举 |
| Subfinder | 快速发现子域名 |
| httpx/httprobe | 活跃主机检测 |
| ffuf | 内容发现 |
| Nuclei | 漏洞扫描 |
| Burp Suite | 手动测试 |
| Dalfox | XSS 自动化 |
| waybackurls | 历史 URL 挖掘 |
要检查的关键 API 端点
/api/v1/users
/api/v1/admin
/api/v1/profile
/api/users/me
/api/config
/api/debug
/api/swagger
/api/graphql
XSS 过滤器测试
<h1><img><table>
<script>
%3Cscript%3E
%253Cscript%253E
%26lt;script%26gt;
限制
- 遵守计划的范围边界
- 未经许可,不要在生产环境中进行 DoS 或模糊测试
- 对请求进行速率限制,以避免被封锁
- 某些工具可能产生误报
- 某些工具需要 API 密钥才能充分发挥功能
示例
示例 1:快速子域名侦察
subfinder -d target.com | httpx -title | tee results.txt
示例 2:XSS 狩猎流水线
waybackurls target.com | grep "=" | qsreplace "test" | httpx -silent | dalfox pipe
示例 3:全面扫描
# Full recon chain
amass enum -d target.com | httpx | nuclei -t ~/nuclei-templates/
故障排除
| 问题 | 解决方案 |
|---|---|
| 受到速率限制 | 使用代理轮换,降低并发数 |
| 结果过多 | 聚焦于特定技术栈 |
| 误报 | 报告前手动验证调查结果 |
| 缺少子域名 | 结合多个枚举来源 |
| API 密钥错误 | 检查配置文件中的密钥 |
| 找不到工具 | 使用 go install 安装 Go 工具 |
评论
支持 Markdown