implementing-epss-score-for-vulnerability-prioritization
集成 FIRST 的漏洞利用预测评分系统(EPSS)API,基于 30 天内真实世界漏洞利用概率对漏洞修复工作进行优先排序。
Best use case
implementing-epss-score-for-vulnerability-prioritization is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
集成 FIRST 的漏洞利用预测评分系统(EPSS)API,基于 30 天内真实世界漏洞利用概率对漏洞修复工作进行优先排序。
Teams using implementing-epss-score-for-vulnerability-prioritization should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/implementing-epss-score-for-vulnerability-prioritization/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How implementing-epss-score-for-vulnerability-prioritization Compares
| Feature / Agent | implementing-epss-score-for-vulnerability-prioritization | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
集成 FIRST 的漏洞利用预测评分系统(EPSS)API,基于 30 天内真实世界漏洞利用概率对漏洞修复工作进行优先排序。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 实施 EPSS 评分进行漏洞优先排序(Implementing EPSS Score for Vulnerability Prioritization)
## 概述
漏洞利用预测评分系统(Exploit Prediction Scoring System,EPSS)是由 FIRST(事件响应和安全团队论坛)开发的数据驱动模型,用于估算 CVE 在未来 30 天内在真实环境中被利用的概率。EPSS 使用基于真实世界漏洞利用数据训练的机器学习模型,产生 0.0 到 1.0(即 0% 到 100%)的评分。与衡量严重性的 CVSS 不同,EPSS 衡量的是被利用的可能性,这使其成为基于风险的漏洞优先排序的关键工具。
## 前置条件
- Python 3.9+,包含 `requests`、`pandas`、`matplotlib`
- 访问 FIRST EPSS API(https://api.first.org/data/v1/epss)
- 含 CVE 标识符的漏洞扫描结果
- 可选:用于 CVSS 丰富化的 NVD API 密钥
## EPSS API 用法
### 查询单个 CVE
```bash
# 获取特定 CVE 的 EPSS 评分
curl -s "https://api.first.org/data/v1/epss?cve=CVE-2024-3400" | python3 -m json.tool
# 响应示例:
# {
# "status": "OK",
# "status-code": 200,
# "version": "1.0",
# "total": 1,
# "data": [
# {
# "cve": "CVE-2024-3400",
# "epss": "0.95732",
# "percentile": "0.99721",
# "date": "2024-04-15"
# }
# ]
# }
```
### 批量查询多个 CVE
```bash
# 最多批量查询 100 个 CVE
curl -s "https://api.first.org/data/v1/epss?cve=CVE-2024-3400,CVE-2024-21887,CVE-2023-44228" | \
python3 -c "
import sys, json
data = json.load(sys.stdin)
for item in data['data']:
pct = float(item['epss']) * 100
print(f\"{item['cve']}: {pct:.2f}% 利用概率(百分位数:{item['percentile']})\")
"
```
### 下载完整 EPSS 数据集
```bash
# 下载完整的每日 EPSS 评分(CSV 格式)
curl -s "https://epss.cyentia.com/epss_scores-current.csv.gz" | gunzip > epss_scores_current.csv
# 检查大小和预览
wc -l epss_scores_current.csv
head -5 epss_scores_current.csv
```
### 查询历史 EPSS 评分
```bash
# 获取特定日期的 EPSS 评分
curl -s "https://api.first.org/data/v1/epss?cve=CVE-2024-3400&date=2024-04-12"
# 获取时间序列数据
curl -s "https://api.first.org/data/v1/epss?cve=CVE-2024-3400&scope=time-series"
```
## 优先排序策略
### EPSS + CVSS 组合方法
| EPSS 评分 | CVSS 评分 | 优先级 | 行动 |
|----------|----------|--------|------|
| > 0.7 | >= 9.0 | P0 - 立即 | 24 小时内修复 |
| > 0.7 | >= 7.0 | P1 - 紧急 | 48 小时内修复 |
| > 0.4 | >= 7.0 | P2 - 高 | 7 天内修复 |
| > 0.1 | >= 4.0 | P3 - 中 | 30 天内修复 |
| <= 0.1 | >= 7.0 | P3 - 中 | 30 天内修复 |
| <= 0.1 | < 7.0 | P4 - 低 | 90 天内修复 |
### EPSS 百分位阈值
- **前 1%(百分位 >= 0.99)**:极有可能被利用;视同严重级别处理
- **前 5%(百分位 >= 0.95)**:高利用概率;优先修复
- **前 10%(百分位 >= 0.90)**:风险较高;安排近期修复
- **后 50%**:低利用概率;在正常补丁周期中处理
## 实现
```python
import requests
import pandas as pd
from datetime import datetime
def fetch_epss_scores(cve_list):
"""从 FIRST API 批量获取 CVE 列表的 EPSS 评分。"""
scores = {}
batch_size = 100
for i in range(0, len(cve_list), batch_size):
batch = cve_list[i:i + batch_size]
resp = requests.get(
"https://api.first.org/data/v1/epss",
params={"cve": ",".join(batch)},
timeout=30
)
if resp.status_code == 200:
for entry in resp.json().get("data", []):
scores[entry["cve"]] = {
"epss": float(entry["epss"]),
"percentile": float(entry["percentile"]),
"date": entry.get("date", ""),
}
return scores
def prioritize_vulnerabilities(scan_results_csv, output_csv):
"""用 EPSS 评分丰富扫描结果并分配优先级。"""
df = pd.read_csv(scan_results_csv)
cve_list = df["cve_id"].dropna().unique().tolist()
epss_data = fetch_epss_scores(cve_list)
df["epss_score"] = df["cve_id"].map(lambda c: epss_data.get(c, {}).get("epss", 0))
df["epss_percentile"] = df["cve_id"].map(lambda c: epss_data.get(c, {}).get("percentile", 0))
def assign_priority(row):
epss = row.get("epss_score", 0)
cvss = row.get("cvss_score", 0)
if epss > 0.7 and cvss >= 9.0:
return "P0"
if epss > 0.7 and cvss >= 7.0:
return "P1"
if epss > 0.4 and cvss >= 7.0:
return "P2"
if epss > 0.1 or cvss >= 7.0:
return "P3"
return "P4"
df["priority"] = df.apply(assign_priority, axis=1)
df = df.sort_values(["priority", "epss_score"], ascending=[True, False])
df.to_csv(output_csv, index=False)
print(f"[+] 已对 {len(df)} 个漏洞进行优先排序 -> {output_csv}")
print(f" P0: {len(df[df['priority']=='P0'])}")
print(f" P1: {len(df[df['priority']=='P1'])}")
print(f" P2: {len(df[df['priority']=='P2'])}")
print(f" P3: {len(df[df['priority']=='P3'])}")
print(f" P4: {len(df[df['priority']=='P4'])}")
return df
```
## EPSS 趋势分析
```python
def fetch_epss_timeseries(cve_id):
"""获取历史 EPSS 评分用于趋势分析。"""
resp = requests.get(
"https://api.first.org/data/v1/epss",
params={"cve": cve_id, "scope": "time-series"},
timeout=30
)
if resp.status_code == 200:
return resp.json().get("data", [])
return []
def detect_epss_spikes(cve_id, threshold=0.3):
"""检测 EPSS 评分显著上升,指示新兴威胁。"""
timeseries = fetch_epss_timeseries(cve_id)
if len(timeseries) < 2:
return False
sorted_data = sorted(timeseries, key=lambda x: x.get("date", ""))
latest = float(sorted_data[-1].get("epss", 0))
previous = float(sorted_data[-2].get("epss", 0))
increase = latest - previous
if increase >= threshold:
print(f"[!] 检测到 {cve_id} 的 EPSS 激增:{previous:.3f} -> {latest:.3f} (+{increase:.3f})")
return True
return False
```
## 参考资料
- [FIRST EPSS 官网](https://www.first.org/epss/)
- [EPSS API 文档](https://www.first.org/epss/api)
- [EPSS 模型文档](https://www.first.org/epss/model)
- [EPSS 数据下载](https://epss.cyentia.com/)
- [Cyentia Institute 研究](https://www.cyentia.com/epss/)Related Skills
testing-api-for-mass-assignment-vulnerability
测试 API 是否存在批量赋值(mass assignment,自动绑定)漏洞——攻击者可在 API 请求中附加额外参数,从而修改本不应被访问的对象属性。测试人员识别可写端点,向请求体注入未公开字段(role、isAdmin、price、balance),验证服务器是否在未过滤的情况下将这些字段绑定到数据模型。属于 OWASP API3:2023 Broken Object Property Level Authorization 范畴。适用于批量赋值测试、参数绑定滥用、自动绑定漏洞或 API 过度发布(over-posting)相关请求。
performing-web-application-vulnerability-triage
使用 OWASP 风险评级方法论对 DAST/SAST 扫描器的 Web 应用程序漏洞发现进行分类,区分真阳性和假阳性,并确定修复优先级。
performing-vulnerability-scanning-with-nessus
使用 Tenable Nessus 执行认证和未认证漏洞扫描,识别网络基础设施、服务器和应用程序中的已知漏洞、 错误配置、默认凭据和缺失补丁。扫描器将发现与 CVE 数据库和 CVSS 评分关联,生成优先级修复指导。 适用于漏洞扫描、Nessus 评估、补丁合规检查或自动化漏洞检测等请求场景。
performing-ssrf-vulnerability-exploitation
通过探测云元数据端点、内网服务和协议处理器,检测用户可控 URL 参数中的 服务端请求伪造(SSRF)漏洞。测试 AWS/GCP/Azure 元数据 API(169.254.169.254)、 通过 HTTP 进行内网端口扫描、URL 协议绕过技术以及 DNS 重绑定检测。
performing-ot-vulnerability-scanning-safely
使用被动监控、原生协议查询和经过精心控制的Tenable OT Security主动扫描,在OT/ICS环境中安全执行漏洞扫描,在不破坏工业过程或导致旧版控制器崩溃的情况下识别漏洞。
performing-ot-vulnerability-assessment-with-claroty
本技能涵盖使用Claroty xDome平台在OT环境中执行漏洞评估,实现全面资产发现、风险评分、漏洞关联和修复优先级排序。内容涉及通过流量分析进行被动漏洞识别、OT设备安全主动查询、与CVE数据库和ICS-CERT公告集成,以及考虑运营影响和补偿控制措施的基于风险的优先级排序。
performing-endpoint-vulnerability-remediation
通过基于风险评分对 CVE 进行优先级排序、部署补丁、应用配置变更和验证修复 来执行端点漏洞修复。适用于修复漏洞扫描发现的问题、响应严重 CVE 公告 或维护端点合规性与补丁管理 SLA 的场景。适用于涉及漏洞修复、CVE 补丁、 端点漏洞管理或安全修复部署的请求。
performing-cve-prioritization-with-kev-catalog
结合 CISA 已知被利用漏洞(KEV)目录、EPSS 和 CVSS,基于真实世界的漏洞利用证据对 CVE 修复工作进行优先级排序。
performing-authenticated-vulnerability-scan
认证(凭据)漏洞扫描使用有效的系统凭据登录目标主机,对已安装软件、补丁、配置和安全设置进行深度检查,相比未认证扫描可发现 45-60% 更多漏洞。
performing-agentless-vulnerability-scanning
配置并执行无代理漏洞扫描(agentless vulnerability scanning),利用网络协议、云快照分析和基于 API 的发现方式评估系统安全,无需在端点安装 Agent。
performing-active-directory-vulnerability-assessment
使用 PingCastle、BloodHound 和 Purple Knight 评估 Active Directory 安全态势,识别错误配置、权限提升路径和攻击向量。
implementing-zero-trust-with-hashicorp-boundary
使用 HashiCorp Boundary 实现具备动态凭据代理、会话录制和 Vault 集成的身份感知零信任基础设施访问管理。