Overview
CVE intelligence manager that fetches recent CVEs from the NVD API, normalizes CVSS and CPE data, and analyzes exploitability using CVSS component scoring and threat indicators.
Description
The CVEIntelligenceManager class provides two main methods. fetch_latest_cves queries the NVD API v2.0 for CVEs modified within a time window, filters by severity, extracts CVSS v3.1/v3.0/v2.0 scores, parses CPE affected software, and returns normalized CVE entries. analyze_cve_exploitability fetches a specific CVE, extracts CVSS metrics (attack vector, complexity, privileges required, user interaction), calculates an exploitability score (0-1), checks references for public exploit indicators, and produces a threat intelligence report with weaponization level and priority recommendation.
Usage
- CVE monitoring: Call fetch_latest_cves(hours, severity_filter) to get recent CVEs
- Exploitability analysis: Call analyze_cve_exploitability(cve_id) for a single CVE's exploit potential
- Flask endpoints: Available at /api/vuln-intel/cve-monitor and via exploit-generate endpoint
Code Reference
Source Location
- Repository: HexStrike AI
- File: hexstrike_server.py
- Lines: L5750-6614 (CVEIntelligenceManager class); fetch_latest_cves at L5955-6157; analyze_cve_exploitability at L6159-6396
Signature
class CVEIntelligenceManager:
def fetch_latest_cves(self, hours: int = 24, severity_filter: str = "HIGH,CRITICAL") -> Dict[str, Any]:
"""Fetch latest CVEs from NVD and other real sources."""
def analyze_cve_exploitability(self, cve_id: str) -> Dict[str, Any]:
"""Analyze CVE exploitability using real CVE data and threat intelligence."""
def search_existing_exploits(self, cve_id: str) -> Dict[str, Any]:
"""Search for existing exploits from real sources (GitHub, ExploitDB)."""
Import
from hexstrike_server import CVEIntelligenceManager
I/O Contract
Inputs
| Name |
Type |
Required |
Description
|
| hours |
int |
No |
Lookback period in hours (default 24)
|
| severity_filter |
str |
No |
Comma-separated severity levels (default "HIGH,CRITICAL")
|
| cve_id |
str |
Yes (analyze_cve_exploitability) |
CVE identifier (e.g. "CVE-2024-1234")
|
Outputs
| Name |
Type |
Description
|
| cves |
List[Dict] |
Normalized CVE entries with cve_id, description, severity, cvss_score, affected_software
|
| total_found |
int |
Number of CVEs found
|
| exploitability_score |
float |
0.0-1.0 exploit potential
|
| exploitability_level |
str |
HIGH/MEDIUM/LOW/VERY_LOW
|
| threat_intelligence |
Dict |
active_exploitation, exploit_prediction, recommended_priority
|
| exploit_availability |
Dict |
public_exploits, exploit_maturity, weaponization_level
|
Usage Examples
Fetching Recent Critical CVEs
from hexstrike_server import CVEIntelligenceManager
cve_mgr = CVEIntelligenceManager()
# Fetch critical CVEs from the last 48 hours
result = cve_mgr.fetch_latest_cves(hours=48, severity_filter="CRITICAL")
print(f"Found {result['total_found']} CVEs")
for cve in result["cves"][:5]:
print(f" {cve['cve_id']}: CVSS {cve['cvss_score']} - {cve['description'][:80]}")
Analyzing CVE Exploitability
# Analyze a specific CVE's exploit potential
analysis = cve_mgr.analyze_cve_exploitability("CVE-2024-1234")
print(f"Exploitability: {analysis['exploitability_level']} ({analysis['exploitability_score']:.2f})")
print(f"Attack vector: {analysis['attack_vector']}")
print(f"Public exploits: {analysis['exploit_availability']['public_exploits']}")
print(f"Priority: {analysis['threat_intelligence']['recommended_priority']}")
Related Pages
Implements Principle
Uses Heuristic
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.