Vedant24v/web-vuln-scanner

GitHub: Vedant24v/web-vuln-scanner

基于 Python 的命令行 Web 漏洞扫描工具,可自动检测安全头缺失、反射型 XSS 和 SQL 注入等 OWASP Top 10 常见问题并生成 HTML 报告。

Stars: 1 | Forks: 0

# 🔍 Web 漏洞扫描器 一个基于 Python 的命令行工具,可根据 **OWASP Top 10** 自动扫描 Web 应用程序中的常见安全漏洞。生成包含所有扫描结果的详细 HTML 报告。 ## 🚀 功能 - ✅ **缺失的安全头** — 检测缺失的 CSP、X-Frame-Options、HSTS 等 - ✅ **反射型 XSS 检测** — 向 URL 参数注入 payload 并检查是否存在反射 - ✅ **SQL 注入检测** — 识别由恶意输入触发的数据库错误 - ✅ **严重性评级** — 发现项分为 CRITICAL / HIGH / MEDIUM 级别 - ✅ **HTML 报告生成** — 保存带有时间戳的整洁报告到本地 - ✅ **彩色终端输出** — 使用 `rich` 库实时显示结果 ## 🛠️ 技术栈 - **语言:** Python 3.x - **库:** `requests`、`beautifulsoup4`、`rich` - **概念:** OWASP Top 10、HTTP headers、XSS、SQL Injection、安全自动化 ## 📁 项目结构 ``` web-vuln-scanner/ │ ├── scanner/ │ ├── __init__.py # Module init │ ├── headers.py # Security header checks │ ├── xss.py # Reflected XSS detection │ ├── sqli.py # SQL Injection detection │ └── reporter.py # HTML report generator │ ├── main.py # Entry point / CLI ├── requirements.txt # Dependencies └── README.md ``` ## ⚙️ 安装 ``` # Clone repository git clone https://github.com/YOUR_USERNAME/web-vuln-scanner.git cd web-vuln-scanner # 创建 virtual environment python -m venv venv venv\Scripts\activate # Windows source venv/bin/activate # macOS/Linux # Install dependencies pip install -r requirements.txt ``` ## 💻 使用方法 ``` python main.py --target "http://zero.webappsecurity.com/login.html" ``` ### 输出示例 ``` 🔍 Starting scan on: http://zero.webappsecurity.com/login.html → Fetching target... ✓ Got response: HTTP 200 → Checking security headers... ✓ 0 headers present, 6 missing → Testing for reflected XSS... ✓ XSS check done: 0 finding(s) → Testing for SQL Injection... ✓ SQLi check done: 0 finding(s) 📋 Scan Results: ╭──────────┬───────────────────────┬──────────────────────────────────────╮ │ Severity │ Type │ Detail │ ├──────────┼───────────────────────┼──────────────────────────────────────┤ │ MEDIUM │ Missing Security │ Content-Security-Policy is missing │ │ │ Header │ Prevents XSS by controlling sources │ ╰──────────┴───────────────────────┴──────────────────────────────────────╯ 📄 Report saved: report.html ``` ## 📊 OWASP 覆盖范围 | 检查项 | OWASP 类别 | |---|---| | 缺失的安全头 | A05 - Security Misconfiguration | | 反射型 XSS | A03 - Injection | | SQL Injection | A03 - Injection | ## ⚠️ 免责声明 本工具仅用于**教育目的**。请仅扫描您拥有或已获得明确测试权限的网站。未经授权的扫描是非法行为。 ## 👤 作者 **Vedant Vyawhare** B.Tech CSE | MIT-WPU, Pune
标签:AES-256, API密钥检测, AppImage, beautifulsoup4, CISA项目, CRLF注入, DevSecOps, DOE合作, HTML报告, OWASP Top 10, Python, requests库, URL发现, Web安全, Web应用防火墙, XSS检测, 上游代理, 安全响应头, 安全检测, 无后门, 漏洞评估, 网络安全, 蓝队分析, 输入验证, 逆向工具, 隐私保护