Sharon-Needles/cve

GitHub: Sharon-Needles/cve

一款自动化的CVE发现与利用报告工具,通过指纹识别、NVD查询和非破坏性验证,直接产出可用于漏洞赏金提交的高质量报告。

Stars: 0 | Forks: 0

# cve.sh — CVE 发现与利用报告器 **技术指纹识别 → 版本提取 → NVD/CISA KEV 查询 → 漏洞利用发现 → 安全验证 → 证据捕获。在验证 CVE 攻击链后,生成可直接提交的漏洞赏金报告。** ## 功能特性 ### 6 阶段流水线 | 阶段 | 脚本 | 功能说明 | |-------|--------|--------------| | 1 | `cve_extract_tech.py` | WhatWeb + httpx + nmap → 针对每个主机的科技指纹识别 | | 2 | `cve_version_map.py` | 将版本规范化为 CPE 格式,以便进行 NVD 查询 | | 3 | `cve_lookup.py` | 查询 NVD API + CISA KEV + 匹配 nuclei CVE 模板 | | 4 | `cve_exploit_search.py` | searchsploit + GitHub PoC 搜索匹配的 CVE | | 5 | `cve_validate.py` | 非破坏性安全验证(确认处理程序存在且响应正确) | | 6 | `cve_evidence.py` + `cve_report.py` | 捕获 curl 证据、屏幕截图,生成 Markdown 报告 | **另外:** `cve_summary.py` — 生成跨所有发现 CVE 的执行摘要。 ### 质量 - **CISA KEV 集成** — 标记已知被利用漏洞目录中的 CVE(最高优先级) - **非破坏性** — 从不运行实际漏洞利用;仅确认受攻击面的存在 - **恢复支持** — 可从任意阶段重新启动 - **与 hunt.sh 集成** — `--hunt-dir` 从现有的 hunt 输出目录导入 - **感知 VRT 的输出** — 发现结果经过标记,并在生成报告前应用 impact_gate.py ## 系统要求 ### 必需 ``` sudo pacman -S curl jq whatweb nmap python3 pip install requests # or: pacman -S python-requests ``` ### 推荐 ``` sudo pacman -S nuclei pip install bs4 lxml # HTML parsing for tech fingerprint ``` ### 可选 ``` sudo pacman -S searchsploit # Exploit database search (phase 4) ``` ## 安装 ``` git clone https://github.com/Sharon-Needles/cve cd cve chmod +x cve.sh pip install -r requirements.txt # (if provided) # 全局 symlink (可选) sudo ln -s "$(pwd)/cve.sh" /usr/local/bin/cve ``` ## 快速开始 ### 扫描域名列表 ``` ./cve.sh --target "Acme Corp" --domains scope.txt --platform bugcrowd ``` ### 扫描单个 URL ``` ./cve.sh --target "Acme" --url https://erp.example.com --platform bugcrowd ``` ### 从 hunt.sh 输出导入 ``` ./cve.sh --target "Acme" --hunt-dir ./hunts/Acme_Corp_20260423_120000 --platform bugcrowd ``` ### 恢复运行 ``` ./cve.sh --resume ./hunts/Acme_CVE_20260423_120000 ``` ## 使用方法 ``` cve.sh [OPTIONS] Required (one of): -d, --domains FILE Domain list (one per line) -u, --url URL Single target URL --hunt-dir DIR Import tech fingerprint from hunt.sh output Options: -t, --target NAME Target/program name (for output dir) -p, --platform NAME bugcrowd | hackerone | other -o, --out DIR Output directory (default: ./hunts) --resume DIR Resume from existing output --max-hosts N Max hosts for deep nmap scan (default: 200) --nmap-ports N Nmap top-N ports (default: 100) -h, --help Show help ``` ### 示例 **API 服务器快速扫描:** ``` cve --target "Target" -u https://api.example.com/admin --platform hackerone ``` **完整域名列表 — 从 hunt 导入:** ``` cve --target "Target" --hunt-dir ./hunts/Target_20260423_120000 --platform bugcrowd ``` **中断后恢复:** ``` cve --resume ./hunts/Target_CVE_20260423_120000 ``` ## 输出结构 ``` Acme_Corp_CVE_20260423_120000/ ├── manifest.json ├── timeline.log │ ├── cves/ │ ├── tech_fingerprint.json # whatweb + httpx + nmap per host │ ├── version_map.json # Normalized CPE identifiers │ ├── cve_matches.json # NVD query results │ ├── kev_matches.json # CISA KEV matches (highest priority) │ ├── nuclei_cve_results.json # Nuclei CVE template hits │ ├── exploits.json # searchsploit + GitHub PoC results │ ├── validation_results.json # Non-destructive confirmation results │ └── evidence/ │ ├── *.curl.txt # curl command + full response │ └── *.screenshot.png # (if tool available) │ ├── findings.txt # All CVE findings ├── validated_findings.txt # CVEs with confirmed vulnerable surface ├── [SUBMIT:P1].txt # KEV CVEs with confirmed exploitation surface ├── [SUBMIT:P2].txt # High CVSS CVEs confirmed present ├── [SUBMIT:P3].txt # Medium CVEs confirmed ├── [REVIEW:P4].txt # Unconfirmed CVEs (version match only) ├── [DO_NOT_SUBMIT:P5].txt # Version disclosure without CVE chain └── report.md # Full Bugcrowd/H1 report ``` ## CVE 研究工作流 该工具自动遵循此模式 — 了解它有助于解释输出结果: 1. **指纹识别** 技术栈 (`WordPress 6.1`, `Apache 2.4.49`, `ServiceNow Madrid`) 2. **映射到 CPE** (`cpe:2.3:a:apache:http_server:2.4.49:*:*:*:*:*:*:*`) 3. **查询 NVD** 获取与该 CPE 匹配的所有 CVE — 按 CVSS 评分过滤 4. **交叉对比 CISA KEV** — 如果在 KEV 中,则为最高优先级 5. **查找漏洞利用 PoC** — searchsploit、nuclei 模板、GitHub 6. **安全验证** — 确认端点/处理程序按 CVE 预期作出响应 7. **证据捕获** — 屏幕截图、显示版本头的 curl 输出 8. **生成报告** — 包含 CVSS 评分、KEV 状态、PoC curl 和时间线的完整 Markdown ## 构成可提交 CVE 发现的条件 该工具会自动分类,但规则如下: **在能够证明以下内容时提交:** - 目标上的技术版本已确认(来自 header、banner 或错误页面的版本) - 特定 CVE 影响该版本范围 - 受影响的端点/处理程序存在并作出响应(非破坏性检查) - CVSS 评分 ≥ 6.0 或 CVE 在 CISA KEV 列表中 **切勿提交:** - 仅有版本披露而没有 CVE → P5,信息性 - 未确认版本的 CVE 列表 → 理论上的 - 没有可利用 CVE 的过时软件 → 总是会被拒绝 - 您必须证明受攻击面存在 — 而不仅仅是 CVE 存在 ### 高价值发现示例 ``` Apache Struts 2.5.25 running on api.example.com (confirmed via Server header). CVE-2021-31805 (CVSS 9.8, CISA KEV) affects Struts < 2.5.30. Endpoint /struts2-rest-showcase/orders/3 responds to REST requests. Nuclei CVE template confirms vulnerable. ``` ### 低价值发现示例(请勿提交) ``` Server: Apache/2.4.18 detected on example.com. CVE-2021-41773 affects Apache 2.4.49 only. Version doesn't match — not vulnerable. ``` ## 集成 ### 从 hunt.sh 导入 hunt.sh 的 1–3 阶段会运行 WhatWeb 和 httpx 进行指纹识别。导入这些结果: ``` cve --target "Target" --hunt-dir ./hunts/Target_Corp_20260423_120000 ``` 跳过重新指纹识别,直接进入 CVE 查询。 ### 与 access.sh 链接 如果 CVE 揭示了身份验证绕过或管理界面: ``` access --target "Target" -d vulnerable.example.com --platform bugcrowd ``` ### ServiceNow / 已知应用程序 CVE 针对指纹识别中发现已知平台的情况: - ServiceNow:通过 KB 公告将构建标签映射到 CVE - Telerik UI:CDN URL 版本 → 检查 CVE-2019-18935, CVE-2024-6327 - Struts:版本 header → 检查 CVE-2023-50164, CVE-2021-31805 ## 故障排除 ### 阶段 3 (CVE 查询) 较慢 在没有 API 密钥的情况下,NVD API 限制为每秒 5 个请求。请添加密钥: ``` export NVD_API_KEY="your_key_from_nvd.nist.gov" ``` ### "未提取到版本" (No versions extracted) WhatWeb 可能无法从主页检测到版本。将其指向特定路径: ``` ./cve.sh --target "Test" -u https://example.com/admin/login --platform bugcrowd ``` ### Nuclei CVE 模板未运行 确保模板是最新的: ``` nuclei -update-templates ls ~/nuclei-templates/cves/ | wc -l ``` ### 阶段 6 (证据) 屏幕截图失败 截图工具 (gowitness, cutycapt) 是可选的。curl 证据仍会被捕获。 ## 测试环境 - **操作系统**: BlackArch Linux, Ubuntu 22.04 - **Bash**: 5.x - **Python**: 3.10+ - **nuclei**: v3.7+ ## 许可证 MIT ## 免责声明 仅针对已授权的目标运行。非破坏性验证意味着确认受攻击面的存在 — 绝不触发 CVE payload。对所有发现请遵循负责任的披露准则。
标签:C2日志可视化, CISA KEV, CVE发现, CVE查询, Google, Maven, Nmap, Nuclei, NVD, PoC, Searchsploit, VRT分类, WhatWeb, 反取证, 安全合规, 安全报告, 安全评估, 密码管理, 应用安全, 指纹识别, 插件系统, 无线安全, 暴力破解, 漏洞验证, 结构化查询, 网络代理, 网络安全, 自动化安全, 虚拟驱动器, 误报过滤, 运行时操纵, 逆向工具, 隐私保护