Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Planning an adversary emulation from ATT&CK

After this lesson: I can turn the techniques in a threat report into an emulation plan.

60 min lesson6 commandsDetection engineering lab: Suricata rules, Sigma rules and Zeek-style logs on one private Ubuntu VM

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

A fire drill for your detections

A school does not wait for a real fire to find out whether the alarm works. It holds a drill, on a day it chooses, with everyone told what will happen.

Security teams do the same with attackers. They act out what a known group does, safely, and watch which alarms ring. In this lesson you plan such a drill for your own lab copy.

By the end of this lesson

Note

I can turn the techniques in a threat report into an emulation plan.

Key words

WordWhat it means
Adversary emulationacting out a known group's behaviour to test defences
Emulation planthe ordered steps and tests of one emulation
Red teampeople who play the attacker
Purple teamattackers and defenders working side by side
Rules of engagementwhat the testers may and may not do

The cells students fill in are left blank in this preview.

Starter

Have a go

Starter

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

The one rule

Important

Emulate only in your own lab copy. On a real network, every test needs written permission from whoever owns it, before it starts. Testing systems without authorisation is an offence under the Computer Misuse Act 1990. Copper Lantern, its report and the office are made up.

Emulation copies one known adversary

A penetration test looks for as many weaknesses as it can. A red team tries to reach a goal without being caught. Adversary emulation is narrower: it acts out the techniques one known group uses, in their order.

The question it answers is plain. If that group came here, which of its steps would we see? A purple team runs it with the defenders watching.

Worked example: four kinds of test

KindGoalDefenders told?What you get
Penetration testFind many weaknessesUsuallyA list of findings
Red teamReach a goal unseenNoWhether they were caught
Adversary emulationAct out one group's techniquesSometimesWhich steps were seen
Purple teamTest and fix togetherYes, they sit inDetections fixed the same day

The cells students fill in are left blank in this preview.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

A plan turns a report into steps

Northgate CERT's update says Copper Lantern reached a Linux file server too. There it asked who it was, read the system details, added a cron job, staged files in a hidden folder, deleted them and called home.

An emulation plan lists each step with its tactic, its ATT&CK technique and a harmless test that leaves the same evidence. The VM plays the file server, srv-files.

Move into the lab's folder and make emu

Command
cd ~/detect && mkdir -p emu

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Write the emulation plan, part 1

Command
printf '%s\n' 'PLAN = [' '    ["1", "Discovery", "T1033", "System Owner/User Discovery", "A1", "process creation"],' '    ["2", "Discovery", "T1082", "System Information Discovery", "A2", "process creation"],' '    ["3", "Persistence", "T1053.003", "Scheduled Task/Job: Cron", "A3", "process creation"],' '    ["4", "Collection", "T1074.001", "Local Data Staging", "A4", "process creation"],' '    ["5", "Defense Evasion", "T1070.004", "File Deletion", "A5", "process creation"],' '    ["6", "Command and Control", "T1071.001", "Web Protocols", "A6", "web proxy log"],' ']' 'print("step tactic              technique  test evidence          name")' 'for step, tactic, technique, name, test, evidence in PLAN:' '    print(step.ljust(4), tactic.ljust(19), technique.ljust(10), test.ljust(4), evidence.ljust(17), name)' 'tactics = sorted({row[1] for row in PLAN})' 'untested = [row[0] for row in PLAN if not row[4]]' > emu/plan.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Write the emulation plan, part 2

Command
printf '%s\n' 'print("Tactics:", len(tactics), " Techniques:", len({row[2] for row in PLAN}), " Steps with no test:", len(untested))' >> emu/plan.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Print the plan

Command
python3 emu/plan.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

A common mistake

Warning

Many people think emulation means running the attacker's real tools. It does not. A defender needs the evidence a technique leaves, not the harm it does. So each test is a harmless stand-in that leaves the same traces, and real malware never comes near the network.

Rules of engagement come before any test

Before anything runs, the rules of engagement are agreed in writing. They name who authorised the test, the one target, the time window and what is allowed.

They also say when to stop, who to call and how everything is cleaned up afterwards. A test outside them is not a test; it is an attack.

Write the rules of engagement

Command
printf '%s\n' 'Emulation of Copper Lantern, Linux stage, Riverside office' 'Authorised by: the head of IT, in writing, 16 November 2026' 'Target: srv-files, which is this lab VM, and nothing else' 'Window: 16 November 2026, 09:00 to 17:00' 'Allowed: the tests in emu/run.py and emu/pulse.py, harmless stand-ins only' 'Not allowed: real malware, other machines, the internet, changing real data' 'Stop if: anything breaks, or a real alert from another source fires' 'Contacts: the purple team lead and the on-call analyst' 'Cleanup: python3 emu/run.py clean, then check crontab -l is empty' > emu/scope.txt

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Read what is allowed and when to stop

Command
grep -E "^(Target|Allowed|Not allowed|Stop if)" emu/scope.txt

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Try it: put the steps in tactic order

Code: python
ORDER = ["Discovery", "Persistence", "Collection", "Defense Evasion", "Command and Control"]
plan = [("A6", "Command and Control"), ("A1", "Discovery"), ("A3", "Persistence")]

for test, tactic in sorted(plan, key=lambda step: ORDER.index(step[1])):
    print(test, tactic)
# Add ("A4", "Collection") to the plan, then press Run.

Make a free account to save your work and track your progress.

Assignment: check an emulation plan

A plan is a list of steps. Each step is a dictionary with "step" (a number), "tactic", "technique" and "test".

valid_id(tid) returns True when tid is T and four digits, optionally followed by a dot and three digits, such as T1033 or T1053.003.

problems(plan) returns a list of strings in step order: "step N: bad id" for a step whose technique is not valid, then "step N: no test" for a step whose test is empty.

by_tactic(plan) returns a dictionary from each tactic to the sorted list of its distinct technique ids.

Code: python
def valid_id(tid):
    return False

def problems(plan):
    return []

def by_tactic(plan):
    return {}

Make a free account to save your work and track your progress.

Exit quiz

Have a go

Exit quiz

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.