Go 工具,通过多个 OSINT 来源被动发现 WAF/CDN 背后的真实源站 IP,然后通过 HTML 相似度、SSL 证书指纹和 HTTP 头验证候选 IP。
Unwaf 是一款 Go 工具,旨在通过被动技术帮助识别 WAF 绕过。它通过结合多种发现方法,并通过 HTML 相似度比较、SSL 证书指纹和 HTTP 头分析来验证候选 IP,从而自动化发现 WAF/CDN 背后真实源站 IP 的过程。
Unwaf 将我在这篇 LinkedIn 帖子中解释的步骤自动化了:Passive WAF bypassing
当前版本:3.0.0 — 版本历史请参阅 CHANGELOG.md。
curl 验证命令。go install github.com/mmarting/unwaf@latest
unwaf -h
检查一个域名(仅使用免费方法,无需 API 密钥):
unwaf -d example.com
裸域名和完整 URL 均可使用:
unwaf -d https://example.com/path
使用手动保存的 HTML 文件进行检查(当 WAF 阻止该工具时很有用):
unwaf -d example.com -s original.html
降低相似度阈值以捕获部分匹配:
unwaf -d example.com -t 40
提高并发数以加快扫描速度:
unwaf -d example.com -w 100
详细模式以查看每个解析的子域名/IP:
unwaf -d example.com -v
用于自动化的静默模式 — 仅输出 IP,每行一个:
unwaf -q -d example.com
用于自动化的 JSON 输出:
unwaf -d example.com --json
使用域名列表的批量模式:
unwaf -l domains.txt --json -o results.json
使用代理(Tor、Burp 等):
unwaf -d example.com --proxy socks5://127.0.0.1:9050
扫描绕过 IP 的 /24 邻居:
unwaf -d example.com --scan-neighbors
将请求速率限制为 2 次/秒,超时时间为 5 秒:
unwaf -d example.com --rate-limit 2 --timeout 5
# Feed into nuclei
unwaf -q -d target.com | nuclei -l - -t waf-bypass.yaml
# Feed into httpx
unwaf -q -d target.com | httpx -silent
# Batch recon
cat domains.txt | while read d; do unwaf -q -d "$d" | sed "s/^/$d,/"; done > results.csv
# JSON + jq
unwaf -d target.com --json | jq '.bypasses[].ip'
首次运行时,Unwaf 会创建 $HOME/.unwaf.conf,内容如下:
# Unwaf config file — API keys for optional discovery methods
# Free methods (SPF, MX, crt.sh, subdomains, OTX, RapidDNS, HackerTarget, Wayback) work without any keys.
# ViewDNS.info — DNS history (250 free requests, no credit card required)
viewdns=""
# SecurityTrails — DNS history (https://securitytrails.com/corp/api)
securitytrails=""
# Censys — SSL certificate search (requires a PAID license)
censys_token=""
censys_org_id=""
# AlienVault OTX — passive DNS (optional, raises rate limits)
otx_api_key=""
# Shodan — host search by SSL cert, hostname, favicon hash
shodan_api_key=""
# DNSDB/Farsight — historical DNS records (Community Edition: 500 queries/month free)
dnsdb_api_key=""
Martín Martín
根据 GPL v3 许可证 分发。
| 方法 | 类型 | 描述 |
|---|
| SPF 记录 | 免费 | 从 ip4:/ip6: SPF 机制中提取 IP |
| MX 记录 | 免费 | 解析邮件服务器主机名(跳过 Google/Microsoft 等) |
| 子域名探测 | 免费 | 解析 30 多个常见子域名(mail、dev、staging、cpanel、origin 等) |
| 证书透明度 | 免费 | 查询 crt.sh 获取所有子域名,解析为非 WAF IP |
| AlienVault OTX | 免费 | 被动 DNS 记录(可选 API 密钥可提高速率限制) |
| RapidDNS | 免费 | 通过 HTML 抓取进行子域名枚举 |
| HackerTarget | 免费 | 主机搜索 API(每天 50 次请求) |
| Wayback Machine | 免费 | 通过 CDX API 从存档 URL 中提取主机名 |
| WAF 检测 | 免费 | 通过 HTTP 头对 WAF 厂商进行指纹识别 |
| Favicon 哈希 | 免费 | 生成 MD5、SHA256 和 MMH3 哈希,用于 Shodan/Censys 搜索 |
| Shodan 主机搜索 | API(免费套餐) | 按 SSL 证书 CN、主机名和 favicon 哈希搜索(搜索需要会员资格) |
| SecurityTrails 历史 | API(免费套餐) | 历史 DNS A 记录(免费每月 50 次请求) |
| ViewDNS 历史 | API(免费套餐) | 历史 DNS A 记录(250 次免费请求) |
| Censys SSL 搜索 | API(付费) | 查找提供与域名匹配的 SSL 证书的主机 |
| DNSDB/Farsight | API(免费套餐) | 通过 NDJSON API 查询历史 DNS 记录(社区版:每月 500 次查询) |
| 方法 |
|---|
| 权重 |
|---|
| 描述 |
|---|
| HTML 相似度 | 60% | 与参考页面进行基于差异的文本比较 |
| SSL 证书 | 25% | 序列号(50%)、CN 匹配(25%)、SAN 重叠(25%) |
| HTTP 头 | 15% | Server、X-Powered-By 和 Set-Cookie 名称比较 |
| 状态码 | ±5-20% | 匹配加分,成功/错误不匹配扣分 |
| 标志 | 长标志 | 描述 | 默认值 |
|---|
-d | --domain | 要检查的域名 | (除非使用 -l,否则必填) |
-s | --source | 用于比较的源 HTML 文件 | — |
-c | --config | 配置文件路径 | $HOME/.unwaf.conf |
-t | --threshold | 相似度阈值百分比 | 60 |
-w | --workers | 并发工作线程数 | 50 |
-v | --verbose | 启用详细输出 | false |
-q | --quiet | 静默模式:仅输出绕过 IP | false |
--timeout | HTTP 超时(秒) | 10 | |
--rate-limit | 每秒最大 HTTP 请求数,0=无限制 | 0 | |
--proxy | 代理 URL(http:// 或 socks5://) | — | |
--scan-neighbors | 扫描已确认绕过 IP 的 /24 邻居 | false | |
--json | 以 JSON 格式输出结果 | false | |
-l | --list | 包含要检查域名的文件,每行一个 | — |
-o | --output | 将结果写入文件 | — |
--version | 打印版本并退出 | — | |
-h | --help | 显示帮助信息 | — |