Labs / Threat Frameworks / Name, place and map: the analyst's frameworks

Lab 1 of 3 · Name, place and map: the analyst's frameworks

ATT&CK: map one intrusion to the matrix

Label each step of a real hands-on-keyboard intrusion with its ATT&CK tactic and technique id, and see why a shared map beats a prose write-up.

Start this lab 7 steps

The idea

Caleb runs the security operations centre (SOC) at Birchwood Clinic. An intrusion on the patient-intake server is contained, and the write-up is three pages of prose nobody can compare to anything. His ask: take the captured evidence and label every move with its MITRE ATT&CK tactic and technique id, so the clinic can see which tactics were used and whether its defences cover them.

Every action gets two labels
Every action gets two labels
One outside address, one reachable service
One outside address, one reachable service
Execution is the running, not the result
Execution is the running, not the result
A scan asks, it sends nothing
A scan asks, it sends nothing
A leftover grant is the whole climb
A leftover grant is the whole climb
One tactic, two techniques
One tactic, two techniques
A tactic is a column, a technique fills it
A tactic is a column, a technique fills it

Steps

  1. A matrix, not a list

    MITRE ATT&CK is a catalogue of what attackers actually do, arranged as a grid. Across the top sit tactics, the attacker's goal at a step: Initial Access, Execution, Privilege Escalation, Persistence, Discovery, Command and Control (C2), Exfiltration, and more. Under each tactic sit techniques, the ways to reach that goal, each with an id like T1046.

    A technique can split into sub-techniques, written T1059.004: the .004 is one specific flavour of T1059. The split that trips people up is tactic versus technique. "They got in" is not an ATT&CK answer; "Initial Access, by exploiting a public-facing app (T1190)" is.

    The tactic is the why, the technique is the how, and mapping means naming both for each action. This is not detection: the evidence here is already collected. The job is to put a shared label on each piece so defenders anywhere compare incidents, coverage and tooling in the same words.

    Read the capture index Caleb left, then work through the evidence file by file.

    intake:~# cat /root/triage/notes.txt
  2. How they got on: Initial Access

    Start where the attacker did. The intake API is reachable from the internet, so the first move is some flaw in that public service. In the matrix that goal is the Initial Access tactic, and exploiting an internet-facing service is the technique Exploit Public-Facing Application, T1190.

    The app's own log is the evidence. A normal export request takes a format name; this one put an expression in that field, and the server evaluated it. That is a classic injection into a public, internet-facing path. That one line is the whole foothold: no password guessed, no phishing email, only a reachable service doing what it should never do.

    Pull the lines that mention the export path.

    intake:~# grep /api/export /var/log/intake/app.log
  3. The shell doing the work: Execution

    The exploit gave the attacker a way to run one command. What turns that into an intrusion is a real, interactive shell. From here they worked by hand, which the webapp account's .bash_history caught line by line.

    Running commands through a command interpreter is the Execution tactic. The interpreter here is a Unix shell, so the technique is Command and Scripting Interpreter: Unix Shell, T1059.004, a sub-technique of T1059 (the .004 marks the Unix-shell flavour, as opposed to PowerShell or Python).

    The session opens with id and uname -a: the attacker checking who and what they landed as. The account is webapp (uid 1000 in /etc/passwd), a limited service account, not root. Read the whole history: it is the spine of the rest of this lab.

    intake:~# cat /home/webapp/.bash_history
  4. Looking around the network: Discovery

    With a shell, the attacker wants to know what else they can reach. The history has a run of nc -z lines against a couple of inside addresses and a list of ports: a fast check of which services answer. The goal of mapping what is reachable is the Discovery tactic, and probing for listening services across the network is Network Service Discovery, T1046.

    Discovery is wider than the network scan, though, and a good map names the rest too. The opening lines are Discovery too: id is System Owner/User Discovery (T1033), uname -a and cat /etc/os-release are System Information Discovery (T1082), and cat /etc/passwd is Account Discovery: Local Account (T1087.001).

    Pull the scanning lines out of the history.

    intake:~# grep nc /home/webapp/.bash_history
  5. Taking root: Privilege Escalation

    Every root-level move that follows (adding an account, writing to /etc/cron.d, reading other users' files) needs more than the webapp account the exploit landed. /etc/passwd put webapp at uid 1000, not root. So before any of that, the attacker had to climb.

    Gaining a higher privilege level is the Privilege Escalation tactic. Here the path is a sudo misconfiguration: a release script left webapp a blanket NOPASSWD: ALL grant in /etc/sudoers.d. Abusing a sudo rule to reach root is Abuse Elevation Control Mechanism: Sudo and Sudo Caching, T1548.003.

    Read the grant, then the two sudo lines in the history.

    intake:~# cat /etc/sudoers.d/intake-deploy
    intake:~# grep sudo /home/webapp/.bash_history
  6. Two ways to stay: Persistence

    An attacker who loses the shell wants back in without re-exploiting anything. Keeping access is the Persistence tactic, and this intrusion set up two different techniques for it.

    First, a new local account. As root, the attacker runs useradd, and /etc/passwd ends with a svc-backup line the clinic never created. Creating a login for persistence is a Create Account technique, T1136. You will pin its exact sub-technique in the practice tickets.

    Second, a scheduled job. /etc/cron.d/intake-maint runs every 15 minutes as root. A cron job for persistence is Scheduled Task/Job: Cron, T1053.003.

    List the non-system accounts, then read the job.

    intake:~# awk -F: '$3 >= 1000 {print $1, $3, $7}' /etc/passwd
    intake:~# cat /etc/cron.d/intake-maint
  7. Calling out, taking data, and the finished map

    Three tactics close out the intrusion, all over the web, and they are the ones analysts most often mix up. One curl pulls a tool down onto the host; one is the planted job's recurring check-in to a server the attacker owns; the last packages the clinic's records and ships them out.

    Pull the curl lines, then step back and read the whole map you have built.

    intake:~# grep curl /home/webapp/.bash_history

Run these steps on real machines

Keep reading

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab