Every detection starts in the middle of a story. A detector reviews a stretch of recent activity, decides what it means, and moves on. Processes don't care where that stretch begins. A shell opened at nine in the morning is still running at noon, and when it finally does something interesting, the moment it was born may be hours outside anything the detector is looking at.
That gap is easy to miss, because it doesn't look like a gap. It looks like a command that came from nowhere.
Key Takeaways
- "What launched this?" is usually the first question in an investigation, and the answer often lies outside the period a detector is reviewing.
- Long-lived parents (open shells, remote sessions, services started at boot) outlast any review, so activity launched from them, which is where hands-on-keyboard work lives, is the most likely to arrive without a parent.
- The fix is a reliable process identity plus a memory of earlier activity, and an honest "not observed" when the parent can't be found.
The first question
Ask an experienced analyst to look at a suspicious PowerShell process and watch what they check first. Most look at the parent before they read the command line.
PowerShell launched by Explorer after someone clicked the Start menu is ordinary. PowerShell launched by a document viewer is a different conversation. MITRE ATT&CK tracks it as Command and Scripting Interpreter: PowerShell (T1059.001). (MITRE ATT&CK, T1059.001) In practice, most useful judgements about a PowerShell process depend on what started it. SANS makes the broader point: "Knowing what's normal on a Windows host helps cut through the noise to quickly locate potential malware." (SANS, Hunt Evil) Which process normally starts which is, in our experience, a large part of that baseline.
Attackers know this too. ATT&CK documents Parent PID Spoofing (T1134.004): "Adversaries may spoof the parent process identifier (PPID) of a new process to evade process-monitoring defenses". (MITRE ATT&CK, T1134.004) A technique dedicated to faking a process's parent is a good measure of how much defenders rely on the real one.
The parent was there. The detector just wasn't looking yet
Consider a hypothetical morning. At 09:02 someone opens a remote desktop session and starts a command prompt. It sits idle. At 11:40 the same prompt runs:
whoami /groups
net group "Domain Admins" /domain
If the detector reviews the last few minutes of activity, it sees two discovery commands. It doesn't see the prompt starting, the session it belongs to or the account that opened it. All of that happened two and a half hours earlier.
The commands haven't lost their parent. The parent is still running. It was simply born before anyone was looking.
This isn't an edge case. A lot of the most important processes on a host live a long time:
| Parent | Typically started | Still running when |
|---|---|---|
| A command prompt or PowerShell window | When someone opened it | They type the next command, hours later |
| A remote desktop session | At logon | The person in it does anything at all |
| A service | At boot | It is abused days or weeks later |
| A scheduled task host | When the task first ran | The task's payload acts |
There is an uncomfortable pattern in that table. What decides whether the context survives is the age of the parent, not the speed of the attack. Intruders who work from a shell they opened earlier, or through a service that has been running for days, are the ones whose activity arrives without a parent.
Three ways to get it wrong
When an action's parent isn't in the activity being reviewed, a detector has a few choices, and the easy ones are poor.
Drop the relationship. The child appears with no parent, as if it started itself. The verdict and the investigation both lose the single most useful piece of context, and two commands from the same shell may look unrelated.
Guess from the process ID. Process IDs are small numbers, and Windows hands them out again once a process exits. A guess based on the ID alone can attach a child to whatever unrelated process holds that number later. Microsoft's Sysmon addresses this directly: it "includes a process GUID in process create events to allow for correlation of events even when Windows reuses process IDs." (Microsoft Learn, Sysmon)
Review a longer stretch. Make the stretch long enough to include 09:02 and the parent comes back, along with two and a half hours of everything else on the host. That costs more to assess, and as the previous article in this series argued, a lot of unrelated activity can drown the one action that matters. And a service started at boot is still out of reach.
Identity and memory
The approach that works has two parts.
First, every process needs an identity that can't be confused with any other: not a reused number, but a value that refers to one process for as long as the records exist. Without that, any lookup is a guess.
Second, the detector needs a memory. When an action's parent isn't in the stretch under review, the detector looks for that parent's start in activity it recorded earlier. If it finds it, the parent joins the picture as a real participant: what it was, its command line, the account that ran it. If it doesn't, the detector should say so, rather than fill the hole with something plausible.
That last point matters as much as the lookup. "Parent not observed" is useful information. It tells the analyst where the evidence ends. An invented or misattributed parent is worse than none, because it looks exactly like evidence.
One way to build it
This is how Logster, an AI-driven endpoint threat detection platform for Windows and Linux built by the team behind these articles, handles the gap.
Recovered parents on Windows. When activity on a Windows endpoint was started by a process that began long before the activity in question, Logster recovers that process from what it recorded earlier. The AI model's verdict and the analyst's investigation both start from the real parent: its program, its command line and the account it ran as. In the morning above, the two commands arrive attached to the prompt that was opened at 09:02, and the account that opened it.
More than parents. A long-running process that writes a file or opens a connection is named for what it is, not left anonymous.
Honest gaps. When the earlier record can't be found, Logster still shows the parent's name as the child reported it, and marks it as not observed. No account is attached, because the child's record doesn't say who ran its parent, and Logster doesn't borrow one from elsewhere to fill the space.
Detection doesn't wait. Finding a parent never holds up a verdict. If the earlier record can't be reached in time, the verdict goes ahead with the parent marked as not observed.
Where the memory runs out
Recovery depends on there being something to recover, and on that something being true.
On Linux endpoints, this recovery isn't available today. A parent that started earlier is named from what the child reported and marked as not observed, so the gap is visible but not filled.
A memory is only as long as its retention. A service that has run for months may have started long before the oldest record still kept, and then there is nothing to find. The same applies when collection began after the parent started, for example on a host where monitoring was installed while the parent was already running.
The recovery reaches back one step, to the process that started the activity under review. The rest of the family tree above that parent is not rebuilt.
And recovering the recorded parent faithfully recovers whatever was recorded. If an attacker spoofed the parent when the process was created, the record carries the spoofed parent, and recovery brings that back. Catching spoofing needs its own checks; a better memory doesn't replace them.
Find the oldest parent in your last alert
Two checks to run against your own detection:
- Pick a recent alert that involved commands typed by a person. Ask your tooling what launched the shell, when it started and under which account. If the answer is blank or "unknown", find out whether the parent was truly unobserved or simply started before the period your detector reviewed.
- On a test host you're allowed to use, open a remote session and a command prompt, leave it idle for longer than your detector's review period, then run
whoami /groups. Look at what your tool says started that command.
If either check ends in a command from nowhere, and the parent's start is sitting in your own logs, your detector had the context and didn't use it.
Top comments (0)