Live lesson · progress saved to your account

Threat Modelling & Attack Frameworks

Find design flaws before code ships and speak the frameworks threat intel and red teams use: Shostack's four questions, DFDs, STRIDE and LINDDUN, PASTA and attack trees, ATT&CK Navigator coverage, D3FEND, the Diamond Model and the Unified Kill Chain, applied to a fintech lending app.

advanced140 minwalkthrough

Anyone can read this lesson. To submit answers and earn XP, create a free account.

TASK 01Mission briefing: 30 days to launch

UdhaarPe (fictional), Gurugram · instant personal loans · launch in 30 days "We pass the RBI digital-lending checklist, the pentest is booked for week 4, and the board wants to know: what could go wrong that nobody has thought of? Run the threat model, and map our detections to ATT&CK while you're at it. — Kabir, CTO"

A pentest in week 4 finds bugs in code that already exists. Threat modelling finds flaws in the design, when fixing them costs a whiteboard edit instead of a re-architecture. That's OWASP's A06 Insecure Design (Room 15): no amount of perfect code fixes a design that sends money to whichever account the request names.

Adam Shostack's framework boils threat modelling down to four questions:

Shostack's four questions click a question

UdhaarPe's lending app: data-flow diagram of the borrower app, API, loan service, credit bureau and payout bank.

Then loop back: every major design change is a reason to ask question 1 again.

In this room you'll answer all four for UdhaarPe: build the data-flow diagram, find threats with STRIDE and LINDDUN, prioritise with PASTA and attack trees, then switch to the defender's map of real adversaries: ATT&CK, D3FEND, the Diamond Model and the Unified Kill Chain.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

TASK 02Threat modelling at scale: DFDs and trust boundaries

The working model of a system is a data-flow diagram (DFD) with four element types plus trust boundaries:

  • External entity (rectangle): people or systems you don't control: borrowers, the credit bureau, the payout bank.
  • Process (circle): your code that transforms data: API gateway, loan service.
  • Data store (parallel lines): databases, buckets, queues, logs.
  • Data flow (arrow): data moving between elements.
  • Trust boundary (dashed line): where the level of trust changes, e.g. internet → your network, your app → a third party. Most threats live where flows cross a boundary.

Watch the lending app's DFD build itself, with STRIDE categories pinned per element type:

DFD builder: STRIDE pins itself to every element click an element
trust boundary: internet | UdhaarPethird partiesBorrowerSR
▭ external entity: S R◯ process: S T R I D E═ data store: T R I D- - data flow: T I D

Borrower · external entity

  • S Spoofing: Someone logs in as a borrower with a stolen OTP session.
  • R Repudiation: A borrower denies accepting the loan agreement.

STRIDE-per-element (from Microsoft's SDL) says which categories apply to which element: external entities face S and R; processes face all six; data stores face T, R, I, D; data flows face T, I, D.

At scale, teams don't model everything at once:

  • Model at design time and whenever a change adds a new data flow, trust boundary or sensitive data type.
  • Keep a threat library of known threats per component (e.g. "every webhook: verify signatures") so new models start 80% done.
  • Store models next to code (threat-model-as-code tools like OWASP Threat Dragon or pytm) and review them in pull requests.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

TASK 03STRIDE and LINDDUN

STRIDE finds security threats: each letter is the violation of one property. LINDDUN (from KU Leuven) does the same for privacy, which matters a lot for an app holding PAN, KYC, income and contacts under India's DPDP Act 2023.

Two lenses on the same design STRIDE · security
Spoofingprotects: AuthenticityFake payout-bank webhook
Tamperingprotects: IntegrityLoan amount edited in transit
Repudiationprotects: Non-repudiationBorrower denies e-signing
Information disclosureprotects: ConfidentialityPAN numbers in error messages
Denial of serviceprotects: AvailabilityBots exhaust bureau quota
Elevation of privilegeprotects: AuthorisationAgent approves own loans

A lending app holds PAN, Aadhaar-linked KYC, income and contacts. A design can be perfectly secure and still be a privacy failure.

Run a workshop the way it works in real teams: product, developers, ops and security around the DFD, walking element by element, asking "how could this break?" and writing every idea down before debating it. Then classify, rate and assign each threat.

Now classify the threats the UdhaarPe team raised:

Lab · STRIDE the lending app classify each threat

Borrower → API gateway

A borrower's session token is replayed from another phone to take over the account.

API gateway → loan service

The borrower edits loanAmount in the request after the offer was approved.

Loan service

A borrower claims they never accepted the loan agreement, and there is no record.

Loans DB

A Loans DB backup in a public bucket exposes PAN and Aadhaar-linked KYC data.

Loan service → credit bureau

Bots hammer the eligibility endpoint and exhaust the paid credit-bureau quota.

Admin portal

A support agent's role can call /approve and approve loans for friends.

Payout bank → loan service

An attacker sends a fake 'payout succeeded' webhook so the app marks a loan as paid.

API gateway

Error pages show SQL queries and internal hostnames.

For each threat you have four standard responses: mitigate (add a control), eliminate (remove the feature or data), transfer (insurance, contract, a provider) or accept (documented, signed off by a risk owner).

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+30 XP

TASK 04PASTA and attack trees

STRIDE is great at finding threats. It's weaker at deciding which ones the business should fix first. PASTA (Process for Attack Simulation and Threat Analysis) is a seven-stage, risk-centric method that starts from business objectives and ends with risk in business terms:

PASTA: seven stages, business first click a stage

Stage 1: Define objectives

Business goals and impact: RBI digital lending rules, fraud loss limits, launch in 30 days.

PASTA = Process for Attack Simulation and Threat Analysis. Where STRIDE asks "what can go wrong with this element?", PASTA asks "what would hurt the business most, and how would an attacker get there?"

Stage 6 often uses attack trees (popularised by Bruce Schneier in 1999): the attacker's goal is the root, ways to achieve it are children. OR nodes need any one child; AND nodes need all of them. Give each leaf a cost (or difficulty, or probability) and the tree tells you the attacker's cheapest path, which is the one they'll take.

The useful insight: hardening an expensive path does nothing while a cheap one is open. Spend your 30 days where the tree says:

Lab · Attack tree: make fraud too expensive 0/30 dev-days · cheapest attack ₹1k
GOAL (OR): get a loan disbursed into a mule account · cheapest path ₹1k

Take over a real borrower₹17k

AND: attacker needs both

  • • SIM-swap the phone for OTPs₹15k
  • • Buy their PAN + DOB from a leak₹2k

Synthetic identity₹8k

  • • Forge KYC documents₹8k

Redirect payout (IDOR)₹1k

  • • Change payout account via /payout?loan=₹1k

Insider approval₹50k

AND: attacker needs both

  • • Bribe a support agent₹50k
  • • No second approver on loans₹0k

Pick mitigations (30 dev-days before launch). Goal: the cheapest attack must cost at least ₹50k.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+30 XP

TASK 05ATT&CK in depth: Navigator and coverage

Room 08 introduced MITRE ATT&CK. Here's how defenders actually use it.

The building blocks. The Enterprise matrix has 14 tactics (the attacker's why: Reconnaissance through Impact) and hundreds of techniques and sub-techniques (the how: T1059 Command and Scripting Interpreter → T1059.001 PowerShell). Each technique page lists procedure examples, mitigations and the data sources / components that can detect it. ATT&CK also tracks groups (G-IDs) and software (S-IDs) with the techniques each has used.

Navigator is MITRE's web tool for colouring the matrix. A layer is a JSON file of scores and colours. Typical uses:

  • Layer 1: techniques used by groups that target your sector (from threat intel).
  • Layer 2: techniques your detections cover.
  • Combine them: what they do that you can't see = your gaps.
ATT&CK coverage heatmap your detections
detected partial no coverage

Initial Access

T1566Phishing
T1190Exploit Public-Facing App
T1078Valid Accounts

Execution

T1059.001PowerShell
T1204.002Malicious File
T1053Scheduled Task/Job

Persistence

T1136.002Domain Account
T1543.003Windows Service
T1098Account Manipulation

Credential Access

T1110.003Password Spraying
T1621MFA Request Generation
T1003.001LSASS Memory

Defense Evasion

T1070.001Clear Windows Event Logs
T1562.001Disable or Modify Tools
T1027Obfuscated Files

Lateral Movement

T1021.001Remote Desktop Protocol
T1021.002SMB/Admin Shares
T1550.002Pass the Hash

Exfiltration

T1567.002Exfil to Cloud Storage
T1048Exfil Over Alt Protocol
T1041Exfil Over C2 Channel

Impact

T1486Data Encrypted for Impact
T1657Financial Theft
T1490Inhibit System Recovery

Coverage fills in from your Sigma rules, EDR and SIEM content. Green looks great until you ask: green against whom?

Coverage is only honest if you separate "we collect the data" from "a rule fires". Score the layer for the group most likely to target UdhaarPe:

Lab · Build a Navigator layer for LEDGER LYNX score each technique

Covered = data collected and a detection fires. Partial = data exists but detection is missing or limited. Gap = no data at all.

T1566.001 Spearphishing Attachment

Email gateway sandbox logs in SIEM + phishing playbook alert

T1059.001 PowerShell

4688 with command lines collected + rule for encoded PowerShell

T1110.003 Password Spraying

Sigma correlation on 4625 grouped by IpAddress

T1621 MFA Request Generation

MFA push logs collected; no rule written yet

T1078 Valid Accounts

Impossible-travel rule exists for VPN only, not for the lending app

T1190 Exploit Public-Facing Application

No WAF or application logs reach the SIEM

T1003.001 LSASS Memory

EDR credential-dumping alerts forwarded to SIEM

T1070.001 Clear Windows Event Logs

Alert on Event 1102

T1567.002 Exfiltration to Cloud Storage

Proxy logs collected; no alert on large uploads

T1486 Data Encrypted for Impact

Nothing collected from file servers or cloud storage

layer score: 0 / 1000

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+30 XP

TASK 06D3FEND and the Diamond Model

MITRE D3FEND is ATT&CK's defensive counterpart: a knowledge graph of countermeasures, organised into tactics Model, Harden, Detect, Isolate, Deceive, Evict and Restore. Each countermeasure is linked to the ATT&CK techniques it addresses, so a coverage gap turns directly into a shopping list of controls.

Offence meets defence: ATT&CK → D3FEND pick a technique
HardenStrong Password Policy
HardenMulti-factor Authentication
DetectAuthentication Event Thresholding
EvictAccount Locking

D3FEND tactics: Model, Harden, Detect, Isolate, Deceive, Evict, Restore. Each countermeasure is linked to the ATT&CK techniques it addresses through the digital artefacts both touch.

The Diamond Model of Intrusion Analysis (Caltagirone, Pendergast and Betz, 2013) describes every intrusion event with four connected features: adversary, capability, infrastructure and victim. Its power is pivoting: knowing one vertex helps you discover the others.

The Diamond Model: pivoting across an intrusion pivot 1/4
AdversaryInfrastructureCapabilityVictim

Adversary: LEDGER LYNX (fictional), financially motivated

Infrastructure: cdn-update.example · 203.0.113.50 · dukaanmart-payroll.example

Capability: Macro downloader, encoded PowerShell, rclone exfil

Victim: DukaanMart finance (r.iyer, FIN-LT-112)

Victim → infrastructure: proxy logs show FIN-LT-112 calling cdn-update.example.

Meta-features on every event: timestamp, phase, result, direction, methodology and resources. The two axes: socio-political (adversary ↔ victim) and technology (capability ↔ infrastructure).

The model also has two axes: socio-political (why this adversary targets this victim) and technology (how the capability uses the infrastructure). Threat-intel teams use it to cluster events into activity threads and campaigns.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

TASK 07The Unified Kill Chain

Lockheed Martin's Cyber Kill Chain (Room 07) has 7 phases and ends at "actions on objectives", which hides everything that happens inside the network. Paul Pols' Unified Kill Chain (2017) combines the Kill Chain with ATT&CK into 18 phases in three stages:

  • In (initial foothold): Reconnaissance, Resource Development, Delivery, Social Engineering, Exploitation, Persistence, Defense Evasion, Command & Control.
  • Through (network propagation): Pivoting, Discovery, Privilege Escalation, Execution, Credential Access, Lateral Movement.
  • Out (action on objectives): Collection, Exfiltration, Impact, Objectives.

Here's the DukaanMart breach from Rooms 16–17 mapped onto it:

The Unified Kill Chain: 18 phases, in → through → out 0/13 mapped

In

Reconnaissance

Resource Development

Delivery

Social Engineering

Exploitation

Persistence

Defense Evasion

Command & Control

Through

Pivoting

Discovery

Privilege Escalation

Execution

Credential Access

Lateral Movement

Out

Collection

Exfiltration

Impact

Objectives

Why it matters to defenders: every phase is another chance to detect. A real attack has to succeed at many phases in sequence; you only need to catch one of them, early. Phases are also not always linear: attackers loop through "Through" many times as they move host to host.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

TASK 08Final mission: deliver the threat model

Kabir needs a one-page answer for the board. A good threat model deliverable contains:

  1. Scope and assumptions: the DFD with trust boundaries, what's out of scope.
  2. Top threats, each with its STRIDE / LINDDUN category, a risk rating and the attack-tree path it belongs to.
  3. Mitigations with an owner and a due date, plus anything accepted and who signed it off.
  4. Detection coverage: the ATT&CK layer for likely adversaries, with gaps and the D3FEND countermeasures planned.
  5. When to revisit: next design change, after the pentest, and at least yearly.

Pick the mitigation that actually addresses each of the top five threats:

Final mission · Deliver the threat model one mitigation per threat

#1 Payout redirected via IDOR on /payout

#2 Insider approves fraudulent loans

#3 Fake payout webhooks

#4 KYC data leak from backups

#5 No detection for app exploitation (T1190)

Complete the mission for the Architect badge and the room's XP.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+30 XP