palmar973/VulnSeeker

GitHub: palmar973/VulnSeeker

模块化 Web DAST 扫描框架,集成 25 个漏洞检测模块、API 感知发现和 AI 风险分析,实现从侦察到报告的自动化安全审计。

Stars: 0 | Forks: 0

``` ██╗ ██╗██╗ ██╗██╗ ███╗ ██╗███████╗███████╗███████╗██╗ ██╗███████╗██████╗ ██║ ██║██║ ██║██║ ████╗ ██║██╔════╝██╔════╝██╔════╝██║ ██╔╝██╔════╝██╔══██╗ ██║ ██║██║ ██║██║ ██╔██╗ ██║███████╗█████╗ █████╗ █████╔╝ █████╗ ██████╔╝ ╚██╗ ██╔╝██║ ██║██║ ██║╚██╗██║╚════██║██╔══╝ ██╔══╝ ██╔═██╗ ██╔══╝ ██╔══██╗ ╚████╔╝ ╚██████╔╝███████╗██║ ╚████║███████║███████╗███████╗██║ ██╗███████╗██║ ██║ ╚═══╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ``` [![CI — 测试](https://static.pigsec.cn/wp-content/uploads/repos/cas/9e/9eb50eae469b672f810486bce03e7171db093db879727991f34efab4218a1961.svg)](https://github.com/palmar973/VulnSeeker/actions/workflows/ci.yml) **模块化 Web 漏洞扫描器** [![Python](https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white)](https://www.python.org/) [![测试](https://img.shields.io/badge/Tests-194%20passing-brightgreen?logo=pytest&logoColor=white)]() [![模块](https://img.shields.io/badge/Modules-25%20scanners-orange?logo=shield&logoColor=white)]() [![OWASP](https://img.shields.io/badge/OWASP%20Top%2010-8%2F10-red?logo=owasp&logoColor=white)]() [![许可证](https://img.shields.io/badge/License-MIT-green)](LICENSE) [![平台](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey)]() [![AI](https://img.shields.io/badge/AI-Llama%203.3%2070B-purple?logo=meta)](https://groq.com/) [![NVD](https://img.shields.io/badge/NVD-API%202.0-yellow?logo=nist&logoColor=white)](https://nvd.nist.gov/)
## 🔍 什么是 VulnSeeker? **VulnSeeker** 是一个使用 Python 开发的高级 DAST(动态应用安全测试)框架,旨在进行全面且自动化的安全审计。与仅限于单一攻击向量的基础扫描器不同,VulnSeeker 编排了 **25 个独立的**分析模块——从 SQL 注入和 XSS 到子域名的 OSINT 侦察、实时查询 NIST NVD 的 CVE,以及人工智能分析。 该系统在可扩展的模块化架构下运行,每个模块都继承自基类 `ScannerModule` 并注册到中央引擎中,允许在不修改系统核心的情况下添加新的扫描功能。 ### 为什么选择 VulnSeeker? - **集成化覆盖。** VulnSeeker 执行完整的链条:侦察 → 指纹识别 → 爬虫 → API 感知发现 → 多线程攻击 → 去重 → AI 分析 → 报告。 - **API 感知发现 (SPAs)。** 当目标是静态爬虫无法揭示 endpoint 的单页应用(Angular/React/Vue)时,VulnSeeker 会通过解析 OpenAPI/Swagger 规范并从 JavaScript *bundles* 中提取 `/api/` 和 `/rest/` 路由来恢复 API 表面——无需 *headless* 浏览器——并且也能攻击 JSON 主体。 - **抗误报的稳健性。** 检测 *catch-all* 响应(soft-404),以免在所有请求都返回 200 的服务器上(SPAs 的典型特征)报告不存在的文件,并在注入模块中针对 *baseline* 进行验证。 - **OWASP Top 10 (2021) 的 8/10 类别。** 剩下的 2 类(A08, A09)无法通过 DAST 进行外部评估。 - **集成人工智能。** Llama 3.3 70B 对技术发现进行上下文分析,并根据业务风险对其进行优先级排序。 - **实时 CVE。** 与 NIST NVD API 2.0 集成,查询与检测到的技术相关的已知漏洞。 - **194 个单元测试。** 使用 `pytest` 的完整测试套件以及 GitHub Actions 上的 CI/CD pipeline。 - **通过 OWASP Benchmark 验证。** 使用标记的 *ground truth* 进行定量测量:在可攻击子集上的约登指数为 0.68(SQLi 0.89, XSS 0.87, 精确度 0.95),并诚实地报告了方法论。 - **历史持久化。** 每次扫描都存储在 SQLite 中,允许进行趋势分析和审计间的比较。 ## ⚡ 检测模块 ### 注入与执行 (A03 + A10 — Injection / SSRF) | 模块 | 描述 | 严重性 | |--------|-------------|-----------| | **SQL Injection** | 基于错误的 SQLi(MySQL, PostgreSQL, Oracle, MSSQL, SQLite/ORM)、*time-based* 盲注以及 REST API JSON 主体注入 | 🔴 CRITICAL | | **Cross-Site Scripting** | 通过注入 canary 标识来识别反射型 XSS | 🟠 HIGH | | **Command Injection** | 检测参数中的远程命令执行 (RCE) | 🔴 CRITICAL | | **Local File Inclusion** | 测试目录遍历以读取本地文件 | 🔴 HIGH | | **Remote File Inclusion** | 检测 Web 应用程序中的远程文件包含 | 🔴 HIGH | | **SSRF Scanner** | Server-Side Request Forgery 的启发式带内检测 | 🔴 HIGH | ### 访问控制与身份验证 (A01 + A07) | 模块 | 描述 | 严重性 | |--------|-------------|-----------| | **Open Redirect** | 检测可利用的开放重定向 | 🟠 HIGH | | **CORS Scanner** | 分析配置错误的 Cross-Origin 策略 | 🟡 MEDIUM | | **CSRF Auditor** | 验证表单中的防伪造保护 | 🟡 MEDIUM | | **Brute Force Detector** | 检测没有暴力破解保护的 endpoint | 🟠 HIGH | | **Weak Session Auditor** | 审计会话管理(熵、轮换、token) | 🟠 HIGH | ### 配置与强化 (A05 — Security Misconfiguration) | 模块 | 描述 | 严重性 | |--------|-------------|-----------| | **Header Analyzer** | 评估安全 header(CSP, HSTS, X-Frame-Options 等) | 🟡 MEDIUM | | **Dir Listing Detector** | 检测已启用的目录列表展示 | 🟡 MEDIUM | | **HTTP Method Scanner** | 识别已启用的危险 HTTP 方法(PUT, DELETE, TRACE) | 🟡 MEDIUM | | **Exposure Scanner** | 检测暴露的敏感文件(.env, .git, 备份) | 🟠 HIGH | | **Path Fuzzer** | 通过字典发现隐藏的路径和文件 | 🟡 MEDIUM | ### 易受攻击的组件与密码学 (A02 + A06) | 模块 | 描述 | 严重性 | |--------|-------------|-----------| | **CVE Lookup** | 本地数据库 + 实时查询 NIST NVD API 2.0 | 🔴 CRITICAL | | **TLS Checker** | 验证 SSL/TLS 证书、协议和弱加密套件 | 🟠 HIGH | | **Sensitive Data Scanner** | 检测暴露的敏感数据(电子邮件、token、API keys) | 🟠 HIGH | ### 不安全设计 (A04) | 模块 | 描述 | 严重性 | |--------|-------------|-----------| | **File Upload Detector** | 检测没有验证的文件上传表单 | 🟠 HIGH | ### 侦察与分析 | 模块 | 描述 | |--------|-------------| | **Web Crawler** | 映射 URL、表单和入口点并支持身份验证的结构化探测器 | | **API Endpoint Discovery** | 在无需浏览器的情况下恢复 SPAs 中的 REST API endpoint:解析 OpenAPI/Swagger + 提取 JavaScript *bundles* 中的路由 | | **Tech Fingerprinter** | 识别服务器、后端语言、CMS/框架及版本 | | **Subdomain Scanner** | 通过 crt.sh 和 HackerTarget 被动 OSINT 发现,并验证活跃的子域名 | | **Port Scanner** | 扫描开放的 TCP 端口并识别服务 | ### 人工智能 | 特性 | 详情 | |---------------|---------| | **模型** | 通过 Groq API 使用的 Llama 3.3 70B | | **功能** | 通过业务风险分析生成执行报告 | | **输出** | 全局风险等级、首要威胁、立即行动计划(48 小时)和战略建议 | ### 报告 - 📄 **专业的 PDF**,包含封面、严重性图表(饼图 + 条形图)、发现表和 AI 总结 - 📊 结构化的 **JSON**,用于与其他工具集成 - 📋 兼容 Excel 的 **CSV**,用于手动分析 - 🗄️ **SQLite** 包含完整的扫描历史记录,可导出和查询 ## 🏗️ 架构 ``` VulnSeeker/ ├── core/ # Núcleo del sistema │ ├── engine.py # Orquestador principal (multihilo) │ ├── scanner_types.py # Tipos base: Target, Vulnerability, ScannerModule │ ├── models.py # Estructuras de datos compartidas │ ├── config.py # Configuración global centralizada │ ├── crawler.py # Web Crawler con autenticación por cookies │ ├── api_discovery.py # Descubridor de endpoints API (SPAs, sin navegador) │ ├── soft404.py # Detección de respuestas catch-all (anti-FP) │ ├── fingerprinter.py # Fingerprinting tecnológico (Server/CMS/Backend) │ ├── subdomain_scanner.py # OSINT de subdominios (crt.sh + HackerTarget) │ ├── module_registry.py # Registro centralizado de los 25 módulos │ └── db_manager.py # Persistencia SQLite (Singleton) │ ├── modules/ # 25 módulos de escaneo independientes │ ├── sqli_module.py # SQL Injection (Error-Based) │ ├── xss_module.py # Reflected XSS │ ├── cmd_injection.py # Command Injection / RCE │ ├── lfi_scanner.py # Local File Inclusion │ ├── rfi_scanner.py # Remote File Inclusion │ ├── open_redirect.py # Open Redirect │ ├── cors_scanner.py # CORS Misconfiguration │ ├── csrf_auditor.py # Cross-Site Request Forgery │ ├── cve_lookup.py # CVE Lookup (Local DB + NVD API 2.0) │ ├── tls_checker.py # TLS/SSL Certificate Analyzer │ ├── header_analyzer.py # HTTP Security Headers │ ├── dir_listing_detector.py # Directory Listing Detection │ ├── http_method_scanner.py # Dangerous HTTP Methods │ ├── cookie_scanner.py # Cookie Security Audit │ ├── exposure_scanner.py # Sensitive File Exposure │ ├── path_fuzzer.py # Path Fuzzing / Discovery │ ├── port_scanner.py # TCP Port Scanner │ ├── sensitive_data_scanner.py # Sensitive Data Exposure (PII, tokens) │ ├── file_upload_detector.py # Insecure File Upload Detection │ ├── brute_force_detector.py # Brute Force Protection Audit │ ├── weak_session_auditor.py # Session Management Audit │ ├── waf_detector.py # WAF Detection │ ├── cms_auditor.py # CMS-Specific Vulnerabilities │ ├── email_harvester.py # Email Address Discovery │ ├── ssrf_scanner.py # Server-Side Request Forgery (SSRF) │ └── ai_analyst.py # AI Analyst (Groq / Llama 3.3 70B, servicio auxiliar) │ ├── ui/ # Interfaz gráfica │ └── main_window.py # GUI completa (CustomTkinter + Matplotlib) │ ├── reports/ # Sistema de reportes │ ├── report_generator.py # Exportador JSON/CSV │ └── pdf_generator.py # Generador PDF (ReportLab + gráficos) │ ├── tests/ # 194 tests unitarios (pytest) │ ├── test_sqli.py │ ├── test_xss.py │ ├── test_cmd_injection.py │ ├── test_cve_lookup.py │ ├── ... # 31 archivos de test │ └── test_weak_session.py │ ├── tools/ # Utilidades de evaluación cuantitativa │ ├── benchmark_scorer.py # Métricas vs OWASP Benchmark (TPR/FPR/Youden) │ └── benchmark_runner.py # Driver: enumera y ataca los casos del Benchmark │ ├── .github/workflows/ci.yml # CI/CD Pipeline (GitHub Actions) ├── tesis/ # Documento de tesis (LaTeX + PDF) │ └── main.tex / main.pdf ├── main.py # Punto de entrada CLI ├── gui.py # Punto de entrada GUI ├── requirements.txt # Dependencias del proyecto └── requirements-dev.txt # Dependencias de desarrollo (pytest) ``` ### 执行流程 ``` [URL Objetivo] │ ▼ ┌─────────────────┐ │ Subdomain OSINT │ ← crt.sh + HackerTarget └────────┬────────┘ ▼ ┌─────────────────┐ │ Fingerprinting │ ← Headers + HTML + Paths predictivos └────────┬────────┘ ▼ ┌─────────────────┐ │ Web Crawler │ ← URLs + Formularios + Parámetros (con autenticación) └────────┬────────┘ ▼ ┌──────────────────────────────────────────────┐ │ ATAQUE MULTIHILO (25 módulos en paralelo)│ │ ┌────────┐ ┌────────┐ ┌──────────────────┐ │ │ │ SQLi │ │ XSS │ │ Header Analyzer │ │ │ │ LFI │ │ RFI │ │ CORS Scanner │ │ │ │ RCE │ │ SSRF │ │ CSRF Auditor │ │ │ │ CVE* │ │ TLS │ │ Brute Force │ │ │ │ Upload │ │ Redirect│ │ Weak Session │ │ │ └────────┘ └────────┘ └──────────────────┘ │ │ *CVE: NVD API 2.0 + base local (16 CVEs) │ └─────────────────┬────────────────────────────┘ ▼ ┌──────────────────────────────────────────────┐ │ DEDUPLICACIÓN (name + URL + payload) │ │ Elimina hallazgos exactamente idénticos │ └─────────────────┬────────────────────────────┘ ▼ ┌──────────────────────────────────────────────┐ │ ANÁLISIS IA (Llama 3.3 70B via Groq) │ │ Informe Ejecutivo + Riesgo de Negocio │ └─────────────────┬────────────────────────────┘ ▼ ┌──────────┴──────────┐ │ PDF · JSON · CSV │ │ SQLite (Historial) │ └─────────────────────┘ ``` ### OWASP Top 10 (2021) 覆盖范围 | # | OWASP 类别 | 模块 | 状态 | |---|----------------|-----------|:------:| | A01 | Broken Access Control | Open Redirect, CORS Scanner | ✅ | | A02 | Cryptographic Failures | TLS Checker, Sensitive Data Scanner | ✅ | | A03 | Injection | SQLi, XSS, Command Injection, LFI, RFI, SSRF* | ✅ | | A04 | Insecure Design | File Upload Detector | ✅ | | A05 | Security Misconfiguration | Headers, Dir Listing, HTTP Methods, Exposure, Path Fuzzer | ✅ | | A06 | Vulnerable Components | CVE Lookup (NVD API), Tech Fingerprinter | ✅ | | A07 | Auth Failures | CSRF, Brute Force, Weak Session | ✅ | | A08 | Software & Data Integrity | — | ⬜ 无法通过外部评估 | | A09 | Logging & Monitoring | — | ⬜ 无法通过外部评估 | | A10 | SSRF | SSRF Scanner | ✅ | ## 🧪 测试 VulnSeeker 拥有 **194 个单元测试**,组织在 34 个测试文件中。所有模块都由通过模拟 HTTP 响应来确保确定性执行且不依赖网络的测试所覆盖。 ``` # 执行完整 suite pytest tests/ -v # 预期结果 194 passed ✅ ``` 持续集成会在每次 push 时通过 **GitHub Actions** 运行完整的测试套件。 ## ⚠️ 已知限制 - **启发式检测:** 注入模块结合了 *error-based* 技术、*time-based* 盲测(SQLi 和 command injection)、JSON 主体注入以及一个共享的向量组件 (`injection_points`)。目前尚不能检测存储型(*stored*)XSS 和 DOM XSS,因为它们需要状态跟踪或客户端 JavaScript 执行。 - **SSRF 带内:** 通过分析 HTTP 响应进行检测;不使用 OOB (Out-of-Band) 回调。 - **作为侦察的子域名:** 通过 OSINT 发现的子域名不会自动扫描(需要明确的授权)。 - **AI 依赖于 API:** 执行报告需要连接到 Groq API;框架的其余部分在离线状态下运行。 - **没有规范或可读路由的 SPAs:** API 感知发现涵盖了发布 OpenAPI/Swagger 或在其 JavaScript 中引用其路由的 SPAs;那些完全混淆其 endpoint 的应用将需要 *headless* 渲染引擎(未来工作)。 - **在受控环境中验证:** 在针对 DVWA(低安全级别)的测试中未观察到误报,并针对 Altoro Mutual 和 SPA OWASP Juice Shop 进行了额外验证;在生产环境中结果可能会有所不同。 - **针对 OWASP Benchmark 的量化限制:** 使用 *ground truth* 进行的测量显示,VulnSeeker 对 *path traversal* 和没有回显的 *command injection* 是盲区,且不涵盖通过 header 或 XML 主体发起的注入向量(约占总案例的 34%)。针对这些情况添加了 *time-based* 盲测(cmdi)和 *error-based* (LFI) 技术,但经验证发现该综合基准 **并不暴露这些技术**:它没有因命令延迟而阻止响应(`sleep 10` → ~0.06 s),也没有传播文件错误追踪。它的效力在实际应用(DVWA)中得到了体现,而不是在预言机中。测量中暴露的通过 `POST` 进行 XSS 的缺陷已通过扩展模块得到修复(Youden XSS 0.38 → 0.87)。这些是可以在不触及模块化架构的情况下解决的改进方向。 有关更多详细信息,请查阅[学位论文](tesis/main.pdf)中的研究局限性部分。 ## 🚀 安装 ### 前提条件 - Python 3.10+ - pip(包管理器) - *(可选)* 用于 AI 模块的 [Groq](https://console.groq.com/) API Key ### 步骤 ``` # 1. 克隆仓库 git clone https://github.com/palmar973/VulnSeeker.git cd VulnSeeker # 2. 创建虚拟环境 python -m venv .venv # 3. 激活虚拟环境 # Windows: .venv\Scripts\Activate.ps1 # Linux/macOS: source .venv/bin/activate # 4. 安装依赖 pip install -r requirements.txt # 5. (可选) 安装开发依赖 pip install -r requirements-dev.txt # 6. 运行 GUI python gui.py ``` ### 通过 CLI 使用 ``` # 简单扫描(单个 URL) python main.py -u http://target.com # 使用 Crawler 扫描(自动发现 endpoints) python main.py -u http://target.com --crawl ``` ## 🌐 关于 vulnseeker.software [vulnseeker.software](https://vulnseeker.software) 网站**仅仅是一个展示项目及提供相关文档的 landing page**。VulnSeeker 是一个**本地桌面应用程序**——目前不存在,未来也不会存在可以直接从浏览器中运行的版本。 这个决定是经过深思熟虑的:漏洞扫描器需要直接的网络访问权限、不受浏览器限制的多线程执行能力,以及能够完全控制 header、超时和 payload 来发出数百个并发 HTTP 请求的能力。本地架构保证了**最大的扫描效能**以及操作员对该工具的**完全掌控**。 ## 📚 学术背景 VulnSeeker 是作为 **Facultad Experimental de Ciencias, Universidad del Zulia**(委内瑞拉马拉开波)**计算学学士学位**的学位论文而开发的。 **标题:** *用于在 Web 应用程序中自动化检测漏洞的模块化扫描器* **作者:** Claudio Enrique Palmar León · **导师:** Prof. Sigerist Rodríguez ## ⚠️ 法律免责声明 ``` VulnSeeker ha sido desarrollado con fines EXCLUSIVAMENTE educativos y de investigación académica. El uso de esta herramienta contra sistemas sin AUTORIZACIÓN EXPLÍCITA Y POR ESCRITO del propietario es ILEGAL y puede constituir un delito según las leyes de tu jurisdicción. El autor no se hace responsable del uso indebido de esta herramienta. Úsala exclusivamente en entornos controlados, laboratorios de prueba o con autorización formal. ``` ## 📄 许可证 本项目采用 [MIT 许可证](LICENSE)授权。 由 **Claudio Enrique Pal León** 开发 · 2025-2026
*“安全不是一个产品,而是一个过程。”* — Bruce Schneier
标签:CVE关联, DAST扫描器, OWASP Top 10, Python, Sysdig, Web安全, 安全规则引擎, 无后门, 蓝队分析, 逆向工具