Wrong Parent
Every Windows process except System is started by another, its parent, and each core process has a known parent. The Service Control Manager, services.exe, starts every service, and wininit.exe starts lsass.exe. A process whose recorded parent never starts it is either an impostor under a genuine name or something run through a service, a script host or another program. Parents can mislead too, because a launcher that has exited leaves an orphan, a child with no live parent, and its process ID (PID) can later belong to another process. Check the parent and its start time first, then rebuild the chain from creation records.
Normal and Suspicious
A clean machine sits beside a suspicious one, and the pointer marks where to look.
Normal
A clean Windows 11 install
| Name | PID | Parent |
|---|---|---|
explorer.exe | PID 968 | userinit.exe, exited |
cmd.exe | PID 1108 | explorer.exe |
Suspicious
ws-042,
| Name | PID | Parent |
|---|---|---|
services.exe | PID 948 | wininit.exe |
PSEXESVC.exe | PID 7884 | services.exe |
cmd.exe | PID 7932 | PSEXESVC.exe |
| ParentStarted by PsExec's service: a prompt a person opens starts under explorer.exe or their terminal. Wrong Parent | ||
Look Inside
Why It Matters
A core process with the wrong parent is an impostor, or code running inside something else. A shell under a service, lsass.exe or the sign-in screen is how remote execution and backdoors show.
How to Confirm It
Work through these in order. Each step names the page that shows how.
- Rebuild the chain from creation records joined on unique process ids, Sysmon's ProcessGuid or Defender's ProcessUniqueId, never on PIDs. The records name the launcher even after it exits.Process Trees and Call Chains
- In a live view or a memory image, compare the parent's start time with the child's. A parent that started later than its child is a reused PID, not the real parent. System is the exception, because its PID is always 4, so it never passes to another process.Process Trees and Call Chains
- Treat any other orphan as a lead, and find the launcher that started it, and has since exited, in the creation records.Process Trees and Call Chains
- Check the child's path, account and signer against its profile. Each one that differs is a sign of its own.Process Listings and Scans
- Read the command lines of the child and its parent, which say what the shell was told to run, if anything.Command Line and Environment
What Defenders See
Each record names its log and what must be switched on to get it.
| Record and Where It Lands | What to Read | How to Turn It On |
|---|---|---|
4688 A new process has been created (opens in a new tab)SecurityIt is written on the computer the process ran on. | Creator Process Name and the hexadecimal Creator Process ID, the launcher as recorded at creation, even after it exits.Process Trees and Call Chains shows how to read it. | Turn on Audit Process Creation. For the command line, also turn on Include command line in process creation events. |
1 Process creation (opens in a new tab)Microsoft-Windows-Sysmon/OperationalIt is written on any Windows computer running Sysmon. | ParentImage, Parent | Run Sysmon with ProcessCreate events in its configuration. |
| Device | Initiating | The Defender for Endpoint sensor on the device |
5 Process terminated (opens in a new tab)Microsoft-Windows-Sysmon/OperationalIt is written on any Windows computer running Sysmon. | When each launcher ended, which explains a child with no live parent and dates when its PID became free for reuse.Process Trees and Call Chains shows how to read it. | Run Sysmon with ProcessTerminate events in its configuration. |
What It Looks Like
This record is decoded field by field, with what each value means.
| Field, as the Record Writes It | What It Tells You |
|---|---|
New Process NameC:\ | A command prompt, the genuine program in its home folder. Name and path are fine, so the creator decides. |
Creator Process NameC:\ | PsExec's service created it, from the Windows folder where PsExec puts it. A prompt a person opens has explorer |
Creator Subject: Account NameWS-042$ | The machine account, the name SYSTEM is logged under here. No one at the desktop opened this prompt. |
- False Positives
User Account Control gives an elevated process the program that asked for it as its parent, though SYSTEM created it, so a recorded parent is not always the creator.
Live views show csrss.exe, wininit.exe, winlogon.exe and explorer.exe with no parent, because the copy of smss.exe or the userinit.exe that started them has exited.
- Blind Spots
A parent can be named on purpose at creation. Event 4688 in the Security log, Sysmon event 1 and a memory image all keep that claim, as Parent Process Spoofing explains.
Win32_Process's ParentProcessId and windows.pstree link a child to whatever holds its recorded parent PID now, with no time check, so a reused PID shows a wrong parent.
Hunt It
The same hunt is written for four tools, so pick the one you use. Defender XDR and Sentinel queries are in KQL, which you paste into Advanced hunting in the Defender portal or into Sentinel's Logs page. Splunk queries are in SPL, for its Search page, and Velociraptor queries are in VQL, which you run as a hunt.
Needs Defender for Endpoint. Creation records name a launcher even after it exits, so csrss.exe, wininit.exe and winlogon.exe expect smss.exe here. Admins use PsExec, WMI and remoting too, so confirm the account and source.
// Core processes created by a parent that never starts them (an lsass.exe clone included), and shells under core or remote execution parentsDeviceProcessEvents| where Timestamp > ago( 30d)| extend Child = tolower( FileName), Parent = tolower( InitiatingProcessFileName)| where Child != Parent or Child == "lsass.exe"| where ( Child in ( "services.exe", "lsass.exe", "lsaiso.exe") and Parent != "wininit.exe") or ( Child in ( "wininit.exe", "winlogon.exe") and Parent != "smss.exe") or ( Child == "csrss.exe" and Parent !in ( "smss.exe", "svchost.exe")) or ( Child == "svchost.exe" and Parent !in ( "services.exe", "msmpeng.exe")) or ( Child == "spoolsv.exe" and Parent != "services.exe") or ( Child == "userinit.exe" and Parent !in ( "winlogon.exe", "dwm.exe")) or ( Child in ( "cmd.exe", "powershell.exe", "pwsh.exe") and Parent in ( "lsass.exe", "spoolsv.exe", "winlogon.exe", "services.exe", "psexesvc.exe", "wmiprvse.exe", "wsmprovhost.exe"))| project Timestamp, DeviceName, FileName, FolderPath, InitiatingProcessFileName, InitiatingProcessParentFileName, AccountName, ProcessCommandLine| order by Timestamp descIn a Memory Image
Volatility 3 reads a memory image, and each of its plugins below shows part of this sign.
windows.pstree(documentation, opens in a new tab)Memory Image A Volatility 3 plugin. It is one check run on a saved copy of a Windows machine's memory. pstree means process tree. The tree by recorded parent PID, from the active list. Exited launchers are missing, and a reused PID can show a wrong parent.windows.pslist(documentation, opens in a new tab)Memory Image A Volatility 3 plugin. It is one check run on a saved copy of a Windows machine's memory. pslist means process list. Each process's PID, parent PID and create time. A parent created after its child is a reused PID, except for System.windows.psscan(documentation, opens in a new tab)Memory Image A Volatility 3 plugin. It is one check run on a saved copy of a Windows machine's memory. psscan means process scan. May still find launchers that have exited, such as the session copies of smss.exe, with their exit times.
Rules to Compare With
Security vendors publish detection rules anyone can read. These look for the same thing, so compare your own with them.
Show the 6 Public Rules
- Unusual Parent-Child Relationship (opens in a new tab) Elastic: The expected parent of each core process, and limits on what smss.exe, csrss.exe and conhost.exe may start.
- Windows Processes Suspicious Parent Directory (opens in a new tab) SigmaHQ: Flags core processes such as svchost.exe, lsass.exe, services.exe, wininit.exe and winlogon.exe whose parent does not run from System32 or SysWOW64, with Defender excepted.
- Uncommon Svchost Parent Process (opens in a new tab) SigmaHQ: Flags svchost.exe started by a parent other than services.exe and a short list of known exceptions.
- Suspicious Spool Service Child Process (opens in a new tab) SigmaHQ: Flags unexpected children of spoolsv.exe.
- Unusual Print Spooler Child Process (opens in a new tab) Elastic: Flags unusual children of spoolsv.exe.
- Conhost Spawned By Uncommon Parent Process (opens in a new tab) SigmaHQ: Flags conhost.exe started by a parent that does not open consoles, such as lsass.exe, services.exe or winlogon.exe.
How to Prevent It
Each control helps prevent it, and its line says what it does here.
- ASR: Block process creations originating from PSExec and WMI commands (opens in a new tab) Blocks processes started through PsExec and WMI, the remote execution parents of a SYSTEM shell like the one on ws-042.
- ASR: Block all Office applications from creating child processes (opens in a new tab) Stops Word, Excel and the other Office apps starting child processes, so a document cannot be the start of a shell.
- Audit Process Creation (opens in a new tab) Writes event 4688 in the Security log with each new process's creator, so a wrong parent can be seen at all. Check it in the Registry: Advanced Audit Policy
Sources
- MITRE ATT&CK T1134.004: Access Token Manipulation: Parent PID Spoofing (opens in a new tab)
- Elastic: Unusual Parent-Child Relationship (prebuilt rule) (opens in a new tab)
- Microsoft Learn: 4688(S) A new process has been created (opens in a new tab)
- Microsoft Learn: Win32_Process class (ParentProcessId and reused process ids) (opens in a new tab)
- Microsoft Learn (archived blog): How to troubleshoot high CPU in the System process (its PID is always 4) (opens in a new tab)
- Microsoft Sysinternals: Sysmon (process GUIDs survive reused PIDs) (opens in a new tab)
- Microsoft Learn: MSGina.dll features (Userinit starts the shell) (opens in a new tab)
- Microsoft Tech Community (Ask the Performance Team): WS2008: Terminal Services Architecture (userinit.exe starts the shell, then exits) (opens in a new tab)
- Microsoft Tech Community (Ask the Performance Team): WS2008: Startup Processes and Delayed Automatic Start (each session's smss.exe copy) (opens in a new tab)
- SigmaHQ: PsExec Service Execution (the service binary in C:\Windows) (opens in a new tab)
- Velociraptor: Windows.Attack.ParentProcess (opens in a new tab)
- Volatility 3: windows.pstree (opens in a new tab)
MITRE ATT&CK is a free public catalogue of the techniques attackers use. Each technique has an ID, such as T1055 for Process Injection, so defenders can name the same behaviour the same way. This red flag can point to these techniques.
- T1036 (opens in a new tab) Masquerading
- T1036.005 (opens in a new tab) Masquerading: Match Legitimate Resource Name or Location
- T1546.008 (opens in a new tab) Event Triggered Execution: Accessibility Features