

Note: This implementation creates an AI-powered vulnerability analysis and monitoring system for the ICARAX tech blog. It uses AI APIs to analyze, summarize, and monitor the CVE-2024-38193 (Windows Ancillary Function Driver privilege escalation) vulnerability. This is defensive security tooling for researchers and defenders.
| Service | Purpose | Get Key |
|---|---|---|
| OpenAI | GPT-4o for vulnerability analysis & blog generation | platform.openai.com |
| Anthropic | Claude 3.5 Sonnet for technical deep-dives | console.anthropic.com |
| GitHub | Advisory database & PoC monitoring | GitHub Settings → Tokens |
| NVD/CVE | Official vulnerability data (no key required) | — |
| Twitter/X API | Threat intel monitoring (optional) | developer.twitter.com |
# Required versions
Python >= 3.11
Node.js >= 20 LTS
pnpm >= 9.x (or npm/yarn)
# Recommended tools
- uv (Python package manager) - faster than pip
- direnv (auto-load .env files)
- jq (JSON processing for CLI)
# macOS
brew install uv node pnpm jq direnv
# Ubuntu/Debian
curl -LsSf https://astral.sh/uv/install.sh | sh
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs jq direnv
sudo npm install -g pnpm
# Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex
winget install OpenJS.NodeJS
pnpm setup
icarax-vuln-analysis/
├── .env.example
├── .env # Your secrets (gitignored)
├── pyproject.toml
├── package.json
├── src/
│ ├── python/
│ │ ├── icarax/
│ │ │ ├── __init__.py
│ │ │ ├── config.py
│ │ │ ├── models.py
│ │ │ ├── collectors/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── nvd.py
│ │ │ │ ├── github.py
│ │ │ │ └── mitre.py
│ │ │ ├── analyzers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── ai_analyzer.py
│ │ │ │ └── risk_scorer.py
│ │ │ ├── generators/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── blog_generator.py
│ │ │ │ └── report_generator.py
│ │ │ ├── publishers/
│ │ │ │ ├── __init__.py
│ │ │ │ └── webhook_publisher.py
│ │ │ └── cli.py
│ │ └── tests/
│ └── typescript/
│ ├── src/
│ │ ├── config.ts
│ │ ├── types.ts
│ │ ├── collectors/
│ │ ├── analyzers/
│ │ ├── generators/
│ │ └── index.ts
│ ├── package.json
│ └── tsconfig.json
├── scripts/
│ ├── run_analysis.py
│ ├── generate_blog.py
│ └── monitor.sh
└── docker/
├── Dockerfile.python
├── Dockerfile.node
└── docker-compose.yml
# Create project directory
mkdir icarax-vuln-analysis && cd icarax-vuln-analysis
# Initialize with uv (modern Python packaging)
uv init --name icarax-vuln-analysis --python 3.11
# Add dependencies
uv add \
openai>=1.35.0 \
anthropic>=0.30.0 \
pydantic>=2.8.0 \
pydantic-settings>=2.3.0 \
httpx>=0.27.0 \
tenacity>=8.3.0 \
python-dotenv>=1.0.0 \
rich>=13.7.0 \
typer>=0.12.0 \
loguru>=0.7.0 \
pytest>=8.2.0 \
pytest-asyncio>=0.23.0 \
pytest-mock>=3.12.0
# Add dev dependencies
uv add --dev ruff mypy pre-commit
pyproject.toml (generated + enhanced):
[project]
name = "icarax-vuln-analysis"
version = "0.1.0"
description = "AI-powered vulnerability analysis for ICARAX tech blog"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"openai>=1.35.0",
"anthropic>=0.30.0",
"pydantic>=2.8.0",
"pydantic-settings>=2.3.0",
"httpx>=0.27.0",
"tenacity>=8.3.0",
"python-dotenv>=1.0.0",
"rich>=13.7.0",
"typer>=0.12.0",
"loguru>=0.7.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.2.0",
"pytest-asyncio>=0.23.0",
"pytest-mock>=3.12.0",
"ruff>=0.5.0",
"mypy>=1.10.0",
"pre-commit>=3.7.0",
]
[tool.uv]
dev-dependencies = ["pytest", "ruff", "mypy", "pre-commit"]
[tool.ruff]
line-length = 100
target-version = "py311"
lint.select = ["E", "F", "I", "UP", "B", "C4", "PTH", "SIM", "T20", "ARG", "ERA", "PD", "PL", "TRY", "NPY", "RSE", "RET", "ASYNC"]
format.quote-style = "double"
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
# Create TypeScript project
mkdir -p src/typescript
cd src/typescript
# Initialize package.json
cat > package.json << 'EOF'
{
"name": "icarax-vuln-analysis-ts",
"version": "0.1.0",
"type": "module",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "tsx watch src/index.ts",
"test": "vitest run",
"lint": "eslint src --ext .ts"
},
"dependencies": {
"openai": "^4.55.0",
"@anthropic-ai/sdk": "^0.24.0",
"zod": "^3.23.0",
"axios": "^1.7.0",
"pino": "^9.0.0",
"pino-pretty": "^11.0.0",
"commander": "^12.0.0",
"dotenv": "^16.4.0"
},
"devDependencies": {
"@types/node": "^20.14.0",
"typescript": "^5.5.0",
"tsx": "^4.16.0",
"vitest": "^2.0.0",
"eslint": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0"
}
}
EOF
# TypeScript config
cat > tsconfig.json << 'EOF'
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2022"],
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
EOF
# Install dependencies
pnpm install
cd ../..
# src/icarax/config.py
"""Central configuration management using Pydantic Settings."""
from functools import lru_cache
from pathlib import Path
from typing import Literal, Optional
from pydantic import Field, HttpUrl, SecretStr
from pydantic_settings import BaseSettings, SettingsConfigDict
class AIProviderSettings(BaseSettings):
"""AI provider API configuration."""
model_config = SettingsConfigDict(env_prefix="AI_", extra="ignore")
# OpenAI
openai_api_key: Optional[SecretStr] = Field(default=None, alias="OPENAI_API_KEY")
openai_model: str = Field(default="gpt-4o", alias="OPENAI_MODEL")
openai_base_url: Optional[HttpUrl] = Field(default=None, alias="OPENAI_BASE_URL")
# Anthropic
anthropic_api_key: Optional[SecretStr] = Field(default=None, alias="ANTHROPIC_API_KEY")
anthropic_model: str = Field(default="claude-3-5-sonnet-20241022", alias="ANTHROPIC_MODEL")
# Default provider
default_provider: Literal["openai", "anthropic"] = Field(
default="openai", alias="AI_DEFAULT_PROVIDER"
)
# Request settings
max_tokens: int = Field(default=4096, alias="AI_MAX_TOKENS")
temperature: float = Field(default=0.1, alias="AI_TEMPERATURE")
timeout_seconds: int = Field(default=60, alias="AI_TIMEOUT_SECONDS")
max_retries: int = Field(default=3, alias="AI_MAX_RETRIES")
class CollectorSettings(BaseSettings):
"""Data collector configuration."""
model_config = SettingsConfigDict(env_prefix="COLLECTOR_", extra="ignore")
github_token: Optional[SecretStr] = Field(default=None, alias="GITHUB_TOKEN")
nvd_api_key: Optional[SecretStr] = Field(default=None, alias="NVD_API_KEY")
mitre_attack_api_key: Optional[SecretStr] = Field(default=None, alias="MITRE_API_KEY")
# Rate limiting
requests_per_minute: int = Field(default=60, alias="COLLECTOR_RPM")
request_timeout: int = Field(default=30, alias="COLLECTOR_TIMEOUT")
class BlogSettings(BaseSettings):
"""Blog generation configuration."""
model_config = SettingsConfigDict(env_prefix="BLOG_", extra="ignore")
site_name: str = Field(default="ICARAX Security Research", alias="BLOG_SITE_NAME")
site_url: HttpUrl = Field(default="https://icarax.example.com", alias="BLOG_SITE_URL")
author_name: str = Field(default="ICARAX Research Team", alias="BLOG_AUTHOR")
author_twitter: Optional[str] = Field(default=None, alias="BLOG_AUTHOR_TWITTER")
# Output
output_dir: Path = Field(default=Path("./output"), alias="BLOG_OUTPUT_DIR")
template_dir: Path = Field(default=Path("./templates"), alias="BLOG_TEMPLATE_DIR")
class Settings(BaseSettings):
"""Main application settings."""
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=False,
extra="ignore",
)
ai: AIProviderSettings = Field(default_factory=AIProviderSettings)
collectors: CollectorSettings = Field(default_factory=CollectorSettings)
blog: BlogSettings = Field(default_factory=BlogSettings)
# Logging
log_level: str = Field(default="INFO", alias="LOG_LEVEL")
log_format: Literal["json", "console"] = Field(default="console", alias="LOG_FORMAT")
# Feature flags
enable_monitoring: bool = Field(default=True, alias="ENABLE_MONITORING")
enable_blog_generation: bool = Field(default=True, alias="ENABLE_BLOG_GENERATION")
@lru_cache
def get_settings() -> Settings:
"""Get cached settings instance."""
return Settings()
# Export for convenience
settings = get_settings()
# src/icarax/models.py
"""Core data models for vulnerability analysis."""
from datetime import datetime
from enum import Enum
from typing import Any, Optional
from uuid import UUID, uuid4
from pydantic import BaseModel, Field, HttpUrl, field_validator
class SeverityLevel(str, Enum):
"""CVSS severity levels."""
NONE = "NONE"
LOW = "LOW"
MEDIUM = "MEDIUM"
HIGH = "HIGH"
CRITICAL = "CRITICAL"
class ExploitMaturity(str, Enum):
"""Exploit availability maturity."""
UNPROVEN = "UNPROVEN"
PROOF_OF_CONCEPT = "PROOF_OF_CONCEPT"
FUNCTIONAL = "FUNCTIONAL"
HIGH = "HIGH"
WEAPONIZED = "WEAPONIZED"
class VulnerabilitySource(str, Enum):
"""Source of vulnerability data."""
NVD = "NVD"
GITHUB_ADVISORY = "GITHUB_ADVISORY"
MITRE = "MITRE"
VENDOR = "VENDOR"
RESEARCHER = "RESEARCHER"
class CVEReference(BaseModel):
"""Reference link for a CVE."""
url: HttpUrl
source: str
tags: list[str] = Field(default_factory=list)
description: Optional[str] = None
class CVSSVector(BaseModel):
"""Parsed CVSS vector components."""
version: str = "3.1"
attack_vector: str # N, A, L, P
attack_complexity: str # L, H
privileges_required: str # N, L, H
user_interaction: str # N, R
scope: str # U, C
confidentiality: str # N, L, H
integrity: str # N, L, H
availability: str # N, L, H
@property
def vector_string(self) -> str:
return (
f"CVSS:{self.version}/AV:{self.attack_vector}/AC:{self.attack_complexity}"
f"/PR:{self.privileges_required}/UI:{self.user_interaction}/S:{self.scope}"
f"/C:{self.confidentiality}/I:{self.integrity}/A:{self.availability}"
)
class Vulnerability(BaseModel):
"""Core vulnerability model."""
id: UUID = Field(default_factory=uuid4)
cve_id: str # e.g., "CVE-2024-38193"
title: str
description: str
severity: SeverityLevel
cvss_score: Optional[float] = None
cvss_vector: Optional[CVSSVector] = None
cwe_ids: list[str] = Field(default_factory=list) # e.g., ["CWE-269"]
affected_products: list[str] = Field(default_factory=list)
references: list[CVEReference] = Field(default_factory=list)
source: VulnerabilitySource = VulnerabilitySource.NVD
published_date: Optional[datetime] = None
last_modified_date: Optional[datetime] = None
exploit_maturity: ExploitMaturity = ExploitMaturity.UNPROVEN
has_poc: bool = False
poc_urls: list[HttpUrl] = Field(default_factory=list)
patch_available: bool = False
patch_urls: list[HttpUrl] = Field(default_factory=list)
tags: list[str] = Field(default_factory=list)
raw_data: dict[str, Any] = Field(default_factory=dict, exclude=True)
@field_validator("cve_id")
@classmethod
def validate_cve_id(cls, v: str) -> str:
if not v.upper().startswith("CVE-"):
raise ValueError("CVE ID must start with 'CVE-'")
return v.upper()
def get_risk_score(self) -> float:
"""Calculate composite risk score (0-100)."""
base = self.cvss_score or 0.0
exploit_bonus = {
ExploitMaturity.UNPROVEN: 0,
ExploitMaturity.PROOF_OF_CONCEPT: 5,
ExploitMaturity.FUNCTIONAL: 15,
ExploitMaturity.HIGH: 25,
ExploitMaturity.WEAPONIZED: 35,
}.get(self.exploit_maturity, 0)
patch_penalty = 0 if self.patch_available else 10
return min(100, base * 10 + exploit_bonus + patch_penalty)
class AIAnalysis(BaseModel):
"""AI-generated analysis of a vulnerability."""
vulnerability_id: UUID
provider: str
model: str
summary: str
technical_details: str
impact_assessment: str
mitigation_recommendations: list[str]
detection_guidance: str
exploit_likelihood: str # LOW, MEDIUM, HIGH, CRITICAL
confidence_score: float = Field(ge=0.0, le=1.0)
generated_at: datetime = Field(default_factory=datetime.utcnow)
tokens_used: int = 0
cost_usd: float = 0.0
class BlogPost(BaseModel):
"""Generated blog post model."""
id: UUID = Field(default_factory=uuid4)
vulnerability: Vulnerability
title: str
slug: str
content_markdown: str
content_html: Optional[str] = None
summary: str
tags: list[str] = Field(default_factory=list)
author: str
published_at: Optional[datetime] = None
seo_keywords: list[str] = Field(default_factory=list)
meta_description: str = ""
reading_time_minutes: int = 0
ai_analysis: Optional[AIAnalysis] = None
# src/icarax/collectors/nvd.py
"""NVD (National Vulnerability Database) collector."""
import asyncio
import json
from datetime import datetime, timedelta
from typing import AsyncIterator, Optional
from urllib.parse import urlencode
import httpx
from loguru import logger
from tenacity import (
retry,
stop_after_attempt,
wait_exponential,
retry_if_exception_type,
)
from icarax.config import get_settings
from icarax.models import (
CVEReference,
CVSSVector,
SeverityLevel,
Vulnerability,
VulnerabilitySource,
)
class NVDCollector:
"""Collects vulnerability data from NVD API 2.0."""
BASE_URL = "https://services.nvd.nist.gov/rest/json/cves/2.0"
RESULTS_PER_PAGE = 2000
def __init__(self, api_key: Optional[str] = None):
self.api_key = api_key or get_settings().collectors.nvd_api_key
self.client = httpx.AsyncClient(
timeout=httpx.Timeout(30.0),
headers={
"User-Agent": "ICARAX-VulnAnalysis/1.0 (+https://icarax.example.com)",
**({"apiKey": self.api_key.get_secret_value()} if self.api_key else {}),
},
)
self._semaphore = asyncio.Semaphore(5) # Rate limiting
async def __aenter__(self):
return self
async def __aexit__(self, *args):
await self.client.aclose()
@retry(
wait=wait_exponential(multiplier=1, min=2, max=30),
stop=stop_after_attempt(3),
retry=retry_if_exception_type((httpx.TimeoutException, httpx.NetworkError)),
)
async def _fetch_page(self, params: dict) -> dict:
"""Fetch a single page of results with retry logic."""
async with self._semaphore:
response = await self.client.get(self.BASE_URL, params=params)
response.raise_for_status()
return response.json()
def _parse_cvss_v3(self, metrics: list[dict]) -> tuple[Optional[float], Optional[CVSSVector]]:
"""Parse CVSS v3.x metrics from NVD response."""
for metric in metrics:
cvss_data = metric.get("cvssData", {})
if cvss_data.get("version", "").startswith("3."):
vector = cvss_data.get("vectorString", "")
# Parse vector string: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
parts = dict(p.split(":") for p in vector.split("/") if ":" in p)
try:
cvss_vector = CVSSVector(
version=parts.get("CVSS", "3.1"),
attack_vector=parts.get("AV", "N"),
attack_complexity=parts.get("AC", "L"),
privileges_required=parts.get("PR", "N"),
user_interaction=parts.get("UI", "N"),
scope=parts.get("S", "U"),
confidentiality=parts.get("C", "H"),
integrity=parts.get("I", "H"),
availability=parts.get("A", "H"),
)
return cvss_data.get("baseScore"), cvss_vector
except Exception as e:
logger.warning(f"Failed to parse CVSS vector: {e}")
return None, None
def _parse_severity(self, score: Optional[float]) -> SeverityLevel:
"""Convert CVSS score to severity level."""
if score is None:
return SeverityLevel.NONE
if score >= 9.0:
return SeverityLevel.CRITICAL
if score >= 7.0:
return SeverityLevel.HIGH
if score >= 4.0:
return SeverityLevel.MEDIUM
if score > 0.0:
return SeverityLevel.LOW
return SeverityLevel.NONE
def _extract_references(self, refs: list[dict]) -> list[CVEReference]:
"""Extract and categorize reference links."""
references = []
for ref in refs:
url = ref.get("url", "")
if not url:
continue
tags = ref.get("tags", [])
source = "unknown"
if "github.com" in url:
source = "github"
elif "microsoft.com" in url:
source = "vendor"
elif "mitre.org" in url:
source = "mitre"
references.append(
CVEReference(
url=url,
source=source,
tags=tags,
description=ref.get("source", ""),
)
)
return references
def _parse_vulnerability(self, cve_item: dict) -> Vulnerability:
"""Parse a single CVE item from NVD response."""
cve = cve_item.get("cve", {})
cve_id = cve.get("id", "")
# Descriptions
descriptions = cve.get("descriptions", [])
description = next(
(d["value"] for d in descriptions if d["lang"] == "en"),
"No description available",
)
# CVSS metrics
metrics = cve.get("metrics", {})
cvss_score, cvss_vector = self._parse_cvss_v3(metrics.get("cvssMetricV31", []))
if cvss_score is None:
cvss_score, cvss_vector = self._parse_cvss_v3(metrics.get("cvssMetricV30", []))
# CWE IDs
cwe_ids = []
for weakness in cve.get("weaknesses", []):
for desc in weakness.get("description", []):
if desc["lang"] == "en" and desc["value"].startswith("CWE-"):
cwe_ids.append(desc["value"])
# Affected products (CPE)
affected_products = []
for config in cve.get("configurations", []):
for node in config.get("nodes", []):
for cpe_match in node.get("cpeMatch", []):
if cpe_match.get("vulnerable"):
cpe = cpe_match.get("criteria", "")
# Extract product name from CPE: cpe:2.3:o:microsoft:windows_10:*:*:*:*:*:*:*:*
parts = cpe.split(":")
if len(parts) >= 5:
affected_products.append(f"{parts[3]}:{parts[4]}")
# References
references = self._extract_references(cve.get("references", []))
# Dates
published = cve.get("published")
modified = cve.get("lastModified")
published_date = datetime.fromisoformat(published.replace("Z", "+00:00")) if published else None
modified_date = datetime.fromisoformat(modified.replace("Z", "+00:00")) if modified else None
return Vulnerability(
cve_id=cve_id,
title=cve_id, # Will be enhanced by AI
description=description,
severity=self._parse_severity(cvss_score),
cvss_score=cvss_score,
cvss_vector=cvss_vector,
cwe_ids=cwe_ids,
affected_products=list(set(affected_products)),
references=references,
source=VulnerabilitySource.NVD,
published_date=published_date,
last_modified_date=modified_date,
raw_data=cve_item,
)
async def fetch_cve(self, cve_id: str) -> Optional[Vulnerability]:
"""Fetch a specific CVE by ID."""
logger.info(f"Fetching {cve_id} from NVD")
params = {"cveId": cve_id.upper()}
try:
data = await self._fetch_page(params)
vulnerabilities = data.get("vulnerabilities", [])
if not vulnerabilities:
logger.warning(f"No data found for {cve_id}")
return None
return self._parse_vulnerability(vulnerabilities[0])
except httpx.HTTPStatusError as e:
if e.response.status_code == 404:
logger.warning(f"CVE {cve_id} not found in NVD")
return None
raise
async def fetch_recent(
self,
days_back: int = 7,
min_severity: Optional[SeverityLevel] = None,
keyword: Optional[str] = None,
) -> AsyncIterator[Vulnerability]:
"""Fetch recent vulnerabilities."""
pub_start = (datetime.utcnow() - timedelta(days=days_back)).strftime("%Y-%m-%dT%H:%M:%S.000")
params = {
"pubStartDate": pub_start,
"resultsPerPage": self.RESULTS_PER_PAGE,
}
if keyword:
params["keywordSearch"] = keyword
start_index = 0
total_results = None
while True:
params["startIndex"] = start_index
data = await self._fetch_page(params)
if total_results is None:
total_results = data.get("totalResults", 0)
logger.info(f"Found {total_results} total vulnerabilities")
vulnerabilities = data.get("vulnerabilities", [])
if not vulnerabilities:
break
for vuln_item in vulnerabilities:
vuln = self._parse_vulnerability(vuln_item)
if min_severity and vuln.severity.value < min_severity.value:
continue
yield vuln
start_index += len(vulnerabilities)
if start_index >= total_results:
break
# Rate limiting courtesy delay
await asyncio.sleep(0.5)
# Convenience function for CLI usage
async def fetch_cve_2024_38193() -> Optional[Vulnerability]:
"""Fetch the specific Windows 0-day CVE-2024-38193."""
async with NVDCollector() as collector:
return await collector.fetch_cve("CVE-2024-38193")
# src/icarax/collectors/github.py
"""GitHub Advisory and PoC collector."""
import asyncio
import re
from datetime import datetime
from typing import AsyncIterator, Optional
import httpx
from loguru import logger
from icarax.config import get_settings
from icarax.models import (
CVEReference,
ExploitMaturity,
Vulnerability,
VulnerabilitySource,
)
class GitHubCollector:
"""Collects vulnerability data from GitHub Security Advisories and searches for PoCs."""
GRAPHQL_URL = "https://api.github.com/graphql"
REST_URL = "https://api.github.com"
def __init__(self, token: Optional[str] = None):
self.token = token or get_settings().collectors.github_token
self.headers = {
"Authorization": f"Bearer {self.token.get_secret_value()}" if self.token else "",
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
"User-Agent": "ICARAX-VulnAnalysis/1.0",
}
self.client = httpx.AsyncClient(timeout=30.0, headers=self.headers)
self._semaphore = asyncio.Semaphore(10)
async def __aenter__(self):
return self
async def __aexit__(self, *args):
await self.client.aclose()
async def _graphql_query(self, query: str, variables: dict) -> dict:
"""Execute a GraphQL query."""
async with self._semaphore:
response = await self.client.post(
self.GRAPHQL_URL,
json={"query": query, "variables": variables},
)
response.raise_for_status()
data = response.json()
if "errors" in data:
raise RuntimeError(f"GraphQL errors: {data['errors']}")
return data.get("data", {})
async def fetch_advisory(self, cve_id: str) -> Optional[dict]:
"""Fetch GitHub Security Advisory for a CVE."""
query = """
query($cveId: String!) {
securityAdvisories(first: 1, identifier: $cveId) {
nodes {
ghsaId
summary
description
severity
cvss {
score
vectorString
}
identifiers { type value }
references { url }
publishedAt
updatedAt
withdrawnAt
}
}
}
"""
data = await self._graphql_query(query, {"cveId": cve_id.upper()})
advisories = data.get("securityAdvisories", {}).get("nodes", [])
return advisories[0] if advisories else None
async def search_pocs(self, cve_id: str, max_results: int = 20) -> list[dict]:
"""Search for PoC repositories related to a CVE."""
query = f"{cve_id} exploit OR poc OR proof-of-concept"
url = f"{self.REST_URL}/search/repositories"
params = {
"q": query,
"sort": "stars",
"order": "desc",
"per_page": max_results,
}
async with self._semaphore:
response = await self.client.get(url, params=params)
response.raise_for_status()
data = response.json()
return data.get("items", [])
def _assess_exploit_maturity(self, repos: list[dict]) -> tuple[ExploitMaturity, list[str]]:
"""Assess exploit maturity based on repository characteristics."""
if not repos:
return ExploitMaturity.UNPROVEN, []
poc_urls = []
max_maturity = ExploitMaturity.UNPROVEN
for repo in repos:
url = repo.get("html_url", "")
description = (repo.get("description") or "").lower()
stars = repo.get("stargazers_count", 0)
forks = repo.get("forks_count", 0)
topics = [t.lower() for t in repo.get("topics", [])]
poc_urls.append(url)
# Heuristics for maturity
maturity = ExploitMaturity.PROOF_OF_CONCEPT
if "weaponized" in topics or "malware" in topics:
maturity = ExploitMaturity.WEAPONIZED
elif "exploit" in topics and stars > 50:
maturity = ExploitMaturity.HIGH
elif "exploit" in description and stars > 10:
maturity = ExploitMaturity.FUNCTIONAL
elif stars > 100 or forks > 50:
maturity = ExploitMaturity.FUNCTIONAL
if maturity.value > max_maturity.value:
max_maturity = maturity
return max_maturity, poc_urls[:10] # Limit to top 10
async def enrich_vulnerability(self, vuln: Vulnerability) -> Vulnerability:
"""Enrich a vulnerability with GitHub data."""
logger.info(f"Enriching {vuln.cve_id} with GitHub data")
# Fetch advisory
advisory = await self.fetch_advisory(vuln.cve_id)
if advisory:
vuln.description = advisory.get("description", vuln.description)
vuln.references.extend([
CVEReference(url=ref["url"], source="github_advisory", tags=["advisory"])
for ref in advisory.get("references", [])
])
# Update severity if GitHub has different assessment
gh_severity = advisory.get("severity", "").upper()
---
## Next Steps
1. **Get API Access** - Sign up at the official website
2. **Try the Examples** - Run the code snippets above
3. **Read the Docs** - Check official documentation
4. **Join Communities** - Discord, Reddit, GitHub discussions
5. **Experiment** - Build something cool!
## Further Reading
- [TechCrunch AI](https://techcrunch.com/category/artificial-intelligence/)
- [The Verge](https://www.theverge.com/technology)
- [Wired AI](https://www.wired.com/tag/artificial-intelligence/)
- [Medium AI](https://medium.com/topic/artificial-intelligence)
**Source:** [Ars Technica AI](https://arstechnica.com/security/2026/11/windows-0-day-dropped-by-disgruntled-researcher-hands-hackers-system-rights/)
---
*Follow ICARAX for more AI insights and tutorials.*
