cc1a2b/HHunter
GitHub: cc1a2b/HHunter
HHunter 是一款专为安全专业人员打造的 HTTP Header 漏洞扫描引擎,通过智能变异和差异化分析发现基于 Header 的真实可利用漏洞。
Stars: 6 | Forks: 0
# HHunter
### 带外(OOB)检测
### 攻击类别(共 22 种)
### 专业报告与导出
## 安装
### Go Install(推荐)
```
# 安装 HHunter
go install -v github.com/cc1a2b/HHunter/cmd/hhunter@latest
# 验证安装
hhunter --help
```
### 从源码构建
```
git clone https://github.com/cc1a2b/HHunter.git
cd HHunter
go build -o hhunter ./cmd/hhunter
```
### 特定平台构建
```
# Linux
GOOS=linux GOARCH=amd64 go build -o hhunter-linux ./cmd/hhunter
# Windows
GOOS=windows GOARCH=amd64 go build -o hhunter.exe ./cmd/hhunter
# macOS
GOOS=darwin GOARCH=amd64 go build -o hhunter-darwin ./cmd/hhunter
```
### 系统要求
- **Go 1.23+**(用于从源码构建)
- **Linux、macOS 或 Windows**(64 位架构)
- 用于远程测试的**网络连接**
- **VPS**(可选,用于 OOB 回调服务器)
## 快速开始
### 基础测试
```
# 快速 auth bypass 测试
hhunter -u https://api.target.com/admin --auth
# 测试 proxy trust + CORS
hhunter -u https://api.target.com/internal --proxy --cors
# 全量扫描 — 全部 22 个类别
hhunter -u https://target.com/api --full
```
### 完整安全评估
```
# 带 HTML 报告的全量扫描
hhunter -u https://target.com/api --full --report report.html -o findings.json
# 带 blind vulnerability 检测的全量扫描
hhunter -u https://target.com/api --full --oob --oob-url http://your-vps:8888
# 从文件进行 Multi-target 扫描
hhunter -l urls.txt --full --report report.html
# 来自其他工具的 Pipeline 模式
cat urls.txt | hhunter --auth --proxy --injection --diff-only
```
## 使用示例
```
# Authentication bypass 测试
hhunter -u https://api.target.com/admin --auth --jwt
# 侧重 cloud metadata 的 SSRF hunting
hhunter -u https://target.com --ssrf --cloud
# Injection 测试 (SSTI, Log4Shell, SQLi, XSS)
hhunter -u https://target.com --injection
# CORS misconfiguration 检测
hhunter -u https://api.target.com/data --cors
# Cache poisoning 评估
hhunter -u https://target.com --cache --diff-only
# 带 OOB detection 的全面攻击性扫描
hhunter -u https://target.com/api --full --oob --oob-url http://vps:8888 -o results.json
# 带 body data 的 POST endpoint
hhunter -u https://api.target.com/login -m POST -d '{"user":"admin"}' --auth --injection
# 从 Burp 导入 raw request
hhunter --raw request.txt --auth --proxy --verify
# 通过 Burp Suite 带有 WAF evasion 的 Stealth 扫描
hhunter -u https://target.com --full --stealth --waf-evasion --proxy-url http://127.0.0.1:8080 -w 5
# 过滤噪音 — 仅保留 200 和 302 响应
hhunter -u https://target.com --full -ms 200,302
# Multi-target 并输出用于 CI/CD 的 SARIF
hhunter -l urls.txt --full --sarif results.sarif -q
# Privilege escalation hunting
hhunter -u https://api.target.com --auth --priv-check --diff-only
# 自定义 authenticated 测试
hhunter -u https://api.target.com/admin --auth -H "Authorization: Bearer eyJ..." -b "session=abc123"
```
## 命令参考
随时使用 `hhunter --help` 获取完整的帮助信息
```
Usage:
hhunter -u [options]
hhunter -l [options]
cat urls.txt | hhunter [options]
Target:
-u, --url URL Target URL
-l, --list FILE File containing URLs (one per line)
-m, --method METHOD HTTP method (default: GET)
-d, --data DATA Request body data
-ct CONTENT-TYPE Content-Type for request body
--raw FILE Raw HTTP request file (Burp format)
stdin Pipe URLs from other tools
Core Attack Categories:
--auth Authentication & authorization bypass
--proxy Proxy trust abuse (X-Forwarded-For, etc)
--cors CORS misconfigurations
--cache Cache poisoning & deception
--override HTTP method & URL override
--cloud Cloud/CDN/K8s header injection
--debug Debug mode & feature flag exposure
Advanced Attack Categories:
--smuggling HTTP request smuggling (CL-TE, TE-CL)
--injection Header injection (XSS, SSTI, Log4Shell, SQLi)
--ssrf SSRF via headers (metadata, internal services)
--hopbyhop Hop-by-hop header stripping attacks
--ratelimit Rate limit bypass techniques
--security Security header manipulation (CSP, HSTS)
--websocket WebSocket/gRPC/GraphQL probes
--jwt JWT attacks (alg:none, confusion, injection)
--crlf CRLF injection / HTTP response splitting
--cookie Cookie manipulation (fixation, tossing, overflow)
--content-type Content-Type abuse (MIME confusion, WAF bypass)
--redirect Open redirect via header manipulation
--protocol Protocol upgrade (h2c smuggling, HTTP/2)
--encoding Encoding/charset attacks (WAF bypass, Range)
--gateway API gateway/routing bypass (Kong, Envoy, etc)
Scan Control:
--full Run ALL categories + audit + recon + verify + chain
--audit Passive security audit (WAF, tech, headers)
--recon Reconnaissance (reflection, methods, host injection)
--verify Auto-verify high-confidence findings
--chain Chain multiple header mutations for combo attacks
--diff-only Only show significant differences
--priv-check Privilege escalation detection
--waf-evasion WAF bypass techniques (header case randomization)
--stealth Stealth mode (slower, more evasive)
OOB (Out-of-Band) Detection:
--oob Enable OOB callback server for blind vulns
--oob-addr ADDR OOB listen address (default: 0.0.0.0:8888)
--oob-url URL External OOB URL (e.g., http://your-vps:8888)
--oob-wait SEC Wait time for OOB callbacks (default: 10)
HTTP Configuration:
-w, --workers INT Concurrent workers (default: 30)
-r, --rate MS Rate limit delay in milliseconds
-t, --timeout SEC Request timeout in seconds (default: 30)
-H, --header "Key: Value" Custom header (repeatable)
-b, --cookies "key=val; ..." Cookie string
--proxy-url URL HTTP proxy (e.g., http://127.0.0.1:8080)
-fr, --follow-redirect Follow HTTP redirects
Matchers/Filters:
-ms, --match-status CODES Only process these status codes (e.g., 200,302)
-fs, --filter-status CODES Exclude these status codes (e.g., 404,500)
--match-size BYTES Only process responses of this size
--filter-size BYTES Exclude responses of this size
Output:
-o, --output FILE.json Output results to JSON file
--report FILE.html Generate HTML report
--sarif FILE.sarif Generate SARIF report (CI/CD)
-q, --quiet Suppress banner
--update, --up Update to latest version
-h, --help Show this help
```
## 高级用法
### 专业渗透测试
```
# 带报告的完整 header 安全评估
hhunter -u https://target.com/api --full --report audit.html -o findings.json
# VPS 上的 OOB blind vulnerability hunting
hhunter -u https://target.com --full --oob --oob-url http://your-vps:8888 --oob-wait 30 -o oob_findings.json
# 带有 WAF evasion 的 Stealth reconnaissance
hhunter -u https://target.com --full --waf-evasion --stealth -r 1000 -w 5 -q
# Burp Suite 集成工作流
hhunter --raw burp_request.txt --auth --proxy --injection --oob --proxy-url http://127.0.0.1:8080
# POST endpoint body 测试
hhunter -u https://api.target.com/login -m POST -d '{"username":"admin","password":"test"}' -ct application/json --auth --injection
```
### 漏洞赏金狩猎
```
# API endpoint 上的快速 recon + auth bypass
cat api_endpoints.txt | hhunter --auth --proxy --cors --jwt --diff-only -o bounty.json
# 在 cloud target 上带 OOB 的 SSRF hunting
hhunter -l cloud_targets.txt --ssrf --cloud --oob --oob-url http://vps:8888
# 带 HTML 报告的 high-value target 全量扫描
hhunter -u https://api.target.com --full --report target_report.html --verify
# 带有 noise filtering 的 Injection hunting
hhunter -u https://target.com --injection --ssrf -fs 403,429,500 --diff-only
```
### 企业与 CI/CD 集成
```
# CI/CD pipeline — 遇到 Critical/High findings 时失败
hhunter -u https://staging.company.com/api --full -q --sarif results.sarif -o findings.json
# 如果检测到 Critical/High findings 则 Exit code 1
# 自动化 multi-target 扫描
hhunter -l production_endpoints.txt --auth --proxy --cors --cache -q -o weekly_scan.json
# GitHub Code Scanning 集成
hhunter -u https://api.company.com --full --sarif results.sarif -q
# 上传 results.sarif 到 GitHub Security tab
```
## 检测类别
### 身份验证绕过(173 种变体)
- JWT none/None/NONE 算法绕过、空签名、弱密钥签名
- JWT kid 目录遍历(/dev/null、/etc/passwd)、jku/x5u Header 投毒
- Bearer Token 篡改(null、undefined、admin、boolean、array、object)
- Basic Auth 默认凭证(admin:admin、root:root、test:test)
- 角色注入(X-Role、X-Admin、X-Privilege、X-Scope、X-ACL)
- 云身份伪造(AWS ALB OIDC、GCP IAP、Azure AD principal)
- Service Mesh 身份验证绕过(Envoy、Istio 属性)
- 通过 user/account/tenant/org ID Header 实现 IDOR
- 基于 Cookie 的身份验证绕过和 CSRF Token 绕过
### 通过 Header 实施 SSRF(198 种变体)
- AWS IMDSv1/v2 绕过、ECS 任务元数据、Lambda 运行时 API
- Azure 托管身份 OAuth2 Token(management、vault、storage、graph)
- 带有 Metadata-Flavor Header 的 GCP 元数据、服务账户 Token
- Kubernetes API 服务器、Secrets 枚举、etcd、kubelet
- Docker API(容器/镜像列表)
- 50+ 种内部端口(Redis、MongoDB、Elasticsearch、Consul、Vault、Prometheus 等)
- 20+ 种 IP 绕过技术(八进制、十六进制、十进制、IPv6 映射、URL 权威混淆)
- DNS 重绑定(nip.io、sslip.io、lvh.me、vcap.me、traefik.me)
- URL Scheme 攻击(gopher、file、dict)
- Webhook/回调 SSRF Header(X-Callback-URL、X-Webhook-URL、Destination)
### 注入引擎(148 种变体)
- 按模板引擎分类的 SSTI:Jinja2、Twig、Thymeleaf、Freemarker、Velocity、Pebble、Groovy、Blade、Handlebars
- Log4Shell:LDAP/LDAPS/DNS/RMI/IIOP/CORBA + 20+ 种 WAF 绕过混淆 + 环境变量渗透
- 基于时间的盲注 SQLi:MySQL (SLEEP, BENCHMARK)、PostgreSQL (pg_sleep)、MSSQL (WAITFOR)、Oracle (DBMS_PIPE)、SQLite
- 基于报错的 SQLi:EXTRACTVALUE、双查询、CONVERT
- 命令注入:分号、管道符、反引号、子 Shell、IFS 绕过、DNS 渗透
- XSS:script、svg、img、details、math 标签变体、动态导入
- NoSQL 注入($gt、$ne、$regex、$where)
- LDAP 注入、OGNL RCE、Java EL、原型链污染、GraphQL 内省
### CORS 错误配置(43 种变体)
- 带有和不带有凭证的任意 Origin 反射
- 通过沙盒 iframe 进行 Null Origin 利用
- 子域名绕过模式(victim.com.evil.com、evil.victim.com)
- URL 编码绕过(%40、%23、%60、%09、%0d、%0a)
- 协议方案绕过(data://、javascript://、vbscript://)
- Method 和 Header 扩展检测
### 缓存投毒(52 种变体)
- Host Header 注入和 X-Forwarded-Host 操控
- 通过未缓存键的 Header 进行缓存键投毒
- 特定 CDN 绕过(Cloudflare、Fastly、Akamai、Varnish)
- 缓存欺骗攻击
### 另外 16 个类别
方法覆盖、云/CDN、调试暴露、HTTP 走私、逐跳、速率限制绕过、安全 Headers、WebSocket、JWT、CRLF、Cookie、Content-Type、重定向、协议、编码、API 网关——均配有专用的变体集合。
## 贡献
我们欢迎您的贡献!以下是您可以提供帮助的方式:
- 通过 [GitHub Issues](https://github.com/cc1a2b/HHunter/issues) **报告 Bug**
- **提出功能建议**或新的攻击类别
- 为新兴攻击向量**添加变体**
- **提交 Pull Request** 进行改进
### 开发设置
```
git clone https://github.com/cc1a2b/HHunter.git
cd HHunter
go mod tidy
go build -o hhunter ./cmd/hhunter
```
### 项目结构
```
HHunter/
├── main.go # CLI entry point, flag parsing, scan orchestration
├── engine/
│ ├── orchestrator.go # Core scan engine, mutation testing, finding generation
│ ├── context.go # HTTP request execution, baseline profiling
│ ├── diff.go # Differential analysis, auth bypass, sensitive data detection
│ ├── similarity.go # Response similarity (LCS, structural, header comparison)
│ ├── dedup.go # Finding deduplication by root cause
│ ├── oob.go # Out-of-band callback server
│ ├── chain.go # Chained multi-header attack engine
│ ├── adaptive.go # Technology-adaptive mutation prioritization
│ ├── report.go # HTML and SARIF report generation
│ └── probes.go # Recon probes (reflection, methods, host injection)
├── headers/ # 15 mutation files (1100+ mutations)
│ ├── auth.go # 173 auth bypass mutations
│ ├── ssrf.go # 198 SSRF mutations
│ ├── injection.go # 148 injection mutations
│ ├── cors.go # 43 CORS mutations
│ └── ... # cache, cloud, debug, smuggling, jwt, crlf, etc.
└── detectors/ # Response analysis detectors
```
## 许可证
HHunter 基于 **MIT License** 发布。有关详细信息,请参阅 [LICENSE](LICENSE)。
```
Copyright (c) 2024-2026 Hussain Alsharman
Licensed under MIT License - free for commercial and personal use
```
## 支持
如果 HHunter 对您的安全研究或专业工作有所帮助:
[](LICENSE)
[](https://golang.org)
[](https://github.com/cc1a2b/HHunter/releases)
[](https://github.com/cc1a2b/HHunter/stargazers)
[](https://github.com/cc1a2b/HHunter/releases)
**高级 HTTP Header 漏洞扫描器**
*涵盖 22 个攻击类别、1100+ 种 payload 变体,支持 OOB 检测、自适应扫描和基于证据的报告,专为安全专业人员打造*
## 关于
**HHunter** 是一款为渗透测试人员和漏洞猎人构建的高级 HTTP Header 安全测试引擎。它通过智能 Header 变异和差异化响应分析来发现真正的漏洞——而不仅仅是信息收集。凭借 1100 多种攻击 payload 变体、带外(OOB)盲打漏洞检测、技术自适应扫描以及多 Header 链式攻击,HHunter 能够发现其他工具遗漏的漏洞。
*HHunter v0.1 — 通过 Header 变异分析发现真实漏洞*
## 目录
- [关于](#about)
- [功能特性](#features)
- [安装](#installation)
- [快速开始](#quick-start)
- [使用示例](#usage-examples)
- [命令参考](#command-reference)
- [高级用法](#advanced-usage)
- [检测类别](#detection-categories)
- [贡献](#contributing)
- [许可证](#license)
- [支持](#support)
## 功能特性
### 核心能力
- **身份验证绕过**:JWT none/kid/jku 攻击、Token 篡改、角色注入、云身份伪造(198 种变体)
- **通过 Header 实施 SSRF**:IMDSv2 绕过、Azure 托管身份 Token、GCP 元数据、K8s API/secrets、50+ 种内部服务(198 种变体)
- **注入引擎**:按引擎分类的 SSTI(Jinja2/Twig/Thymeleaf/Freemarker/Velocity/Pebble)、Log4Shell 20+ 种 WAF 绕过、盲注 SQLi、OGNL/EL(148 种变体)
- **CORS 利用**:Origin 反射、Null Origin、子域名绕过、Method/Header 扩展检测
- **缓存投毒**:Host Header 注入、X-Forwarded-Host、缓存键操控、CDN 绕过
- **OOB 检测**:内置回调服务器,用于确认盲打 SSRF、盲打 XSS、盲打 Log4Shell 和盲打 RCE
- **链式攻击**:跨 7 个战略配对类别的多 Header 组合变体
### 智能检测引擎
- **差异化分析**:统计基线分析(多样本)与语义响应比较
- **响应相似度**:基于 LCS 的 Body 比较、结构化 HTML/JSON 匹配、Header 集合分析——而不仅仅是哈希比较
- **技术自适应**:指纹识别服务器/语言/框架/WAF,然后优先处理相关的变体(例如对 PHP 目标使用 PHP payload)
- **上下文感知反射**:区分危险的反射上下文(JS、HTML 属性、未转义)与安全的上下文(JSON 字符串、CDN Header)
- **发现去重**:按根本原因(Header 系列 + 影响类型)对发现进行分组,保留最高置信度的实例,合并替代触发器
### 专业 HTTP 与网络套件
企业级网络配置
**请求配置:** - **自定义 Headers** (`-H`):可重复的自定义 HTTP Headers,用于经过身份验证的测试 - **请求 Body** (`-d`):POST/PUT Body 数据及 Content-Type 控制 (`-ct`) - **原始请求导入** (`--raw`):直接从 Burp Suite 导入请求 - **Cookie 支持** (`-b`):用于访问受保护端点的会话 Cookie - **HTTP 方法** (`-m`):测试任何 HTTP 方法(GET、POST、PUT、DELETE、PATCH 等) **性能与控制:** - **并发** (`-w`):可调整的工作线程(默认:30) - **速率限制** (`-r`):以毫秒为单位的请求延迟,以避免被检测到 - **超时** (`-t`):可配置的请求超时(默认:30 秒) - **重定向控制** (`-fr`):遵循或阻止 HTTP 重定向 **代理与隐匿:** - **代理支持** (`--proxy-url`):完整的 Burp Suite 和代理工具集成(HTTP/HTTPS/SOCKS) - **WAF 规避** (`--waf-evasion`):Header 大小随机化和规避技术 - **隐匿模式** (`--stealth`):更慢、更具规避性的扫描方式通过回调服务器确认盲打漏洞
HHunter 包含一个内置的 OOB 回调服务器,可以高置信度地确认盲打漏洞: - **盲打 SSRF**:针对每种 SSRF 变体的 HTTP/HTTPS/DNS 回调 - **盲打 Log4Shell**:LDAP/LDAPS/DNS/RMI OOB + 混淆绕过变体 + 环境变量渗透 - **盲打 XXE**:SYSTEM 实体和参数实体 OOB 回调 - **盲打 SSTI**:按引擎分类的 OOB(Java curl、Jinja2 popen、Twig system) - **盲打 RCE**:curl/wget/nslookup/PowerShell 回调 + whoami 渗透 - **盲打 XSS**:通过 img src 和 script src OOB 进行持久型 XSS 检测 **工作原理:** 1. 使用 `--oob --oob-url http://your-vps:8888` 启动 2. HHunter 在每个 payload 中注入唯一的交互 ID 3. 当目标处理盲打 payload 时,它会回调到您的服务器 4. HHunter 将回调与确切的变体相关联 → 确认发现(0.95 置信度)全面的基于 Header 的攻击向量
**核心类别:** | 标志 | 类别 | 描述 | |------|----------|-------------| | `--auth` | 身份验证 | JWT 绕过、Token 篡改、角色注入、IDOR、CSRF 绕过 | | `--proxy` | 代理信任 | IP 欺骗、X-Forwarded-For、内网访问 | | `--cors` | CORS | Origin 反射、Null Origin、子域名绕过 | | `--cache` | 缓存投毒 | Host 注入、缓存键操控、CDN 绕过 | | `--override` | 方法覆盖 | HTTP 动词篡改、URL 重写、路径覆盖 | | `--cloud` | 云/CDN | AWS/Azure/GCP/K8s Header 注入 | | `--debug` | 调试暴露 | 调试模式激活、特性标志、堆栈跟踪 | **高级类别:** | 标志 | 类别 | 描述 | |------|----------|-------------| | `--injection` | 注入 | XSS、SSTI(9 种引擎)、Log4Shell(20+ 种绕过)、SQLi(5 种数据库)、OGNL、NoSQL、LDAP | | `--ssrf` | SSRF | 云元数据(IMDSv2、Azure MI、GCP)、K8s、Docker、50+ 种内部服务 | | `--smuggling` | 走私 | CL-TE、TE-CL、Trailer 注入 | | `--hopbyhop` | 逐跳 | Header 剥离攻击 | | `--ratelimit` | 速率限制 | 速率限制绕过技术 | | `--security` | 安全 Headers | CSP、HSTS、X-Frame-Options 篡改 | | `--websocket` | WebSocket | WebSocket/gRPC/GraphQL 升级探测 | | `--jwt` | JWT | alg:none、kid 遍历、jku/x5u 投毒、弱密钥 | | `--crlf` | CRLF | 响应拆分、Header 注入 | | `--cookie` | Cookie | 固定、投掷、溢出攻击 | | `--content-type` | Content-Type | MIME 混淆、WAF 绕过 | | `--redirect` | 重定向 | 通过 Header 操控的开放重定向 | | `--protocol` | 协议 | h2c 走私、HTTP/2 升级 | | `--encoding` | 编码 | 字符集攻击、WAF 绕过、Range 滥用 | | `--gateway` | 网关 | Kong、Envoy、Traefik、API 网关绕过 |企业级输出与 CI/CD 集成
**输出格式:** - **控制台显示**:带有严重性徽章、置信度评分、证据详情和修复建议的彩色代码发现 - **JSON 导出** (`-o`):包含完整扫描统计、发现结果、证据和审计结果的结构化输出 - **HTML 报告** (`--report`):带有可展开发现、统计网格和严重性细分的自包含暗色主题报告 - **SARIF 报告** (`--sarif`):用于 GitHub Code Scanning、Azure DevOps 和 CI/CD 管道的 SARIF 2.1.0 JSON **匹配器与过滤器:** - **匹配状态** (`-ms`):仅处理特定的状态码(例如,`200,302`) - **过滤状态** (`-fs`):排除特定的状态码(例如,`404,500`) - **匹配/过滤大小**:按字节大小处理或排除响应 **结果管理:** - **差异化模式** (`--diff-only`):仅显示显著的响应差异 - **安静模式** (`-q`):隐藏 Banner,以便用于脚本和自动化 - **自动验证** (`--verify`):自动重新测试高置信度发现以进行确认 - **退出代码**:当检测到严重/高危发现时返回退出代码 1(对 CI/CD 友好)
[](https://www.buymeacoffee.com/cc1a2b)
**给本仓库点 Star** | **关注 [@cc1a2b](https://twitter.com/cc1a2b)** | **分享给其他人**
**HHunter — 高级 HTTP Header 漏洞扫描器**
*由 [cc1a2b](https://github.com/cc1a2b) 为安全社区构建*
标签:Bug Bounty, CISA项目, EVTX分析, Go语言, HTTP头漏洞扫描, HTTP头篡改, JWT攻击, LNA, OOB检测, Web安全, 企业级安全, 可自定义解析器, 头部注入, 差分分析, 批量测试, 日志审计, 盲打漏洞, 程序破解, 网络安全, 蓝队分析, 越权绕过, 跨平台工具, 隐私保护