Lesson map
Lesson 17 published. Map, example, EX065.
flowchart TD
N0["Learning outcomes"]
N1["17.1 Process trees"]
N2["17.2 The lab data"]
N3["Lab — building the tree"]
N4["17.3 Reading the result"]
N5["17.4 What cmd did"]
N6["17.5 Relating to the timeline"]
N7["17.7 Reporting"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> N6 --> N7
N7 --> EX["Worked example"]
EX --> Q["Exercise EX065"]
Logical drawing
flowchart LR
N0["Learning outcomes"]
N1["17.1 Process trees"]
N2["17.2 The lab data"]
N3["Lab — building the tree"]
N4["17.3 Reading the result"]
N5["17.4 What cmd did"]
N6["17.5 Relating to the timeline"]
N7["17.7 Reporting"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> N6 --> N7 --> Q["EX065"]
[Learning outcomes]
|
v
[17.1 Process trees]
|
v
[17.2 The lab data]
|
v
[Lab — building the tree]
|
v
[17.3 Reading the result]
|
v
[17.4 What cmd did]
|
v
[17.5 Relating to the timeline]
|
v
[17.7 Reporting]
|
v
[Worked example] --> [Exercise EX065]
Learning outcomes
You will (1) reconstruct a process tree from synthetic EDR records; (2) identify suspicious parent-child relationships; (3) relate the tree to the timeline; (4) report findings with limits.
17.1 Process trees
Every process has a parent. Reading parent-child links shows how a program came to run: a document opened by a user, a script started by a shortcut, or a tool launched by malware. The SANS-style habit of "know normal" means knowing which children each parent usually has.
Knowing normal for ward PCs means explorer.exe usually starts programs such as Teams and the medication viewer, not script hosts running from a removable drive. A child process that is unusual for its parent is a lead, not a finding, until other evidence supports it. Sana checks each unusual link against the timeline and file events.
17.2 The lab data
The contained lab holds synthetic EDR process records for WARD4-PC2 around 10:02, using process IDs and parent IDs. No samples are present.
The records keep the real structure, a process ID, a parent ID and a name, but are synthetic copies prepared for the lab. Process IDs in the lab are simplified numbers rather than the values from the real export. The exercise teaches reading the structure without exposing any real hospital data. The lab copy covers only the minutes around 10:02 on WARD4-PC2.
Lab — building the tree
"""Build a process tree from synthetic (pid, ppid, name) records."""
procs = [(400, 1, "explorer.exe"), (812, 400, "wscript.exe"), (900, 812, "svch.exe"),
(950, 900, "cmd.exe"), (420, 1, "teams.exe")]
kids = {}
for pid, ppid, name in procs: kids.setdefault(ppid, []).append((pid, name))
def show(p, depth=0):
for pid, name in kids.get(p, []):
print(" " * depth + f"{name} ({pid})"); show(pid, depth + 1)
show(1)
Run with python3 lab_tree.py. Verified output:
explorer.exe (400)
wscript.exe (812)
svch.exe (900)
cmd.exe (950)
teams.exe (420)
17.3 Reading the result
Explorer (400) started wscript (812), which started svch (900), which started cmd (950). Explorer also started Teams (420), a normal child. A script host launched by explorer from a removable drive, then a program from C:/Users/Public, then a command shell, is a chain that does not occur in normal ward use.
The chain matches what the earlier filtering lab showed: wscript.exe started from the stick and wrote svch.exe. The tree adds that svch.exe itself started cmd.exe, which the event filter alone did not show. Teams is included to show that an unusual chain stands out against normal children of explorer.
17.4 What cmd did
The analyst's report says cmd ran system information commands; EDR blocked further activity at 10:09 containment. Sana does not repeat or test any commands; she records what the records show.
Sana's role is to record the chain and times; interpreting what the commands meant belongs to the analyst. Repeating the commands on a lab PC could add nothing safely and might confuse the records. Containment at 10:09 cut the PC off from the network about six minutes after cmd.exe started. Her diagram notes that cmd.exe's activity comes from the analyst's report, not from her own examination.
17.5 Relating to the timeline
The wscript start matches 10:02:41 corrected; svch at 10:02:44; cmd at 10:03:10. The tree and timeline agree.
The cmd.exe start at 10:03:10 comes twenty-six seconds after svch.exe was written, consistent with the program running a command soon after it started. All three of these are EDR times stamped by the synchronised EDR server, so they match the corrected PC-local times without any adjustment. Owen then confirms the cmd.exe time against the time given in the analyst's report. The agreement between tree and timeline supports both the clock correction and the order of events.
17.6 Limits
Short-lived processes can be missed if the agent was busy; parent IDs can be reused after a process ends. Sana checks start times to make sure the parent existed when the child started.
Checking start times means confirming that process 812 was already running when process 900 started, and so on down the chain. If a parent's start time came after its child's, the link would be a reused ID rather than a real parent. Sana records this parent-time check in the diagram's source line for each link.
17.7 Reporting
The tree goes into the report as a simple indented diagram with times and sources.
An indented diagram is easier for managers to read than a table of IDs, and the times and sources keep it checkable. The diagram cites the EDR export it was built from by its SHA-256 hash. Owen's confirmation of the cmd.exe time against the analyst's report is noted beneath it. The board version of the diagram omits process IDs and keeps the names and times.
Worked example
Sana's diagram: "explorer (400) → wscript (812) 10:02:41 → svch (900) 10:02:44 → cmd (950) 10:03:10; explorer → teams (420) normal. Source: EDR export, hash recorded. Parent start times checked." Owen confirms the cmd time against the analyst report.
Synthetic case. Records come from the lab script.
Errors and limits
Process trees show what started what, not why; intent comes from wider evidence.
Exercises
- EX065 — The chain. Give the suspicious process chain.
Show marking criteria
Rubric: 3 = explorer→wscript→svch→cmd with IDs; 2 = names only; 1 = wrong; 0 = none. - EX066 — Normal child. Which child of explorer was normal?
Show marking criteria
Rubric: 3 = teams (420); 2 = name only; 1 = wscript; 0 = none. - EX067 — ID reuse. How does Sana guard against parent ID reuse?
Show marking criteria
Rubric: 3 = checks parent existed at child start; 2 = partial; 1 = vague; 0 = none. - EX068 — Tree and timeline. Do the tree and timeline agree? Give times.
Show marking criteria
Rubric: 3 = yes; 10:02:41, 10:02:44, 10:03:10; 2 = yes only; 1 = no; 0 = none.
Synthesis
Process trees reveal suspicious chains; check IDs and times, and report with sources and limits.
Continue studying — chapter 17 of 18
← Chapter 16 (draft) · Course chapter index · Chapter 18 (draft) →