Calm-Ay/headerhound
GitHub: Calm-Ay/headerhound
一个轻量级 Python Web 标头与错误配置扫描器,用于快速检测目标缺失的安全头、Cookie 策略缺陷和 CORS 风险。
Stars: 1 | Forks: 0
# HeaderHound
HeaderHound 是一个基于 Python 的 Web 标头和响应错误配置扫描器,专为学习、信息收集和轻量级安全测试而构建。
它能帮助你快速检查 Web 目标是否缺少安全标头、存在薄弱的 Cookie 标志、可疑的 CORS 行为、重定向链以及基本的信息泄露。
## 为什么这个项目很重要
HeaderHound 的代码量设计得足够小以便于理解,同时又具备足够的实用性,值得运行。
它是一个极佳的入门项目,适用于:
- Web 应用安全学习
- 漏洞赏金信息收集工作流
- 云 / 边缘安全基础
- 使用 Python 构建安全工具
## 功能
- 扫描单个 URL 或包含多个 URL 的文件
- 针对多目标输入进行并发扫描
- 检查常见的安全标头:
- Content-Security-Policy
- Strict-Transport-Security
- X-Frame-Options
- X-Content-Type-Options
- Referrer-Policy
- Permissions-Policy
- 检查 Cookie 是否缺少:
- `Secure`
- `HttpOnly`
- `SameSite`
- 检测宽泛或反射型的 CORS 行为
- 报告服务器/Banner 信息泄露
- 跟踪重定向并显示重定向链
- 输出可读文本或 JSON 格式
- 按严重程度对发现进行汇总
## 安装
```
git clone https://github.com/Calm-Ay/headerhound.git
cd headerhound
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## 使用方法
### 扫描单个目标
```
python3 -m headerhound.cli --url https://example.com
```
### 扫描多个目标
```
python3 -m headerhound.cli --file sample_targets.txt --workers 5
```
### 保存 JSON 输出
```
python3 -m headerhound.cli --file sample_targets.txt --workers 5 --format json --output results.json
```
## 文本输出示例
```
Target: https://example.com
Status: ok
Top Severity: HIGH
Final URL: https://example.com/
HTTP Status: 200
Summary:
- Critical: 0
- High: 1
- Medium: 3
- Low: 2
- Info: 1
Findings:
- [HIGH] CORS reflects supplied Origin header (https://evil.example)
- [MEDIUM] Missing X-Frame-Options
- [LOW] Missing Referrer-Policy
```
## JSON 输出示例
```
python3 -m headerhound.cli --url https://example.com --format json
```
## 项目结构
```
headerhound/
├── headerhound/
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ ├── output.py
│ └── scanner.py
├── sample_targets.txt
├── requirements.txt
├── LICENSE
└── README.md
```
## 路线图
计划中的后续改进:
- TLS 证书检查
- HTML 报告输出
- 技术指纹识别
- 自定义标头配置
- 重试 / 速率限制控制
## 免责声明
请仅在你拥有或获得明确授权测试的系统上使用。
## 许可证
MIT
标签:API安全, Bug Bounty工具, Cookie安全, CORS跨域检测, Homebrew安装, HTTP头部检查, JSON输出, Python, Python安全工具, Web安全扫描器, 信息泄露, 威胁情报, 安全侦察, 安全基线检查, 密码管理, 并发扫描, 开发者工具, 文档结构分析, 无后门, 网络安全, 网络安全学习, 轻量级扫描器, 边缘安全, 逆向工具, 隐私保护