Wrong Account
Every process runs in a session and carries a token, the security record that names its account and its integrity level, which is how far Windows trusts it. Services run as SYSTEM or a service account in session 0, where Windows keeps its services. The programs a person opens run as that person in their own session, at medium integrity, or high when elevated. A command prompt running as SYSTEM in session 0, or a system process under a person, means something handed it that identity, such as a remote execution service. Read the account and integrity level from the token first, and the session from the kernel.
Normal and Suspicious
A clean machine sits beside a suspicious one, and the pointer marks where to look.
Normal
A clean Windows 11 install
| Part | Value |
|---|---|
| Integrity | Medium (S-1-16-8192) |
| Elevation type | Default (Type 1) |
| User | The person signed in |
Suspicious
ws-042,
| Part | Value |
|---|---|
| Integrity | System (S-1-16-16384) |
| Elevation type | Default (Type 1) |
| User | NT AUTHORITY\ |
| ValueSYSTEM in a command prompt: a prompt a person opens runs as that person, not the machine account. Wrong Account | |
Look Inside
Why It Matters
The account decides what a process can reach. A system process under a person, or a person's tool running as SYSTEM in session 0, means something handed it that identity.
How to Confirm It
Work through these in order. Each step names the page that shows how.
- Read the account from the process token, live with Get-Process and its user name option. In a memory image windows.getsids lists the token's SIDs, its integrity level among them.Token and Privileges
- In event 4688 in the Security log, take the account from the Target Subject when it is filled, else from the Creator Subject. The Creator Subject alone gives services and elevated programs the wrong account.Process Trees and Call Chains
- Check the session. The SessionId from windows.pslist comes from the kernel, while windows.sessions reads environment values the process itself can change.Process Listings and Scans
- Find what gave it that identity, reading the parent chain, and for a new logon session the logon events on the machine.Process Trees and Call Chains
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 Subject and Target Subject, Token Elevation Type and Mandatory Label. The account is the Target Subject when filled.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. | User, IntegrityLevel and LogonId, which ties the process to the logon session it runs in.Process Trees and Call Chains shows how to read it. | Run Sysmon with ProcessCreate events in its configuration. |
| Device | AccountName, AccountSid, Process | The Defender for Endpoint sensor on the device |
15031 Elevation Approved (opens in a new tab)Microsoft-Windows-LUA, an event tracing provider rather than an event logIt is written on Windows 11 computers with Administrator protection on. | Administrator protection approved an elevation, so the elevated program runs as a hidden, system-generated account by design. | Turn on Administrator protection, and run a trace session for the Microsoft-Windows-LUA provider. |
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 |
|---|---|
Creator Subject: Security IDSYSTEM | The creator, PSEXESVC |
Target Subject: Account Name- | Empty, because the new process shares its creator's logon, so Windows records only the creator. The prompt therefore runs as SYSTEM too. |
Token Elevation Type%%1936 | TokenElevationTypeDefault, Default (Type 1), which SYSTEM and services run with. An administrator's prompt has it too with User Account Control off, so weigh the account. |
Mandatory LabelS-1-16-16384 | System integrity, the level of services. A prompt a person opens runs at Medium, or High when elevated, not at System. |
- False Positives
Per-user services run svchost.exe as the signed-in person under names such as CDPUserSvc_<LUID>, and Administrator protection runs elevated programs as a hidden, system-generated account.
Management agents, installers and scheduled tasks run shells as SYSTEM in session 0 every day, so judge them by their parent and their command.
- Blind Spots
A thread can work under another account's token while its process keeps its own, and Velociraptor's Windows.Detection.Impersonation finds such threads.
Without administrator rights a live tool may not read a SYSTEM process's owner, so an empty account is not a finding. Run the check elevated.
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. Agents and scheduled tasks start shells as SYSTEM too, so read the creator first. Per-user service hosts are left out, as running as the person is normal for them.
// Core processes running under a person's account, and shells running as SYSTEM in session 0DeviceProcessEvents| where Timestamp > ago( 30d)| extend Name = tolower( FileName)| where ( Name in ( "smss.exe", "csrss.exe", "wininit.exe", "winlogon.exe", "services.exe", "lsass.exe", "lsaiso.exe", "spoolsv.exe") and AccountSid != "S-1-5-18") or ( Name in ( "cmd.exe", "powershell.exe", "pwsh.exe") and AccountSid == "S-1-5-18" and CreatedProcessSessionId == 0)| project Timestamp, DeviceName, FileName, FolderPath, AccountName, AccountSid, ProcessIntegrityLevel, CreatedProcessSessionId, InitiatingProcessFileName, 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.getsids(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. getsids means get SIDs, the security IDs of accounts and groups. The SIDs in each token, S-1-5-18 for SYSTEM and a person's own SID for their programs, with the groups beside them.windows.(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. Each token's privileges and whether they are enabled. Debug rights switched on in a person's program need a reason.privileges 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. The session each process runs in, read from the kernel.windows.sessions(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. Session details read from environment variables, which the process itself can change, so a lead, never proof.
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 the PsExec and WMI route to a SYSTEM shell like the one on ws-042.
- Administrator protection (opens in a new tab) Admins work without admin rights, and each approved elevation runs as a hidden account whose token ends with the process.
- Audit Process Creation (opens in a new tab) Writes event 4688 in the Security log with the creator, the target account and the integrity level of every new process. Check it in the Registry: Advanced Audit Policy
Sources
- Microsoft Learn: 4688(S) A new process has been created (opens in a new tab)
- Microsoft Learn: LocalSystem account (opens in a new tab)
- Microsoft Learn: Per-user services in Windows (opens in a new tab)
- Microsoft Learn: Mandatory Integrity Control (standard users at medium, elevated users at high, services at system) (opens in a new tab)
- Microsoft Learn: Get-Process, Windows PowerShell 5.1 (the user name option needs an elevated session) (opens in a new tab)
- Microsoft Learn: Administrator protection (opens in a new tab)
- Velociraptor: Windows.Detection.Impersonation (opens in a new tab)
- Volatility 3: windows.getsids (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.
- T1134 (opens in a new tab) Access Token Manipulation
- T1134.002 (opens in a new tab) Access Token Manipulation: Create Process with Token