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
| Word | What it means | Example |
|---|---|---|
| ATT&CK | MITRE's public catalogue of attacker behaviour | |
| Tactic | the attacker's goal at one step | Execution |
| Technique | one way to reach a tactic's goal | T1059.001 |
| Procedure | exactly how one group uses a technique | |
| Coverage | which techniques your detections can see |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
3 questionsThe 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 says | Tactic | Technique |
|---|---|---|
| It emails a Word invoice | Initial Access | T1566.001 Spearphishing Attachment |
| The victim opens it | Execution | T1204.002 Malicious File |
| Word starts hidden PowerShell | Execution | T1059.001 PowerShell |
| The command is encoded | Defense Evasion | T1027 Obfuscated Files or Information |
| It runs whoami /all | Discovery | T1033 System Owner/User Discovery |
| It looks up cdn-update.example | Command and Control | T1071.004 DNS |
| It posts to /api/check each minute | Command and Control | T1071.001 Web Protocols |
The cells students fill in are left blank in this preview.
Check
Have a go
Check
3 questionsMatch 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
cd ~/detectShown here, not run. Press Start lab to type it into your own lab’s terminal.
Make sure the intelligence folder exists
mkdir -p intelShown here, not run. Press Start lab to type it into your own lab’s terminal.
Write the mapping script
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.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Map the report against the rules
python3 intel/attack.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsA 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
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 questionsAssignment: 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.
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