mohammedbaalla/webvulnscan
GitHub: mohammedbaalla/webvulnscan
WebVulnScan 是一个 Python 自动化 Web 漏洞扫描器,通过内置爬虫自动检测 XSS、SQL 注入、CSRF 及安全标头配置错误并生成多格式报告。
Stars: 0 | Forks: 0
# 🔍 WebVulnScan
**高级 Web 漏洞扫描器** — 自动检测 XSS、SQL 注入、CSRF 以及安全标头配置错误。



## 功能
| 模块 | 技术 |
|--------|-----------|
| **XSS** | 反射型、上下文感知 payload、WAF 绕过变体 |
| **SQLi** | 基于错误、基于布尔的盲注、基于时间的盲注 |
| **CSRF** | 缺失 token、弱 token、服务端验证绕过 |
| **Headers** | HSTS、CSP、X-Frame-Options、CORS、信息泄露 |
- 🕷️ 内置爬虫 — 自动发现页面和表单
- 📄 三种报告格式:**终端**、**JSON**、**HTML**
- 🔌 代理支持(Burp Suite、OWASP ZAP)
- 🍪 用于认证扫描的 Cookie 和自定义标头注入
- ⚡ 可配置的深度、超时和扫描模块
- 🤖 具有多 Python 版本矩阵的 GitHub Actions CI
## 安装说明
```
git clone https://github.com/yourusername/web-vuln-scanner.git
cd web-vuln-scanner
pip install -r requirements.txt
```
或者作为包安装:
```
pip install -e .
```
## 用法
### 基础扫描
```
python scan.py -u https://target.example.com
```
### 完整选项
```
python scan.py -u https://target.example.com \
--depth 3 \
--proxy http://127.0.0.1:8080 \
--cookies "session=abc123; user=admin" \
--waf-bypass \
--output-json report.json \
--output-html report.html \
-v
```
### 跳过特定模块
```
python scan.py -u https://target.example.com --no-sqli --no-headers
```
### 所有参数
| 参数 | 描述 |
|------|-------------|
| `-u`, `--url` | 目标 URL(必填) |
| `-d`, `--depth` | 爬取深度(默认:2) |
| `--proxy` | HTTP 代理 URL |
| `--cookies` | Cookie 字符串 |
| `--headers` | 作为 JSON 的额外标头 |
| `--timeout` | 请求超时时间(秒) |
| `--no-xss` | 跳过 XSS 扫描 |
| `--no-sqli` | 跳过 SQLi 扫描 |
| `--no-csrf` | 跳过 CSRF 扫描 |
| `--no-headers` | 跳过 Headers 扫描 |
| `--waf-bypass` | 添加 WAF 绕过 XSS payload |
| `--output-json` | 保存 JSON 报告 |
| `--output-html` | 保存 HTML 报告 |
| `-v` | 详细日志记录 |
## 示例输出
```
======================================================================
WebVulnScan Report — https://target.example.com
2025-01-15 14:32:00
======================================================================
Total findings: 4
Critical: 1
High: 2
Medium: 1
======================================================================
[1] Critical — SQLi: Error-Based
URL: https://target.example.com/search
Parameter: q
Method: GET
Payload: '
Evidence: DB error: 'You have an error in your SQL syntax'
[2] High — XSS: Reflected
URL: https://target.example.com/search
Parameter: q
Method: GET
Payload:
Evidence: Payload reflected unencoded in response body
...
```
## 项目结构
```
web-vuln-scanner/
├── scan.py # CLI entry point
├── webvulnscan/
│ ├── scanners/
│ │ ├── xss.py # XSS detection
│ │ ├── sqli.py # SQL Injection detection
│ │ ├── csrf.py # CSRF detection
│ │ └── headers.py # Security headers
│ ├── utils/
│ │ ├── session.py # HTTP session manager
│ │ └── crawler.py # URL & form crawler
│ └── reporters/
│ └── report.py # Terminal / JSON / HTML reports
├── tests/
│ └── test_scanners.py # Unit tests
├── .github/workflows/ci.yml # GitHub Actions
├── requirements.txt
└── setup.py
```
## 运行测试
```
pytest tests/ -v --cov=webvulnscan
```
## 扩展
通过创建 `webvulnscan/scanners/yourscanner.py` 并实现以下类的接口来添加新的扫描器:
```
class YourScanner:
def __init__(self, session): ...
def run(self, urls, forms) -> List[Dict]: ...
```
然后在 `scan.py` 中导入并添加它。
## 路线图
- [ ] Open Redirect 检测
- [ ] 目录/文件暴力破解
- [ ] 子域名枚举
- [ ] SSRF 检测
- [ ] 使用 `httpx`/`asyncio` 进行异步扫描
- [ ] Burp Suite 扩展包装器
- [ ] 基于 CVE 的指纹识别
## 法律声明
此工具仅用于**教育和授权的渗透测试目的**。
未经授权的扫描是违法的。作者对滥用行为不承担任何责任。
## 许可证
MIT © 2025 Mohamed baalla
标签:CISA项目, Python, Web安全, 内存取证对抗, 加密, 安全规则引擎, 无后门, 漏洞扫描器, 蓝队分析, 逆向工具