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

Free lesson

Mapping a threat report to ATT&CK

After this lesson: I can map the behaviours in a threat report to ATT&CK tactics and techniques.

60 min lesson4 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

Three reports, one language

Three teams write about the same group. One says "macro malware", one says "a dropper", one says "a booby-trapped invoice". Are they describing the same thing?

A shared catalogue of attacker behaviour lets them say it the same way, and lets you check your own defences against it. You work on a made-up report in your own lab copy.

By the end of this lesson

Note

I can map the behaviours in a threat report to ATT&CK tactics and techniques.

Key words

WordWhat it meansExample
ATT&CKMITRE's public catalogue of attacker behaviour
Tacticthe attacker's goal at one stepExecution
Techniqueone way to reach a tactic's goalT1059.001
Procedureexactly how one group uses a technique
Coveragewhich techniques your detections can see

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

Map and test only in your own lab copy. Copper Lantern and its report are made up, and nothing here names a real group. Saying a real group did something is a claim that needs evidence, which is why reports grade their confidence.

Tactics say why, techniques say how

ATT&CK lists 14 tactics for an attack on a company network, from Reconnaissance to Impact. Each tactic has techniques, each with an id. T1059 is running a command interpreter, and T1059.001 is the PowerShell kind, a sub-technique.

A procedure is the group's own detail: "Word starts PowerShell with -nop -w hidden -enc". Mapping turns each sentence of a report into a tactic and a technique.

Worked example: the report's sentences mapped

The report saysTacticTechnique
It emails a Word invoiceInitial AccessT1566.001 Spearphishing Attachment
The victim opens itExecutionT1204.002 Malicious File
Word starts hidden PowerShellExecutionT1059.001 PowerShell
The command is encodedDefense EvasionT1027 Obfuscated Files or Information
It runs whoami /allDiscoveryT1033 System Owner/User Discovery
It looks up cdn-update.exampleCommand and ControlT1071.004 DNS
It posts to /api/check each minuteCommand and ControlT1071.001 Web Protocols

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

Match each behaviour to its tactic

Have a go

Loading…

Your answers are marked here and are not kept. An account keeps your marks.

Set the report against your detections

The lab already has Suricata and Sigma rules, each tagged with technique ids. The Runs write a script that lists the report's seven techniques in tactic order and marks each one covered or a gap.

It reads the tags in rules/examples.rules and in sigma/, so a new tagged rule changes its answer.

Move into the lab's folder

Command
cd ~/detect

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

Make sure the intelligence folder exists

Command
mkdir -p intel

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

Write the mapping script

Command
printf '%s\n' 'import glob' 'OBS = [' '    ["Initial Access", "T1566.001", "Spearphishing Attachment", "report"],' '    ["Execution", "T1204.002", "Malicious File", "events.db"],' '    ["Execution", "T1059.001", "PowerShell", "events.db"],' '    ["Defense Evasion", "T1027", "Obfuscated Files or Information", "events.db"],' '    ["Discovery", "T1033", "System Owner/User Discovery", "events.db"],' '    ["Command and Control", "T1071.004", "DNS", "office.pcap"],' '    ["Command and Control", "T1071.001", "Web Protocols", "office.pcap"],' ']' 'text = open("rules/examples.rules").read().upper()' 'for name in sorted(glob.glob("sigma/*.yml")):' '    text += open(name).read().upper()' 'covered = 0' 'for tactic, tid, name, seen in OBS:' '    found = tid + ";" in text or tid + chr(10) in text' '    covered += found' '    print(tactic.ljust(20), tid.ljust(10), name.ljust(32), seen.ljust(12), "covered" if found else "GAP")' 'print("Covered:", covered, "of", len(OBS))' > intel/attack.py

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

Map the report against the rules

Command
python3 intel/attack.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 a gap always means a missing rule. T1566.001 is a visibility gap: no data about email reaches the lab, so no rule could see it. T1027 is different: the Sigma rule already matches -enc, but nobody tagged it. Check what a rule sees, not only its tags.

Count techniques across reports to choose

One report is one view. Analysts map several reports about the threats they face and count how often each technique appears. A technique in every report and in no rule is the first to work on.

MITRE's ATT&CK Navigator draws such counts as a coloured matrix, called a layer. The code counts three reports.

Try it: count techniques across reports

Code: python
reports = [
    ["T1059.001", "T1071.001", "T1566.001"],
    ["T1059.001", "T1027"],
    ["T1059.001", "T1071.001"],
]
counts = {}
for report in reports:
    for tid in report:
        counts[tid] = counts.get(tid, 0) + 1
print(counts)
# Add a fourth report with T1027 and T1033, then press Run.

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

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

Assignment: choose the techniques to detect next

Write two functions.

technique_counts(reports): reports is a list of reports, each a list of technique ids. A technique counts once per report, however often it appears in that report. Return a dictionary from each id to the number of reports that mention it.

priorities(reports, covered, n): the ids not in the list covered, most reports first, and ids with the same count in alphabetical order. Return at most n of them.

Code: python
def technique_counts(reports):
    return {}

def priorities(reports, covered, n):
    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.