--- name: vuln-analysis-expert description: Use when analyzing vulnerabilities with the WooYun case library to guide penetration testing, fuzzing, or secure-code reviews across injection, logic, and access-control faults. --- # WooYun 漏洞分析专家系统 ## Overview Meta-level vulnerability reasoning drawn from 88,636 WooYun cases accelerates root-cause analysis for injection, command execution, authorization bypass, and logic flaws. ## When to Use - A penetration tester or fuzzing researcher needs structured examples for SQL injection, XSS, command execution, logic flaws, file upload, or unauthorized access. - You're crafting a vulnerability report or remediation guide that benefits from the case-backed pattern library. - You need to compare an observed bug pattern against the WooYun knowledge base to validate severity or reproduction steps. ## When NOT to Use - The focus is non-vulnerability documentation, QA automation, or benign configuration management. - You're dealing with purely administrative tasks that do not involve threat modeling or exploitation. - The scenario only requires generic coding guidance without reference to attack patterns. ``` ┌─────────────────────────────────────────────────────────────────┐ │ 🎯 知识来源: WooYun 88,636 真实漏洞案例 (2010-2016) │ │ 📊 知识库规模: 8大类型 × 50案例深度分析 = 4,973行方法论 │ │ ⚡ 核心价值: 元思考方法论 + 实战测试流程 + 绕过技巧库 │ └─────────────────────────────────────────────────────────────────┘ ``` --- ## 一、漏洞类型全景图 | 漏洞类型 | 案例数 | 知识库 | 核心洞察 | |----------|--------|--------|----------| | **SQL注入** | 27,732 | [sql-injection.md](knowledge/sql-injection.md) | 代码与数据边界混淆 | | **XSS跨站** | 7,532 | [xss.md](knowledge/xss.md) | 信任边界突破 | | **命令执行** | 6,826 | [command-execution.md](knowledge/command-execution.md) | 数据到指令的跃迁 | | **逻辑漏洞** | 8,292 | [logic-flaws.md](knowledge/logic-flaws.md) | 业务假设与行为偏差 | | **文件上传** | 2,711 | [file-upload.md](knowledge/file-upload.md) | 执行攻击者代码 | | **未授权访问** | 14,377 | [unauthorized-access.md](knowledge/unauthorized-access.md) | 访问控制缺失 | | **信息泄露** | 7,337 | [info-disclosure.md](knowledge/info-disclosure.md) | 敏感数据暴露 | | **文件遍历** | 2,854 | [file-traversal.md](knowledge/file-traversal.md) | 路径控制突破 | | **SSRF** | ~3,000 | [ssrf.md](categories/ssrf.md) | 服务端请求伪造 | | **CSRF** | ~1,200 | [csrf.md](categories/csrf.md) | 跨站请求伪造 | | **XXE** | ~100 | [xxe.md](categories/xxe.md) | XML外部实体注入 | | **配置错误** | ~3,500 | [misconfig.md](categories/misconfig.md) | 安全配置缺陷 | | **RCE** | ~500 | [rce.md](categories/rce.md) | 远程代码执行 | > **📦 完整案例库**: `categories/` 目录包含全部 88,636 个漏洞的详细提取(86MB) --- ## 二、元思考方法论框架 ### 2.1 漏洞本质公式 ``` 漏洞 = 预期行为 - 实际行为 = 开发者假设 ⊕ 攻击者输入 → 意外状态 核心问题链: 1. 数据从哪来? (输入源) → GET/POST/Cookie/Header/文件 2. 数据到哪去? (数据流) → 验证→处理→存储→输出 3. 在哪被信任? (信任边界) → 前端/后端/数据库/系统 4. 如何被处理? (处理逻辑) → 过滤/转义/验证/执行 5. 处理后去哪? (输出点) → HTML/SQL/命令/文件 ``` ### 2.2 攻击面映射模型 ``` ┌─────────────────────────────────────────┐ │ 应用攻击面 │ └─────────────────────────────────────────┘ │ ┌───────────────────────┼───────────────────────┐ │ │ │ ┌───▼───┐ ┌────▼────┐ ┌────▼────┐ │ 输入层 │ │ 处理层 │ │ 输出层 │ ├────────┤ ├─────────┤ ├─────────┤ │GET参数 │ │输入验证 │ │HTML页面 │ │POST数据│ ──► │业务逻辑 │ ──► │JSON响应 │ │Cookie │ │数据库操作│ │文件下载 │ │HTTP头 │ │文件操作 │ │错误信息 │ │文件上传│ │系统调用 │ │日志记录 │ └────────┘ └─────────┘ └─────────┘ ``` ### 2.3 漏洞猎人认知层次 ``` Level 1: 工具使用者 (10%) ├─ 会用扫描器和自动化工具 ├─ 依赖已知漏洞特征 └─ 难以应对定制化场景 Level 2: 模式识别者 (30%) ├─ 识别漏洞代码模式 ├─ 理解漏洞触发原理 └─ 能够手工验证 Level 3: 逻辑分析者 (40%) ├─ 理解业务流程 ├─ 发现设计缺陷 └─ 组合利用链 Level 4: 创造性思考者 (20%) ├─ 发现新攻击向量 ├─ 绕过防护机制 └─ 0day挖掘能力 ``` --- ## 三、快速参考:漏洞类型速查 ### 3.1 SQL注入速查 ``` 注入点识别: ├─ 高危参数: id, sort_id, username, password, search, keyword ├─ 测试向量: ' " ) ') ") -- # /* └─ 数据库指纹: @@version(MSSQL) version()(MySQL) v$version(Oracle) 绕过技巧: ├─ 空格: /**/ %09 %0a () ├─ 关键字: SeLeCt sel%00ect /*!select*/ ├─ 等号: LIKE REGEXP BETWEEN IN └─ 引号: 0x十六进制 char() concat() 详见: knowledge/sql-injection.md (731行) ``` ### 3.2 XSS速查 ``` 输出点识别: ├─ 用户内容: 昵称、签名、评论、留言 ├─ 搜索回显: 搜索框、历史记录 ├─ 文件属性: 文件名、描述、alt属性 └─ 邮件内容: 标题、正文、附件名 绕过技巧: ├─ 标签变形: