tunakum/spektr

GitHub: tunakum/spektr

从NVD获取CVE信息并综合CVSS、EPSS、KEV数据计算风险评分的终端CLI工具,帮助安全人员快速识别真正重要的漏洞。

Stars: 0 | Forks: 0

# spektr ![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue) ![License: MIT](https://img.shields.io/github/license/tunakum/spektr) ![Platform](https://img.shields.io/badge/platform-linux%20%7C%20windows%20%7C%20macos-lightgrey) CVE 情报 CLI 工具。从 NVD 获取漏洞信息,使用 CVSS + EPSS + KEV 数据进行评分,并对结果进行排序,让您首先看到真正重要的内容。 无需付费 API。缓存结果支持离线工作。为想要从终端快速获取答案的渗透测试人员和安全人员构建。 ## 技术栈 Python、Typer、Rich、httpx、SQLite。无重型框架,无云依赖。 ## 功能特性 - 按软件名称/版本(CPE 过滤)在 NVD 中搜索 CVE - 批量获取 EPSS 漏洞利用概率评分(一次请求) - 检查 CISA KEV 目录中的已知被利用漏洞 - 将所有数据合并为单个 **spektr 评分**(0-10) - 在 SQLite 中缓存结果,使重复查询即时返回 - 使用 Rich 彩色终端输出,按严重性着色 - Markdown 报告导出(`--output report.md`) - 持久化配置位于 `~/.config/spektr/config.toml` ## 安装 ``` pip install pipx # if you don't have pipx yet pipx install git+https://github.com/tunakum/spektr.git ``` 完成。`spektr` 现在全局可用,无需激活虚拟环境。 ### 开发环境设置 ``` git clone https://github.com/tunakum/spektr.git cd spektr python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -e ".[dev]" pytest ``` 需要 Python 3.11+。 ## 使用方法 ``` # 搜索 CVE spektr "log4j" spektr "nginx 1.18.0" --limit 20 spektr "apache struts 2.3" --severity critical # 查询特定 CVE spektr cve CVE-2021-44228 spektr cve CVE-2021-44228 -o report.md # 按不同字段排序 spektr "openssl" --sort epss spektr "wordpress" --sort cvss # 导出结果为 markdown spektr "log4j" --output report.md # 跳过缓存获取新数据 spektr "log4j" --no-cache # 配置默认值 spektr --config # show all settings spektr --config limit 50 # set default limit spektr --config nvd_api_key YOUR_KEY # set NVD API key # 清除缓存数据 spektr clear-cache ``` ## 输出示例 ``` +---------------------------------- spektr -----------------------------------+ | | | log4j | | | +--------------------------- 10 CVEs found (live) ---------------------------+ # Severity CVE ID CVSS EPSS% KEV Score 1 CRITICAL CVE-2021-44228 10.0 100.0 !! 10.0 2 CRITICAL CVE-2017-5645 9.8 99.9 - 9.9 3 CRITICAL CVE-2021-45046 9.0 100.0 - 9.7 4 CRITICAL CVE-2019-17571 9.8 97.2 - 9.6 5 HIGH CVE-2021-4104 7.5 98.6 - 8.9 ``` ## 评分机制 ``` spektr score = (0.35 × CVSS) + (0.65 × EPSS²×10), capped at 10 If in CISA KEV: score × 1.3 ``` EPSS 是非线性的 —— 处于第 90 百分位的 CVE 评分远高于第 45 百分位的 CVE,即使原始值只有 2 倍的差异。KEV 在此基础上增加 30% 的加成。 ## 路线图 - 通过 Groq(免费)或 Ollama(本地)进行 AI 分类 —— 上下文风险分析 - Nmap XML 解析以支持批量扫描 - HTML 报告导出 - GitHub Actions CI(ruff + pytest) ## 构建工具 使用 [Claude](https://claude.ai)(Anthropic)作为 AI 编程助手开发。 ## 许可证 [MIT](LICENSE) © 2026 Tunahan Kum ## 联系方式 - GitHub: [@tunakum](https://github.com/tunakum) - LinkedIn: [tunahankum](https://linkedin.com/in/tunahankum)
标签:CISA KEV, CVE查询, CVSS评分, EPSS, GPT, httpx, KEV, Markdown导出, NVD, Python, Rich, SQLite, Typer, XSS, 反取证, 威胁情报, 安全评估, 开发者工具, 无后门, 漏洞优先级排序, 漏洞情报, 漏洞管理, 终端工具, 网络安全, 运行时操纵, 逆向工具, 隐私保护