PISA Pakistan — Community CERT

← 🚩 CTF: Getting Started

32. Threat Modeling & Attack Tree Design for CTF Challenge Authors

⏱ 8 min

Threat Modeling & Attack Tree Design for CTF Challenge Authors

Why Threat Modeling Matters

Before writing a CTF challenge, authors must decide what attack paths to allow, how difficult each step should be, and which defensive techniques participants should practice. A structured threat model prevents over‑powered flags and ensures balanced difficulty.

Methodologies: STRIDE & DFD

  • STRIDE – Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege.
  • Data Flow Diagrams (DFD) – visualize components (client, API, database) and identify trust boundaries.

Building Attack Trees

Attack trees map goals (e.g., “Obtain the flag”) to concrete sub‑goals and attack steps. Tools:

  • OWASP Threat Dragon (free, web‑based)
  • Microsoft Threat Modeling Tool (TMT)

Steps to create an attack tree:

  1. Define the root goal (e.g., “Read /etc/shadow”).
  2. Add leaf nodes representing atomic actions (e.g., “Exploit SQLi”, “Brute‑force password”).
  3. Assign AND/OR relationships to reflect dependencies.
  4. Label each node with a difficulty rating (Easy, Medium, Hard) matching the intended score.

Mapping to MITRE ATT&CK

Link leaf nodes to ATT&CK technique IDs so participants can correlate CTF flags with real‑world tactics. Example: “SQL Injection” → T1190, “Credential Dumping” → T1003.

Integrating Pakistani Regulatory Context

Consider NADRA data sensitivity: any challenge that mimics identity verification must avoid storing real CNICs. Align with SBP consumer protection guidelines by not requiring participants to reveal financial credentials.

Do / Don't

  • Do use Threat Dragon to draw a tree before writing a single line of code for the challenge.
  • Don’t make the attack path so obscure that even advanced players need weeks to find it.
  • Do test the challenge from a participant’s perspective, ensuring all required steps are discoverable.

Takeaway

Open Threat Dragon today, create an attack tree for a simple web‑shell challenge, and annotate each node with an ATT&CK ID. This visual map will guide your implementation and scoring.

← PrevNext →