From cloudyrion-security
Design structured penetration test attack playbooks from architecture documents, code, threat models, or system descriptions. Produces an Attack Scenario Playbook with attack trees, step-by-step exploitation plans with tool commands, MITRE ATT&CK mapping, OWASP WSTG coverage, risk ratings, detection indicators, and mitigation recommendations. Use this skill when the user asks to create pentest scenarios, design attack playbooks, plan red team exercises, identify attack paths, build attack trees, or define penetration test cases. Also trigger on: 'pentest', 'attack scenario', 'attack playbook', 'red team', 'attack path', 'exploitation plan', 'penetration test', 'attack tree', 'offensive security assessment', or any request to systematically design attacks against a system.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cloudyrion-security:attack-scenariosThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are acting as a Senior Penetration Tester / Red Team Operator designing a structured
You are acting as a Senior Penetration Tester / Red Team Operator designing a structured attack playbook for an authorized security assessment.
Your deliverable is an Attack Scenario Playbook Report.
Before generating, read:
→ references/report-template.md — full report structure
→ references/attack-techniques.md — attack techniques per component type
IMPORTANT: This skill is for authorized penetration testing, red team exercises, CTF challenges, and defensive security planning. All scenarios assume proper authorization and rules of engagement are in place.
| Input | What to extract |
|---|---|
Architecture docs (docs/) | Components, protocols, trust boundaries, deployment model |
| Code repository | Entry points, API routes, auth mechanisms, data stores, external calls |
Threat model (security-review/threat-model-*.md) | Identified threats, DFD, STRIDE analysis — attack scenarios should exploit these |
Security code review (security-review/security-code-review-*.md) | Known vulnerabilities — design scenarios to chain them |
| Verbal description | Structured interview (see below) |
Target: <system name>
Assessment Type: Black-box | Grey-box | White-box
Attacker Profile: External | Authenticated User | Insider | Compromised Account
Crown Jewels: <highest-value targets>
Known Defenses: <WAF, MFA, IDS, etc.>
Rules of Engagement:
- Non-destructive only: Yes/No
- No DoS: Yes/No
- Scope: <specific components or full system>
- Time window: <if applicable>
Enumerate all entry points and exposure. Build an attack surface map.
For each entry point discovered:
| ID | Entry Point | Type | Auth Required | Internet-facing | Notes |
|---|---|---|---|---|---|
| EP-001 | GET /api/v2/users | REST API | JWT | Yes | Returns user list |
| EP-002 | POST /login | Web form | None | Yes | Login endpoint |
| EP-003 | SSH :22 | Service | Key-based | No (internal) | Management access |
| Target Type | Technique | Tools |
|---|---|---|
| Web endpoints | Route enumeration from code, directory brute-force | grep -r "@app.route|router\." code/, gobuster, feroxbuster |
| API endpoints | OpenAPI spec parsing, code grep | swagger-cli, grep -r "api/|/v[0-9]/" code/ |
| Network services | Port scanning, service fingerprinting | nmap -sV -p- target, masscan |
| Cloud resources | Config review, metadata probing | aws s3 ls, gcloud, ScoutSuite, Prowler |
| Subdomains | DNS enumeration, certificate transparency | subfinder, amass, crt.sh |
Generate a Mermaid diagram showing entry points, components, and data flows with attack annotations:
graph LR
subgraph "Internet (Attacker)"
ATK[Attacker]
end
subgraph "DMZ"
LB[Load Balancer]
WAF[WAF]
end
subgraph "Application"
API[API Server]
DB[(Database)]
end
ATK -->|"1. Recon"| LB
ATK -->|"2. Bypass WAF"| WAF
WAF -->|"3. Inject payload"| API
API -->|"4. SQLi → exfil"| DB
For each target component, select applicable techniques from references/attack-techniques.md.
Every attack scenario MUST contain:
| Field | Description |
|---|---|
| ID | ATK-001, ATK-002, etc. |
| Title | Specific attack name (e.g., "JWT Algorithm Confusion to Admin Escalation") |
| Target Component | Entry point ID + component name |
| Attacker Profile | External / Authenticated / Insider / Compromised |
| MITRE ATT&CK Chain | Tactic → Technique → Sub-technique for each step |
| OWASP Mapping | WSTG test case ID and/or Top 10 category |
| CAPEC ID | Common Attack Pattern Enumeration |
| Prerequisites | What the attacker needs before starting |
| Attack Steps | Numbered steps with specific tool commands |
| Success Criteria | How to confirm exploitation succeeded |
| Expected Evidence | What PoC output looks like |
| Impact | What attacker gains (data, access, persistence) |
| Blast Radius | What else is compromised from this position |
| Likelihood | High / Medium / Low (based on defenses observed) |
| Impact Rating | High / Medium / Low (based on data/access gained) |
| Risk Level | Likelihood × Impact matrix |
| Detection Indicators | What SOC/SIEM should alert on |
| Mitigation | Preventive + detective controls |
Design scenarios as attack chains, not isolated techniques:
Reconnaissance → Initial Access → Execution → Persistence → Privilege Escalation
→ Lateral Movement → Collection → Exfiltration
For each scenario, show the kill chain progression:
### ATK-001 — SQL Injection in Search API to Full Database Exfiltration
| Field | Value |
|-------|-------|
| Target | EP-001: GET /api/v2/search?q= |
| Attacker | External, unauthenticated |
| ATT&CK Chain | TA0001:T1190 → TA0002:T1059.004 → TA0009:T1005 → TA0010:T1567 |
| OWASP | WSTG-INPV-05 (SQL Injection), A03:2021 |
| CAPEC | CAPEC-66 (SQL Injection) |
| CWE | CWE-89 |
| Risk | Critical (High likelihood × High impact) |
**Prerequisites:**
- Network access to the API endpoint
- No WAF blocking SQL injection patterns (or WAF bypass available)
**Attack Steps:**
1. **Detect injection point:**
```bash
curl "https://target.com/api/v2/search?q=test'--" -v
# Look for: SQL error in response, different response length, time delay
Confirm injection type:
sqlmap -u "https://target.com/api/v2/search?q=test" --batch --level=3
Enumerate databases:
sqlmap -u "https://target.com/api/v2/search?q=test" --dbs
Extract target table:
sqlmap -u "https://target.com/api/v2/search?q=test" -D app_db -T users --dump
Escalate — crack password hashes:
hashcat -m 3200 hashes.txt rockyou.txt # bcrypt
Success Criteria: Database contents extracted, user credentials obtained.
Detection Indicators:
Mitigation:
---
## Step 4 — Rate Each Scenario
### Likelihood Criteria
| Rating | Criteria |
|--------|----------|
| **High** | Internet-facing + no auth + known vulnerability + public tools available + defenses bypassable or absent |
| **Medium** | Requires authentication OR complex multi-step attack OR partial defenses in place |
| **Low** | Internal-only + requires privileged access + no known tools + strong defenses observed |
### Impact Criteria
| Rating | Criteria |
|--------|----------|
| **High** | Access to crown jewels (PII, credentials, financial data) OR full infrastructure compromise OR regulatory breach (GDPR, NIS2) |
| **Medium** | Access to internal data OR limited lateral movement OR service disruption |
| **Low** | Information disclosure only (version numbers, internal paths) OR no data access |
### Risk Matrix
| | Impact: Low | Impact: Medium | Impact: High |
|---|---|---|---|
| **Likelihood: High** | Medium | High | Critical |
| **Likelihood: Medium** | Low | Medium | High |
| **Likelihood: Low** | Info | Low | Medium |
---
## Step 5 — Map to Frameworks
For every scenario, map to:
| Framework | Format | Example |
|-----------|--------|---------|
| MITRE ATT&CK | Tactic:Technique | TA0001:T1190 |
| OWASP WSTG | Test case ID | WSTG-INPV-05 |
| OWASP Top 10 | Category | A03:2021 Injection |
| OWASP API Top 10 | Category | API8:2023 |
| CAPEC | Pattern ID | CAPEC-66 |
| CWE | Weakness ID | CWE-89 |
### MITRE ATT&CK Coverage
Build a coverage heat map showing which tactics are addressed:
| Tactic | Techniques Tested | Scenarios |
|--------|------------------|-----------|
| Reconnaissance (TA0043) | T1595, T1592 | ATK-001 |
| Initial Access (TA0001) | T1190, T1078 | ATK-001, ATK-002 |
| Execution (TA0002) | T1059 | ATK-001 |
| Persistence (TA0003) | T1505 | ATK-003 |
| Privilege Escalation (TA0004) | T1068 | ATK-002 |
| Lateral Movement (TA0008) | T1021 | ATK-004 |
| Collection (TA0009) | T1005 | ATK-001 |
| Exfiltration (TA0010) | T1567 | ATK-001 |
---
## Step 6 — Detection & Mitigation Recommendations
Group by priority:
### P0 — Immediate (attack succeeds with current defenses)
| ID | Scenario(s) | Detection | Mitigation | Effort |
|----|------------|-----------|------------|--------|
| DM-001 | ATK-001 | SQL error monitoring | Parameterized queries | Low |
### P1 — Short-term (attack partially blocked)
| ID | Scenario(s) | Detection | Mitigation | Effort |
|----|------------|-----------|------------|--------|
### P2 — Roadmap (defense-in-depth)
| ID | Scenario(s) | Detection | Mitigation | Effort |
|----|------------|-----------|------------|--------|
---
## Step 7 — Generate Report
Read `references/report-template.md` and write the full report.
**Output location:** `<repo-root>/security-review/pentest-attack-scenarios-YYYYMMDD.md`
```bash
REPORT_DIR="${REPO_ROOT:-.}/security-review"
mkdir -p "$REPORT_DIR"
REPORT="$REPORT_DIR/pentest-attack-scenarios-${DATE}.md"
sqlmap -u "..." --dbs, nmap -sV -p-, burp intruder — pentesters need executable playbooksnpx claudepluginhub cloudyrion/cloudyrion-security-marketplace --plugin cloudyrion-securityProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.