ctf-agent 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +131 -0
- package/Dockerfile +192 -0
- package/README.md +522 -0
- package/agents/ctf-analyzer.md +58 -0
- package/agents/ctf-controller.md +151 -0
- package/agents/ctf-speedrun.md +74 -0
- package/bin/ctf-agent.js +119 -0
- package/docker-compose.yml +13 -0
- package/mcp_config.json +19 -0
- package/package.json +44 -0
- package/references/ctf-triage-ladder.md +68 -0
- package/references/exploit-databases.md +575 -0
- package/references/llm-safety-and-policy-compliance.md +173 -0
- package/references/multi-agent-orchestration-and-policy-routing.md +278 -0
- package/references/security-events-and-intelligence.md +566 -0
- package/references/version-matrix.md +59 -0
- package/rules/ctf-execution-rules.md +44 -0
- package/rules/ctf-safety-framing-rules.md +140 -0
- package/rules/flag-validation-rules.md +25 -0
- package/scripts/__init__.py +1 -0
- package/scripts/ctf-tools.lock +205 -0
- package/scripts/ctf_init.py +1026 -0
- package/scripts/ctf_update.py +583 -0
- package/scripts/ctfd_client.py +81 -0
- package/scripts/cve_lookup.py +453 -0
- package/scripts/extract_flags.py +155 -0
- package/scripts/install_as_agent.py +278 -0
- package/scripts/install_ctf_tools.sh +603 -0
- package/scripts/parallel_triage.py +395 -0
- package/scripts/prompt_policy_sanitizer.py +283 -0
- package/scripts/scope_guard.py +444 -0
- package/scripts/skill_validator.py +504 -0
- package/scripts/workspace_cleaner.py +141 -0
- package/skills/ctf-ai-ml/SKILL.md +120 -0
- package/skills/ctf-ai-ml/adversarial-ml.md +623 -0
- package/skills/ctf-ai-ml/llm-attacks.md +487 -0
- package/skills/ctf-ai-ml/model-attacks.md +422 -0
- package/skills/ctf-crypto/SKILL.md +320 -0
- package/skills/ctf-crypto/advanced-math.md +798 -0
- package/skills/ctf-crypto/classic-ciphers.md +651 -0
- package/skills/ctf-crypto/ecc-attacks.md +347 -0
- package/skills/ctf-crypto/exotic-crypto-2.md +380 -0
- package/skills/ctf-crypto/exotic-crypto.md +528 -0
- package/skills/ctf-crypto/historical.md +113 -0
- package/skills/ctf-crypto/lattice-and-lwe.md +524 -0
- package/skills/ctf-crypto/modern-ciphers-2.md +563 -0
- package/skills/ctf-crypto/modern-ciphers-3.md +453 -0
- package/skills/ctf-crypto/modern-ciphers.md +649 -0
- package/skills/ctf-crypto/prng-attacks.md +257 -0
- package/skills/ctf-crypto/prng.md +664 -0
- package/skills/ctf-crypto/rsa-attacks-2.md +792 -0
- package/skills/ctf-crypto/rsa-attacks.md +487 -0
- package/skills/ctf-crypto/stream-ciphers.md +390 -0
- package/skills/ctf-crypto/zkp-and-advanced.md +456 -0
- package/skills/ctf-forensics/3d-printing.md +121 -0
- package/skills/ctf-forensics/SKILL.md +379 -0
- package/skills/ctf-forensics/disk-advanced.md +497 -0
- package/skills/ctf-forensics/disk-and-memory.md +491 -0
- package/skills/ctf-forensics/disk-recovery.md +699 -0
- package/skills/ctf-forensics/linux-forensics.md +511 -0
- package/skills/ctf-forensics/network-advanced.md +583 -0
- package/skills/ctf-forensics/network.md +645 -0
- package/skills/ctf-forensics/peripheral-capture.md +287 -0
- package/skills/ctf-forensics/signals-and-hardware.md +713 -0
- package/skills/ctf-forensics/steganography.md +694 -0
- package/skills/ctf-forensics/stego-advanced-2.md +475 -0
- package/skills/ctf-forensics/stego-advanced.md +481 -0
- package/skills/ctf-forensics/stego-image.md +691 -0
- package/skills/ctf-forensics/windows.md +625 -0
- package/skills/ctf-malware/SKILL.md +181 -0
- package/skills/ctf-malware/c2-and-protocols.md +274 -0
- package/skills/ctf-malware/pe-and-dotnet.md +108 -0
- package/skills/ctf-malware/scripts-and-obfuscation.md +449 -0
- package/skills/ctf-misc/SKILL.md +498 -0
- package/skills/ctf-misc/bashjails.md +323 -0
- package/skills/ctf-misc/ctfd-navigation.md +465 -0
- package/skills/ctf-misc/dns.md +255 -0
- package/skills/ctf-misc/encodings-advanced.md +504 -0
- package/skills/ctf-misc/encodings.md +431 -0
- package/skills/ctf-misc/games-and-vms-2.md +254 -0
- package/skills/ctf-misc/games-and-vms-3.md +690 -0
- package/skills/ctf-misc/games-and-vms-4.md +229 -0
- package/skills/ctf-misc/games-and-vms.md +529 -0
- package/skills/ctf-misc/linux-privesc.md +333 -0
- package/skills/ctf-misc/pyjails.md +671 -0
- package/skills/ctf-misc/rf-sdr.md +91 -0
- package/skills/ctf-osint/SKILL.md +198 -0
- package/skills/ctf-osint/geolocation-and-media.md +464 -0
- package/skills/ctf-osint/social-media.md +312 -0
- package/skills/ctf-osint/web-and-dns.md +341 -0
- package/skills/ctf-pwn/SKILL.md +214 -0
- package/skills/ctf-pwn/advanced-exploits-2.md +579 -0
- package/skills/ctf-pwn/advanced-exploits-3.md +598 -0
- package/skills/ctf-pwn/advanced-exploits-4.md +590 -0
- package/skills/ctf-pwn/advanced-exploits-5.md +119 -0
- package/skills/ctf-pwn/advanced-exploits.md +773 -0
- package/skills/ctf-pwn/advanced.md +326 -0
- package/skills/ctf-pwn/field-notes.md +245 -0
- package/skills/ctf-pwn/format-string.md +694 -0
- package/skills/ctf-pwn/heap-fsop.md +285 -0
- package/skills/ctf-pwn/heap-techniques-2.md +333 -0
- package/skills/ctf-pwn/heap-techniques.md +513 -0
- package/skills/ctf-pwn/kernel-bypass.md +421 -0
- package/skills/ctf-pwn/kernel-techniques.md +366 -0
- package/skills/ctf-pwn/kernel.md +636 -0
- package/skills/ctf-pwn/overflow-basics.md +611 -0
- package/skills/ctf-pwn/rop-advanced.md +725 -0
- package/skills/ctf-pwn/rop-and-shellcode.md +659 -0
- package/skills/ctf-pwn/sandbox-escape.md +313 -0
- package/skills/ctf-reverse/SKILL.md +163 -0
- package/skills/ctf-reverse/anti-analysis-ctf.md +204 -0
- package/skills/ctf-reverse/anti-analysis.md +693 -0
- package/skills/ctf-reverse/field-notes.md +376 -0
- package/skills/ctf-reverse/languages-compiled.md +666 -0
- package/skills/ctf-reverse/languages-platforms.md +592 -0
- package/skills/ctf-reverse/languages.md +553 -0
- package/skills/ctf-reverse/patterns-ctf-2.md +397 -0
- package/skills/ctf-reverse/patterns-ctf-3.md +797 -0
- package/skills/ctf-reverse/patterns-ctf.md +670 -0
- package/skills/ctf-reverse/patterns-runtime.md +274 -0
- package/skills/ctf-reverse/patterns.md +572 -0
- package/skills/ctf-reverse/platforms-hardware.md +387 -0
- package/skills/ctf-reverse/platforms.md +664 -0
- package/skills/ctf-reverse/tools-advanced-2.md +421 -0
- package/skills/ctf-reverse/tools-advanced.md +407 -0
- package/skills/ctf-reverse/tools-dynamic.md +679 -0
- package/skills/ctf-reverse/tools-emulation.md +319 -0
- package/skills/ctf-reverse/tools.md +573 -0
- package/skills/ctf-web/SKILL.md +153 -0
- package/skills/ctf-web/auth-and-access-2.md +82 -0
- package/skills/ctf-web/auth-and-access.md +783 -0
- package/skills/ctf-web/auth-infra.md +321 -0
- package/skills/ctf-web/auth-jwt.md +186 -0
- package/skills/ctf-web/client-side-advanced.md +739 -0
- package/skills/ctf-web/client-side.md +529 -0
- package/skills/ctf-web/cves.md +373 -0
- package/skills/ctf-web/field-notes.md +482 -0
- package/skills/ctf-web/node-and-prototype.md +200 -0
- package/skills/ctf-web/server-side-2.md +337 -0
- package/skills/ctf-web/server-side-advanced-2.md +559 -0
- package/skills/ctf-web/server-side-advanced-3.md +125 -0
- package/skills/ctf-web/server-side-advanced-4.md +480 -0
- package/skills/ctf-web/server-side-advanced.md +378 -0
- package/skills/ctf-web/server-side-deser.md +443 -0
- package/skills/ctf-web/server-side-exec-2.md +799 -0
- package/skills/ctf-web/server-side-exec.md +457 -0
- package/skills/ctf-web/server-side.md +629 -0
- package/skills/ctf-web/sql-injection.md +790 -0
- package/skills/ctf-web/web3.md +374 -0
- package/skills/ctf-writeup/SKILL.md +90 -0
- package/skills/solve-challenge/SKILL.md +269 -0
- package/skills.json +16 -0
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
# Vulnerability Intelligence & Exploitation Lifecycle Handbook (v2.0)
|
|
2
|
+
## Target → CVE/GHSA → Vendor Advisory → Patch → KEV/EPSS → PoC → Root Cause → Lab Reproduction → Validation → Writeup
|
|
3
|
+
|
|
4
|
+
> **Scope**: This reference handbook is strictly designed for authorized CTF competitions, educational security research, controlled lab testing, and permitted Red Team engagements.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. End-to-End Lifecycle Architecture
|
|
9
|
+
|
|
10
|
+
When researching software vulnerabilities or solving CTF/lab challenges, do not jump straight to downloading unverified scripts. Follow the standardized vulnerability research and exploitation lifecycle:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
14
|
+
│ PHASE 1: TARGET RECONNAISSANCE & FINGERPRINTING │
|
|
15
|
+
│ - Scenario A: Explicit CVE ID identified in challenge prompt/hint │
|
|
16
|
+
│ - Scenario B: Product name & exact version extracted from manifests/binaries │
|
|
17
|
+
│ - Scenario C: Raw service banners, HTTP headers, error traces, or behavior │
|
|
18
|
+
└──────────────────────────────────────────┬─────────────────────────────────────────────┘
|
|
19
|
+
│
|
|
20
|
+
▼
|
|
21
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
22
|
+
│ PHASE 2: AUTHORITATIVE VULNERABILITY & ADVISORY LOOKUP │
|
|
23
|
+
│ - Query official CVE List V5 (cveawg.mitre.org) for canonical CNA records │
|
|
24
|
+
│ - Query GitHub Advisory Database (GHSA) / OSV for package dependencies │
|
|
25
|
+
│ - Query First-Party Vendor Advisories (MSRC, Cisco, Red Hat, Oracle) for exact fixes │
|
|
26
|
+
│ - Inspect Distro Trackers (Debian, Ubuntu, Alpine) to verify backport patch status │
|
|
27
|
+
└──────────────────────────────────────────┬─────────────────────────────────────────────┘
|
|
28
|
+
│
|
|
29
|
+
▼
|
|
30
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
31
|
+
│ PHASE 3: THREAT PRIORITIZATION & EXPLOITATION CONTEXT │
|
|
32
|
+
│ - CISA KEV: Verify if the vulnerability has confirmed wild exploitation │
|
|
33
|
+
│ - FIRST EPSS: Calculate 30-day wild exploitation probability & percentile │
|
|
34
|
+
│ - Contextual Evaluation: Pair EPSS/KEV with CTF/lab context (avoid false negatives) │
|
|
35
|
+
└──────────────────────────────────────────┬─────────────────────────────────────────────┘
|
|
36
|
+
│
|
|
37
|
+
▼
|
|
38
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
39
|
+
│ PHASE 4: EXPLOIT DISCOVERY & REPOSITORY AUDIT │
|
|
40
|
+
│ - SearchSploit / Exploit-DB (`--cve`, `-s`, `-t`, `--json`, `-p`, `-m`) │
|
|
41
|
+
│ - Real-time aggregators: Sploitus, Packet Storm, AttackerKB, GitHub via `gh` │
|
|
42
|
+
│ - Classify available exploits according to Exploit Maturity Taxonomy (L0–L5) │
|
|
43
|
+
└──────────────────────────────────────────┬─────────────────────────────────────────────┘
|
|
44
|
+
│
|
|
45
|
+
▼
|
|
46
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
47
|
+
│ PHASE 5: PATCH DIFFING & ROOT CAUSE EXTRACTION │
|
|
48
|
+
│ - Git commit / PR diff inspection: Identify added bounds checks, casts, sanitizers │
|
|
49
|
+
│ - Root Cause Analysis (RCA): Identify the exact software flaw │
|
|
50
|
+
│ - Primitive Extraction: Map root cause to primitive (OOB Write, SSRF, Deserialization)│
|
|
51
|
+
│ - Impact Formulation: Derive target state modification required for RCE or leak │
|
|
52
|
+
└──────────────────────────────────────────┬─────────────────────────────────────────────┘
|
|
53
|
+
│
|
|
54
|
+
▼
|
|
55
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
56
|
+
│ PHASE 6: DEFENSIVE POC TRIAGE & SANDBOX ISOLATION │
|
|
57
|
+
│ - Malicious PoC Audit: Scan for obfuscated blobs, suspicious subprocesses, webhooks │
|
|
58
|
+
│ - Dependency & Network Verification: Confirm safe endpoints and benign payload intent │
|
|
59
|
+
│ - Sandbox Execution: Run only inside disposable Docker containers or isolated WSL │
|
|
60
|
+
└──────────────────────────────────────────┬─────────────────────────────────────────────┘
|
|
61
|
+
│
|
|
62
|
+
▼
|
|
63
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
64
|
+
│ PHASE 7: LAB REPRODUCTION, TARGET ADAPTATION & VALIDATION │
|
|
65
|
+
│ - Deploy local lab matching target version, architecture, and glibc/runtime │
|
|
66
|
+
│ - Dynamic Offset Adjustment: Replace hardcoded offsets with runtime leaked addresses │
|
|
67
|
+
│ - Mitigation Bypasses: Handle ASLR, PIE, NX, seccomp, WAF, or container constraints │
|
|
68
|
+
│ - Flag & Proof Extraction: Capture terminal output, verify regex, avoid hallucination │
|
|
69
|
+
└──────────────────────────────────────────┬─────────────────────────────────────────────┘
|
|
70
|
+
│
|
|
71
|
+
▼
|
|
72
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
73
|
+
│ PHASE 8: STANDARDIZED WRITEUP & RESEARCH DOCUMENTATION │
|
|
74
|
+
│ - Produce reproducible `solve.py` script │
|
|
75
|
+
│ - Document Root Cause, Primitive Chain, and Remediation in standardized format │
|
|
76
|
+
└────────────────────────────────────────────────────────────────────────────────────────┘
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 2. Authoritative Vulnerability Sources: Disaggregated Taxonomy
|
|
82
|
+
|
|
83
|
+
Never treat all security feeds as interchangeable. Each source serves a distinct purpose in the vulnerability intelligence ecosystem:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
87
|
+
│ VULNERABILITY INTELLIGENCE SOURCES TAXONOMY │
|
|
88
|
+
├───────────────────┬───────────────────┬───────────────────┬────────────────────────────┤
|
|
89
|
+
│ CVE Program (V5) │ NIST NVD │ Vendor Advisories │ Distro Trackers │
|
|
90
|
+
│ (Canonical Record)│ (Enrichment/CVSS) │ (Authoritative Fix│ (Package Backport Patch │
|
|
91
|
+
│ │ │ & Workaround) │ Verification) │
|
|
92
|
+
└───────────────────┴───────────────────┴───────────────────┴────────────────────────────┘
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2.1. CVE Program & CVE List V5 (The Canonical Record)
|
|
96
|
+
- **Repository:** `https://github.com/CVEProject/cvelistV5`
|
|
97
|
+
- **CVE Services API:** `https://cveawg.mitre.org/api/cve/{cve_id}`
|
|
98
|
+
- **Role:** CVE List V5 is the official, primary repository of the CVE Program. Records are created and updated directly by authorized **CVE Numbering Authorities (CNAs)**.
|
|
99
|
+
- **Key Record States:**
|
|
100
|
+
- `RESERVED`: The ID has been allocated to a CNA or researcher, but technical details are not yet public.
|
|
101
|
+
- `PUBLISHED`: The official advisory has been disclosed with title, description, affected ranges, and references.
|
|
102
|
+
- `REJECTED`: The CVE was revoked or merged into another identifier.
|
|
103
|
+
- **Why It Matters**: CVE List V5 in JSON v5 format contains the earliest authoritative details directly from the vendor or CNA before secondary enrichment occurs.
|
|
104
|
+
|
|
105
|
+
### 2.2. NIST National Vulnerability Database (NVD)
|
|
106
|
+
- **Portal:** `https://nvd.nist.gov/`
|
|
107
|
+
- **Role:** NVD is an **enrichment and analysis body** operated by the US National Institute of Standards and Technology (NIST), not the primary assignment authority.
|
|
108
|
+
- **Strengths:**
|
|
109
|
+
- Common Vulnerability Scoring System (CVSS v2, v3.1, v4.0) base metrics.
|
|
110
|
+
- Common Weakness Enumeration (CWE) classification (e.g., CWE-787: Out-of-bounds Write, CWE-94: Code Injection).
|
|
111
|
+
- Common Platform Enumeration (CPE) match criteria for structured asset correlation.
|
|
112
|
+
- **Critical Operational Caveat**: NVD frequently experiences enrichment backlogs. A newly disclosed CVE may be in `Awaiting Analysis` or `Received` state for weeks without a CVSS score. **Always consult CVE List V5 and Vendor Advisories first.**
|
|
113
|
+
|
|
114
|
+
### 2.3. First-Party Vendor Security Advisories
|
|
115
|
+
- **Examples:** Microsoft Security Response Center (MSRC), Cisco Security Advisories, Apple Security Releases, Oracle Critical Patch Updates (CPU), Red Hat Security Advisories (RHSA).
|
|
116
|
+
- **Role:** The **most authoritative technical source** regarding software architecture, exact patch release versions, affected configuration parameters, and mitigation workarounds.
|
|
117
|
+
|
|
118
|
+
### 2.4. GitHub Advisory Database (GHSA) & Open Source Vulnerabilities (OSV)
|
|
119
|
+
- **GHSA:** `https://github.com/advisories`
|
|
120
|
+
- **OSV.dev:** `https://osv.dev/`
|
|
121
|
+
- **Role:** The primary vulnerability tracking system for open-source ecosystems (npm, PyPI, Go, Maven, Cargo, Packagist, RubyGems).
|
|
122
|
+
- **Strengths:** Directly links to pull requests, issue discussions, and fixing commit hashes (`github.com/org/repo/commit/...`). Indispensable for patch diffing.
|
|
123
|
+
|
|
124
|
+
### 2.5. Distribution-Specific Security Trackers
|
|
125
|
+
- **Trackers:**
|
|
126
|
+
- Debian: `https://security-tracker.debian.org/tracker/`
|
|
127
|
+
- Ubuntu: `https://ubuntu.com/security/cve`
|
|
128
|
+
- Alpine Linux: `https://security.alpinelinux.org/`
|
|
129
|
+
- Red Hat Bugzilla: `https://access.redhat.com/security/security-updates/`
|
|
130
|
+
- **The "Backport Patch" Trap in CTF/Labs**:
|
|
131
|
+
Linux distributions regularly backport security fixes into LTS packages without changing upstream version numbers. For example, `libcurl.so.4.8.0` on Ubuntu 22.04 might show an unpatched version string, but package `curl 7.81.0-1ubuntu1.16` contains the fix. Always inspect distro changelogs:
|
|
132
|
+
```bash
|
|
133
|
+
dpkg -l | grep -E "libc6|curl|openssl"
|
|
134
|
+
apt-get changelog <package-name> | head -30
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 3. Threat Prioritization: CISA KEV & FIRST EPSS
|
|
140
|
+
|
|
141
|
+
### 3.1. CISA KEV (Known Exploited Vulnerabilities Catalog)
|
|
142
|
+
- **URL:** `https://www.cisa.gov/known-exploited-vulnerabilities-catalog`
|
|
143
|
+
- **Feed:** `https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json`
|
|
144
|
+
- **Inclusion Criteria**:
|
|
145
|
+
1. The vulnerability has an assigned CVE ID.
|
|
146
|
+
2. There is reliable, empirical evidence of active exploitation in the wild.
|
|
147
|
+
3. A clear remediation (patch or vendor guidance) exists.
|
|
148
|
+
- **CTF & Research Value**: If a CVE is in KEV, public or private weaponized exploits are guaranteed to exist. In real-world pentests, KEV vulnerabilities demand immediate prioritization.
|
|
149
|
+
|
|
150
|
+
### 3.2. FIRST EPSS (Exploit Prediction Scoring System)
|
|
151
|
+
- **Documentation & API:** `https://www.first.org/epss`
|
|
152
|
+
- **Endpoint:** `https://api.first.org/data/v1/epss?cve=CVE-YYYY-NNNN`
|
|
153
|
+
- **Mechanism**: EPSS utilizes a machine learning model analyzing dozens of data variables (disclosed PoCs, social discussions, weaponized framework commits, scanner signatures) to generate:
|
|
154
|
+
- **Probability (`epss`)**: A value between `0.00000` (0%) and `1.00000` (100%) indicating the likelihood that the CVE will be exploited in the wild in the next 30 days.
|
|
155
|
+
- **Percentile (`percentile`)**: The relative rank of this CVE compared to all other scored CVEs (e.g., `0.975` means this vulnerability has a higher exploitation probability than 97.5% of all CVEs).
|
|
156
|
+
|
|
157
|
+
### 3.3. Critical Nuances & Scoring Distinctions
|
|
158
|
+
- **EPSS is NOT a Complete Risk Score**: EPSS measures **threat probability**, not impact. A vulnerability with high EPSS might only cause a denial of service, whereas a zero-EPSS flaw might be a critical remote code execution flaw in an obscure ICS controller.
|
|
159
|
+
- **CVSS measures Severity, NOT Exploitability**: A CVSS 10.0 indicates catastrophic impact if exploited under optimal conditions; it does not indicate whether exploitation is trivial or requires complex heap feng-shui.
|
|
160
|
+
- **The CTF / Lab Context Filter**:
|
|
161
|
+
CTF challenges frequently feature bespoke software, niche libraries, or historic CVEs that have an EPSS score near `0.00010` (0.01%) and are not in CISA KEV. **Do not discard a vulnerability in a CTF just because its EPSS is low.**
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 4. Exploit Maturity Taxonomy (L0–L5 Maturity Model)
|
|
166
|
+
|
|
167
|
+
When collecting Proof-of-Concept exploits from GitHub, Exploit-DB, or research blogs, categorize their technical maturity to gauge the engineering effort needed:
|
|
168
|
+
|
|
169
|
+
| Tier | Maturity Level | Description | CTF / Lab Action Required |
|
|
170
|
+
| :---: | :--- | :--- | :--- |
|
|
171
|
+
| **L0** | **Theoretical / Advisory** | Vulnerability described textually in an advisory or whitepaper. No code provided. | Analyze patch diff or architecture to craft exploit primitive from scratch. |
|
|
172
|
+
| **L1** | **Crash / DoS PoC** | Input payload triggers a panic, null pointer dereference, or out-of-memory crash. | Investigate crash dump/registers. Determine if memory corruption can be pivoted into control flow hijack. |
|
|
173
|
+
| **L2** | **Constrained Primitive PoC** | Demonstrates partial read or write primitive under artificial conditions (e.g., ASLR/PIE disabled, fixed base). | Engineer memory leaks and stack/heap layout control to overcome mitigations. |
|
|
174
|
+
| **L3** | **Lab-Reproduced Exploit** | Reliable exploit operating in an environment identical to the author's lab (e.g., Dockerfile provided). | Port offsets, verify target glibc/kernel version, adjust network timing. |
|
|
175
|
+
| **L4** | **Reliable Exploit** | Self-contained exploit that dynamically leaks addresses, bypasses standard mitigations (Canary, ASLR, DEP), and lands a shell. | Adapt I/O wrappers (`pwntools` or `requests`) for challenge connection parameters. |
|
|
176
|
+
| **L5** | **Weaponized / Turnkey Exploit** | Modular exploit with automated target fingerprinting, multi-architecture payloads, and clean connection cleanup. | Ready for immediate verification; inspect code safety before firing. |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 5. Exploit Repositories & SearchSploit CLI Standardization
|
|
181
|
+
|
|
182
|
+
### 5.1. Official SearchSploit CLI Reference
|
|
183
|
+
SearchSploit provides offline search capabilities for the Exploit-DB archive:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Update Exploit-DB database
|
|
187
|
+
searchsploit -u
|
|
188
|
+
|
|
189
|
+
# 1. Search strictly by CVE ID (--cve)
|
|
190
|
+
searchsploit --cve 2024-45409
|
|
191
|
+
|
|
192
|
+
# 2. Strict search (-s): terms must all match
|
|
193
|
+
searchsploit -s "Apache 2.4.49"
|
|
194
|
+
|
|
195
|
+
# 3. Title-only search (-t): ignore code/comment matches to prune false positives
|
|
196
|
+
searchsploit -t "OpenSSH"
|
|
197
|
+
|
|
198
|
+
# 4. JSON output (--json) for automated script parsing
|
|
199
|
+
searchsploit --cve 2023-44487 --json
|
|
200
|
+
|
|
201
|
+
# 5. Examine exploit path and preview source directly (-p)
|
|
202
|
+
searchsploit -p 50383
|
|
203
|
+
|
|
204
|
+
# 6. Mirror/copy exploit script to current directory (-m)
|
|
205
|
+
searchsploit -m 50383
|
|
206
|
+
searchsploit -m exploits/linux/remote/50383.py
|
|
207
|
+
|
|
208
|
+
# 7. Open Exploit-DB web entry in browser (-w / --www)
|
|
209
|
+
searchsploit -w "WordPress Core 5.8"
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 5.2. Search Aggregators & Platforms
|
|
213
|
+
- **Sploitus (`https://sploitus.com/`)**: Real-time aggregator querying GitHub, Exploit-DB, and 0day.today.
|
|
214
|
+
- **Packet Storm Security (`https://packetstormsecurity.com/`)**: Continuous repository of Full Disclosure advisories, custom PoCs, and cutting-edge Metasploit modules.
|
|
215
|
+
- **AttackerKB (`https://attackerkb.com/`)**: Community-driven analysis highlighting exploit prerequisites, attacker value, and root cause analyses.
|
|
216
|
+
- **GitHub CLI (`gh`) for Real-Time PoC Sourcing**:
|
|
217
|
+
```bash
|
|
218
|
+
# Search recent repositories for CVE
|
|
219
|
+
gh search repos "CVE-2024-" --sort stars --limit 10
|
|
220
|
+
|
|
221
|
+
# Search raw Python exploit code on GitHub
|
|
222
|
+
gh search code "CVE-2024-28184" --extension py
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 6. Patch Diffing Workflow: Diff → Root Cause → Primitive → Impact
|
|
228
|
+
|
|
229
|
+
When dealing with N-day vulnerabilities where no public PoC exists (L0 maturity), the exploit is reconstructed through patch diffing:
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
233
|
+
│ STEP 1: OBTAIN COMMITS & IDENTIFY MODIFIED LINES │
|
|
234
|
+
│ - Inspect Git commit hash from GHSA, Linux CVE Tracker, or changelog │
|
|
235
|
+
│ - Locate modified files: look for bounds checks, typecasts, sanitizers│
|
|
236
|
+
└──────────────────────────────────┬─────────────────────────────────────┘
|
|
237
|
+
│
|
|
238
|
+
▼
|
|
239
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
240
|
+
│ STEP 2: DETERMINE THE ROOT CAUSE (RCA) │
|
|
241
|
+
│ - Why was the change made? (Integer overflow, missing lock, LFI sink) │
|
|
242
|
+
│ - Trace backward from modified code to reachable input entry points │
|
|
243
|
+
└──────────────────────────────────┬─────────────────────────────────────┘
|
|
244
|
+
│
|
|
245
|
+
▼
|
|
246
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
247
|
+
│ STEP 3: EXTRACT THE EXPLOITATION PRIMITIVE │
|
|
248
|
+
│ - Out-of-bounds Read -> Information leak (bypass KASLR / Canary) │
|
|
249
|
+
│ - Out-of-bounds Write -> Overwrite function pointer / return address │
|
|
250
|
+
│ - Unchecked Deserialization -> Gadget chain instantiation │
|
|
251
|
+
└──────────────────────────────────┬─────────────────────────────────────┘
|
|
252
|
+
│
|
|
253
|
+
▼
|
|
254
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
255
|
+
│ STEP 4: IMPACT & WEAPONIZATION PATH │
|
|
256
|
+
│ - Construct minimal trigger input │
|
|
257
|
+
│ - Bridge primitive to final objective (RCE, Auth Bypass, Flag Leak) │
|
|
258
|
+
└────────────────────────────────────────────────────────────────────────┘
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Common Diff Signatures and Associated Primitives:
|
|
262
|
+
1. **Added Bounds Checks (`if (len > MAX) return -1;`)**:
|
|
263
|
+
- Indicates: Buffer overflow or out-of-bounds array indexing.
|
|
264
|
+
- Primitive: Heap/stack buffer corruption or arbitrary read/write.
|
|
265
|
+
2. **Added Type Validation (`if (!is_array($data))`)**:
|
|
266
|
+
- Indicates: PHP loose type juggling or prototype pollution.
|
|
267
|
+
- Primitive: Authentication bypass or arbitrary property injection.
|
|
268
|
+
3. **Prepared Statements / Parameter Binding (`stmt.prepare(...)`)**:
|
|
269
|
+
- Indicates: SQL injection.
|
|
270
|
+
- Primitive: Second-order SQLi or out-of-band data exfiltration.
|
|
271
|
+
4. **URL / Path Normalization (`os.path.realpath`, `filepath.Clean`)**:
|
|
272
|
+
- Indicates: Path traversal or SSRF via URL parser discrepancy.
|
|
273
|
+
- Primitive: Arbitrary file read / cloud metadata extraction.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 7. Malicious PoC Defense & Defensive Audit Checklist
|
|
278
|
+
|
|
279
|
+
In recent years, fake PoCs distributed via GitHub and underground forums have frequently concealed infostealers, Discord token grabbers, fake reverse shells, or backdoor execution.
|
|
280
|
+
|
|
281
|
+
### Defensive PoC Triage Checklist:
|
|
282
|
+
Before running any third-party script from an untrusted source, execute this audit:
|
|
283
|
+
|
|
284
|
+
- [ ] **1. Obfuscation & Dynamic Evaluation**:
|
|
285
|
+
- Scan for base64 strings, hex-encoded blobs, or compressed streams.
|
|
286
|
+
- Search for execution sinks: `eval()`, `exec()`, `compile()`, `Function()`, `subprocess.Popen(..., shell=True)`.
|
|
287
|
+
- In PowerShell/Batch scripts, search for `IEX`, `Invoke-Expression`, `powershell -enc`, or `certutil -decode`.
|
|
288
|
+
- [ ] **2. Network Destination Verification**:
|
|
289
|
+
- Verify all hardcoded IP addresses, domains, and webhooks.
|
|
290
|
+
- Does the script attempt to send out-of-band HTTP requests or DNS queries to an unknown command-and-control server?
|
|
291
|
+
- [ ] **3. Dependency & Import Audit**:
|
|
292
|
+
- Check `requirements.txt` or `package.json` for typosquatted or obscure packages.
|
|
293
|
+
- Inspect imports: avoid unexpected libraries (e.g., `browser_cookie3`, `pynput`, `discord_webhook`).
|
|
294
|
+
- [ ] **4. Payload Intent**:
|
|
295
|
+
- Confirm the default payload performs a harmless action (`id`, `whoami`, `cat /etc/passwd`, `echo pwned`) rather than destructive system commands (`rm -rf`, disk encryption, or dropping unauthorized SSH keys).
|
|
296
|
+
- [ ] **5. Environment & Sandbox Isolation**:
|
|
297
|
+
- **Never execute third-party PoCs directly on your host OS.**
|
|
298
|
+
- Always run inside a disposable Docker container or isolated WSL Kali instance with restricted network egress:
|
|
299
|
+
```bash
|
|
300
|
+
docker run --rm -it --network none -v $(pwd):/work ctf-sandbox:latest bash
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## 8. Scenario-Based Triaging Workflows
|
|
306
|
+
|
|
307
|
+
### Scenario A: Known CVE ID (e.g., Challenge specifies `CVE-2024-XXXX`)
|
|
308
|
+
1. Run `python scripts/cve_lookup.py <CVE-ID>` to pull CVE List V5 record, EPSS score, and CISA KEV status.
|
|
309
|
+
2. Query SearchSploit (`searchsploit --cve <ID>`) and GitHub (`gh search repos "<ID>"`).
|
|
310
|
+
3. Classify retrieved PoCs (L1–L5). Audit for safety before execution.
|
|
311
|
+
4. Verify target environment compatibility (glibc, architecture, compiler).
|
|
312
|
+
|
|
313
|
+
### Scenario B: Product & Exact Version Known (e.g., `Werkzeug 2.2.2` or `OpenSSH 8.9p1`)
|
|
314
|
+
1. Query SearchSploit strictly: `searchsploit -s "Werkzeug 2.2.2"`.
|
|
315
|
+
2. Check GitHub Advisory Database: `https://github.com/advisories?query=Werkzeug`.
|
|
316
|
+
3. Check Linux Distro Tracker for backported patches on target operating system release.
|
|
317
|
+
4. If multiple CVEs match, sort by Exploit Maturity (prefer L4/L5 public PoCs over L0 advisories).
|
|
318
|
+
|
|
319
|
+
### Scenario C: Raw Banner / Fingerprint Only
|
|
320
|
+
1. Probe server response headers (`Server:`, `X-Powered-By:`, cookies, error stack traces).
|
|
321
|
+
2. Use fingerprinting tools: `whatweb`, `curl -I`, `nmap -sV`.
|
|
322
|
+
3. Compare subtle behavior (HTTP status codes on invalid paths, response headers) against public changelogs to narrow version bounds.
|
|
323
|
+
4. Once an initial candidate software is identified, pivot to Scenario B.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## 9. Debunking Fallacies & Security Absolutes
|
|
328
|
+
|
|
329
|
+
In technical vulnerability assessment, avoid absolute heuristics that cause tunnel vision:
|
|
330
|
+
|
|
331
|
+
| Myth / Absolute Heuristic | Reality & Technical Nuance |
|
|
332
|
+
| :--- | :--- |
|
|
333
|
+
| **"High CVSS (9.8–10.0) = Easy to Exploit"** | **False.** CVSS base scores evaluate maximum theoretical impact in default configurations. Exploiting a CVSS 9.8 remote memory corruption flaw may require an intricate multi-stage heap feng-shui layout, whereas an unauthenticated CVSS 6.5 SSRF may yield a cloud metadata token in a single `curl` command. |
|
|
334
|
+
| **"No Public PoC = Impossible to Exploit"** | **False.** Many premier CTF challenges and high-profile zero-days are 1-days with released patches but no public exploit code. Reverse engineering the patch diff reveals the root cause and allows weaponization from scratch. |
|
|
335
|
+
| **"Low EPSS Score = Safe / Non-exploitable"** | **False.** EPSS estimates wild exploitation probability based on internet-scale honeypot and scanner telemetry. Custom CTF targets, enterprise software behind firewalls, or newly dropped challenges routinely hold an EPSS score of 0.01% despite being fully exploitable. |
|
|
336
|
+
| **"Vulnerability Exists in Code = Target is Exploitable"** | **False.** Modern compiler flags (FORTIFY_SOURCE, Stack Canaries, PIE), kernel protections (seccomp, namespaces), and reverse proxies (WAFs, HTTP normalizers) frequently neutralize the trigger path without fixing the underlying bug. |
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## 10. Dynamic Research Tracking (Continuous Monitoring)
|
|
341
|
+
|
|
342
|
+
Vulnerability research is a dynamic, continuously evolving discipline. Elite security research teams release innovative primitives that define modern CTF metas:
|
|
343
|
+
|
|
344
|
+
- **PortSwigger Research (`portswigger.net/research`)**:
|
|
345
|
+
- Pioneers in modern web desynchronization attacks (HTTP Request Smuggling, HTTP/2 Rapid Reset, Web Cache Deception, Host Header Injection, Browser DOM Clobbering). *Actively tracks 2024–2026+ web attack primitives.*
|
|
346
|
+
- **Google Project Zero (`googleprojectzero.blogspot.com`)**:
|
|
347
|
+
- Definitive deep-dives on browser engines (V8 JIT compilation, WebKit), hypervisors, and kernel memory corruption primitives.
|
|
348
|
+
- **Trail of Bits (`blog.trailofbits.com`) & Zellic (`zellic.io/blog`)**:
|
|
349
|
+
- Industry leaders in Zero-Knowledge Proof (ZKP) circuit attacks, smart contracts, compiler exploitation, and symbolic execution.
|
|
350
|
+
- **Qualys Security Research (`qualys.com/research/security-advisories`)**:
|
|
351
|
+
- Masters of Linux Local Privilege Escalation (glibc ld.so, Sudo, Polkit, systemd).
|
|
352
|
+
- **Zero Day Initiative (ZDI) (`zerodayinitiative.com/blog`)**:
|
|
353
|
+
- Detailed root-cause analyses from Pwn2Own competitions (virtualization escapes, enterprise servers, client-side applications).
|
|
354
|
+
- **Phrack Magazine (`phrack.org`)**:
|
|
355
|
+
- The canonical underground journal for low-level exploitation techniques, heap layout manipulation, and kernel internals.
|
|
356
|
+
- **Assetnote Research (`assetnote.io/resources/research`)**:
|
|
357
|
+
- Enterprise web exploitation, parser differentials, and deserialization gadget discoveries.
|
|
358
|
+
|
|
359
|
+
> [!NOTE]
|
|
360
|
+
> Treat the list above as an ongoing intelligence stream to monitor regularly, rather than an immutable directory.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## 11. Production-Ready Python CLI Automation (`scripts/cve_lookup.py`)
|
|
365
|
+
|
|
366
|
+
The automated vulnerability intelligence script is maintained at `scripts/cve_lookup.py`. It integrates the official CVE List V5 API, FIRST EPSS API, and CISA KEV catalog in a single automated command:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
python scripts/cve_lookup.py <CVE-YYYY-NNNN>
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### Complete Implementation Source Code:
|
|
373
|
+
```python
|
|
374
|
+
#!/usr/bin/env python3
|
|
375
|
+
"""
|
|
376
|
+
CVE & Threat Intelligence Lookup Utility (v2.0)
|
|
377
|
+
Authoritative vulnerability intelligence pipeline for CTF Agents & Security Researchers:
|
|
378
|
+
- CVE List V5 / CVE Services API (cveawg.mitre.org)
|
|
379
|
+
- FIRST EPSS API (api.first.org)
|
|
380
|
+
- CISA KEV (Known Exploited Vulnerabilities) catalog check
|
|
381
|
+
"""
|
|
382
|
+
|
|
383
|
+
import sys
|
|
384
|
+
import json
|
|
385
|
+
import urllib.request
|
|
386
|
+
import urllib.error
|
|
387
|
+
from typing import Optional, Dict, Any
|
|
388
|
+
|
|
389
|
+
USER_AGENT = "CTF-Agent-ThreatIntel/2.0"
|
|
390
|
+
TIMEOUT = 10
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def fetch_json(url: str) -> Optional[Dict[str, Any]]:
|
|
394
|
+
req = urllib.request.Request(url, headers={"User-Agent": USER_AGENT})
|
|
395
|
+
try:
|
|
396
|
+
with urllib.request.urlopen(req, timeout=TIMEOUT) as resp:
|
|
397
|
+
return json.loads(resp.read().decode("utf-8"))
|
|
398
|
+
except Exception:
|
|
399
|
+
return None
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def get_cve_details(cve_id: str) -> Optional[Dict[str, Any]]:
|
|
403
|
+
url = f"https://cveawg.mitre.org/api/cve/{cve_id}"
|
|
404
|
+
return fetch_json(url)
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
def get_epss_score(cve_id: str) -> Optional[Dict[str, Any]]:
|
|
408
|
+
url = f"https://api.first.org/data/v1/epss?cve={cve_id}"
|
|
409
|
+
data = fetch_json(url)
|
|
410
|
+
if data and "data" in data and len(data["data"]) > 0:
|
|
411
|
+
return data["data"][0]
|
|
412
|
+
return None
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
def check_cisa_kev(cve_id: str) -> Dict[str, Any]:
|
|
416
|
+
url = "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"
|
|
417
|
+
data = fetch_json(url)
|
|
418
|
+
if not data:
|
|
419
|
+
return {"listed": False, "error": "Unable to reach CISA KEV feed"}
|
|
420
|
+
|
|
421
|
+
vulns = data.get("vulnerabilities", [])
|
|
422
|
+
for v in vulns:
|
|
423
|
+
if v.get("cveID", "").upper() == cve_id:
|
|
424
|
+
return {
|
|
425
|
+
"listed": True,
|
|
426
|
+
"vulnerabilityName": v.get("vulnerabilityName", "N/A"),
|
|
427
|
+
"dateAdded": v.get("dateAdded", "N/A"),
|
|
428
|
+
"knownRansomwareCampaignUse": v.get("knownRansomwareCampaignUse", "Unknown"),
|
|
429
|
+
}
|
|
430
|
+
return {"listed": False}
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
def parse_and_display(cve_id: str) -> None:
|
|
434
|
+
cve_id = cve_id.strip().upper()
|
|
435
|
+
if not cve_id.startswith("CVE-"):
|
|
436
|
+
cve_id = "CVE-" + cve_id
|
|
437
|
+
|
|
438
|
+
print("\n" + "=" * 70)
|
|
439
|
+
print(f"[*] VULNERABILITY THREAT INTELLIGENCE: {cve_id}")
|
|
440
|
+
print("=" * 70)
|
|
441
|
+
|
|
442
|
+
cve_data = get_cve_details(cve_id)
|
|
443
|
+
if not cve_data:
|
|
444
|
+
print(f"[-] Error: Record for {cve_id} not found in CVE List V5 repository.")
|
|
445
|
+
return
|
|
446
|
+
|
|
447
|
+
cve_metadata = cve_data.get("cveMetadata", {})
|
|
448
|
+
state = cve_metadata.get("state", "UNKNOWN")
|
|
449
|
+
cna_container = cve_data.get("containers", {}).get("cna", {})
|
|
450
|
+
|
|
451
|
+
title = cna_container.get("title", "No title provided by CNA")
|
|
452
|
+
descriptions = cna_container.get("descriptions", [])
|
|
453
|
+
desc_text = descriptions[0].get("value", "No description") if descriptions else "No description"
|
|
454
|
+
|
|
455
|
+
print(f"\n[+] STATUS: {state} | CNA: {cve_metadata.get('assignerShortName', 'Unknown')}")
|
|
456
|
+
print(f"[+] TITLE : {title}\n")
|
|
457
|
+
print(f"[+] DESCRIPTION:\n {desc_text.strip()}\n")
|
|
458
|
+
|
|
459
|
+
affected = cna_container.get("affected", [])
|
|
460
|
+
if affected:
|
|
461
|
+
print("[+] AFFECTED PRODUCTS & VERSIONS:")
|
|
462
|
+
for aff in affected[:5]:
|
|
463
|
+
vendor = aff.get("vendor", "Unknown")
|
|
464
|
+
product = aff.get("product", "Unknown")
|
|
465
|
+
versions = [f"{v.get('version', '')} ({v.get('status', '')})" for v in aff.get("versions", [])[:3]]
|
|
466
|
+
print(f" - {vendor} / {product} -> {', '.join(versions)}")
|
|
467
|
+
print()
|
|
468
|
+
|
|
469
|
+
epss_info = get_epss_score(cve_id)
|
|
470
|
+
print("[+] EPSS PROBABILITY (FIRST.org):")
|
|
471
|
+
if epss_info:
|
|
472
|
+
epss_prob = float(epss_info.get("epss", 0.0))
|
|
473
|
+
epss_pct = float(epss_info.get("percentile", 0.0)) * 100.0
|
|
474
|
+
print(f" - Exploitation Probability (30-day): {epss_prob:.4f} ({epss_prob * 100:.2f}%)")
|
|
475
|
+
print(f" - EPSS Percentile: {epss_pct:.2f}% (Higher than {epss_pct:.2f}% of all CVEs)")
|
|
476
|
+
print()
|
|
477
|
+
|
|
478
|
+
kev_info = check_cisa_kev(cve_id)
|
|
479
|
+
print("[+] CISA KEV (KNOWN EXPLOITED VULNERABILITIES):")
|
|
480
|
+
if kev_info.get("listed"):
|
|
481
|
+
print(f" - [CRITICAL] In CISA KEV: YES | Added: {kev_info.get('dateAdded')}")
|
|
482
|
+
print(f" - Vulnerability: {kev_info.get('vulnerabilityName')}")
|
|
483
|
+
else:
|
|
484
|
+
print(" - Listed in CISA KEV: NO")
|
|
485
|
+
print()
|
|
486
|
+
|
|
487
|
+
refs = [r.get("url") for r in cna_container.get("references", []) if r.get("url")]
|
|
488
|
+
if refs:
|
|
489
|
+
print(f"[+] AUTHORITATIVE REFERENCES ({len(refs)} total):")
|
|
490
|
+
for r in refs[:8]:
|
|
491
|
+
print(f" - {r}")
|
|
492
|
+
print()
|
|
493
|
+
print("=" * 70 + "\n")
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
if __name__ == "__main__":
|
|
497
|
+
if len(sys.argv) > 1:
|
|
498
|
+
parse_and_display(sys.argv[1])
|
|
499
|
+
else:
|
|
500
|
+
print("Usage: python3 scripts/cve_lookup.py <CVE-YYYY-NNNN>")
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## 12. Standardized Reporting & Writeup Templates
|
|
506
|
+
|
|
507
|
+
### 12.1. Template: CTF Challenge Writeup Standard
|
|
508
|
+
Follow the repository writeup standard defined in `skills/ctf-writeup/SKILL.md`:
|
|
509
|
+
|
|
510
|
+
```markdown
|
|
511
|
+
---
|
|
512
|
+
title: "<Challenge Name>"
|
|
513
|
+
ctf: "<Event Name>"
|
|
514
|
+
category: <web|pwn|crypto|reverse|forensics|misc>
|
|
515
|
+
diff: <easy|medium|hard|insane>
|
|
516
|
+
flag: "<flag_value>"
|
|
517
|
+
hint: "<official_hint_or_prompt>"
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
# <Challenge Name>
|
|
521
|
+
|
|
522
|
+
## 1. Challenge & Hint Analysis (Hint-First Methodology)
|
|
523
|
+
- **Prompt & Hints**: Quote official text.
|
|
524
|
+
- **Semantic Interpretation**: Targeted primitives, author intent, pruned rabbit holes.
|
|
525
|
+
|
|
526
|
+
## 2. Target Architecture & Vulnerability Analysis
|
|
527
|
+
- **Architecture**: Stack, service framework, or binary mitigations (`checksec`).
|
|
528
|
+
- **Root Cause Analysis (RCA)**: Underlying security flaw.
|
|
529
|
+
|
|
530
|
+
## 3. Exploitation Walkthrough
|
|
531
|
+
- **Step 1**: Reconnaissance and vulnerability trigger.
|
|
532
|
+
- **Step 2**: Mitigation bypass or exploit chain construction.
|
|
533
|
+
- **Step 3**: Payload execution and flag exfiltration.
|
|
534
|
+
|
|
535
|
+
## 4. Standalone Exploit Script (solve.py)
|
|
536
|
+
```python
|
|
537
|
+
# Self-contained, runnable exploit script
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
## 5. Verification & Flag
|
|
541
|
+
```text
|
|
542
|
+
flag{...}
|
|
543
|
+
```
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### 12.2. Template: 1-Day Vulnerability Research Advisory
|
|
547
|
+
When documenting research on a disclosed N-day or CVE:
|
|
548
|
+
|
|
549
|
+
```markdown
|
|
550
|
+
# Vulnerability Research Advisory: [CVE-YYYY-NNNN] - [Title]
|
|
551
|
+
|
|
552
|
+
## 1. Executive Summary
|
|
553
|
+
- **Identifier**: CVE-YYYY-NNNN / GHSA-xxxx-xxxx-xxxx
|
|
554
|
+
- **Affected Software**: [Vendor] [Product] [Versions]
|
|
555
|
+
- **Fixed Version**: [Version]
|
|
556
|
+
- **Threat Metrics**: CVSS Base Score | EPSS Probability | CISA KEV Status
|
|
557
|
+
- **Exploit Maturity**: L0 to L5
|
|
558
|
+
|
|
559
|
+
## 2. Root Cause Analysis (RCA)
|
|
560
|
+
- **Vulnerable Component**: File path and function name.
|
|
561
|
+
- **Patch Diff Breakdown**: Compare vulnerable commit vs. fixing commit.
|
|
562
|
+
- **Underlying Flaw**: Memory safety violation, logic flaw, or injection.
|
|
563
|
+
|
|
564
|
+
## 3. Exploit Primitive & Constraints
|
|
565
|
+
- **Primitive**: Read/Write/Execute capability.
|
|
566
|
+
- **Environmental Constraints**: Required flags, memory layout, runtime protections.
|
|
567
|
+
|
|
568
|
+
## 4. Proof-of-Concept & Reproduction
|
|
569
|
+
- **Reproduction Environment**: Dockerfile or setup commands.
|
|
570
|
+
- **Trigger Payload**: Safe demonstration payload.
|
|
571
|
+
|
|
572
|
+
## 5. Defensive Guidance & Remediation
|
|
573
|
+
- **Official Patch**: Commit link or package upgrade instructions.
|
|
574
|
+
- **Workarounds**: Network ACLs, disabled features, or configuration hardening.
|
|
575
|
+
```
|