Endpoint hunting requires tracing execution chains: parent process → child process → grandchild process. An attacker's process tree — Word spawning PowerShell spawning cmd spawning certutil — tells a story that individual process events cannot. KQL does not have native graph traversal, but recursive join patterns achieve the same result. This subsection teaches process tree reconstruction for endpoint hunt campaigns.
Deliverable: The ability to reconstruct process execution trees from DeviceProcessEvents and identify suspicious parent-child relationships that indicate malicious execution chains.
⏱ Estimated completion: 25 minutes
Process trees reveal intent
A single powershell.exe execution is noise — it runs thousands of times per day. But WINWORD.EXE → powershell.exe → cmd.exe → certutil.exe -urlcache -split -f http://... is a malicious document delivering a payload. The individual events are unremarkable. The chain is the indicator.
Figure TH2.11 — Process tree interpretation. The same child process (powershell.exe) is normal when spawned by explorer.exe and suspicious when spawned by OUTLOOK.EXE. Context is in the parent.
Try it yourself
Exercise: Hunt for Office child process spawning
Run the Office → script interpreter query against your environment's DeviceProcessEvents. How many results appear in 7 days? Examine each: is there a legitimate Office automation workflow that spawns these interpreters, or are the results genuine anomalies?
In most environments, this query returns very few results (if any) because legitimate Office workflows rarely spawn script interpreters. Any result is worth investigating.
⚠ Compliance Myth: "Process monitoring data is only useful for EDR alerts — not for hunting"
The myth: DeviceProcessEvents data is consumed by Defender for Endpoint’s built-in detections. Hunting against it is redundant.
The reality: Defender for Endpoint’s built-in detections cover known-malicious process patterns. Living-off-the-land techniques (LOLBins) use legitimate binaries in legitimate parent-child relationships — certutil downloading files, mshta executing scripts, regsvr32 loading DLLs. These are not inherently malicious, so the built-in detections may not flag them. Hunting for specific parent-child combinations (Office → certutil, cmd → bitsadmin with download parameters) catches the technique-specific patterns that broad behavioral detections miss. TH9 applies this systematically across the full LOLBin landscape.
Extend this approach
KQL does not support native recursive graph traversal (unlike Cypher or Gremlin). The manual join pattern shown here works for 2–3 levels of depth. For deeper trees (5+ levels), use Sentinel notebooks with NetworkX or MSTICPy's process tree visualization. For most hunting campaigns, 3 levels (grandparent → parent → target) is sufficient to identify malicious chains. TH9 and TH12 provide the specific parent-child patterns relevant to their respective techniques.
The full course continues with advanced topics, production detection rules, worked investigation scenarios, and deployable artifacts. Premium subscribers get access to all courses.