T1134.004 Elastic Security · Elastic

Detect Parent PID Spoofing in Elastic Security

Adversaries may spoof the parent process identifier (PPID) of a new process to evade process-monitoring defenses or to elevate privileges. By calling CreateProcess with a PROC_THREAD_ATTRIBUTE_PARENT_PROCESS entry in the process attribute list, an attacker can assign any running process as the apparent parent of the newly spawned child. Security tools that rely on parent-child process lineage for detection see only the spoofed parent, masking the true origin. This technique is also exploited for privilege escalation: by opening a handle to a SYSTEM-level process such as lsass.exe and using it as the spoofed parent, the child process inherits the SYSTEM access token. Used in the wild by Cobalt Strike, KONNI, PipeMon, and DarkGate.

MITRE ATT&CK

Tactic
Defense Evasion Privilege Escalation
Technique
T1134 Access Token Manipulation
Sub-technique
T1134.004 Parent PID Spoofing
Canonical reference
https://attack.mitre.org/techniques/T1134/004/

Elastic Detection Query

Elastic Security (Elastic)
eql
sequence by host.id with maxspan=5s
[
  // Branch 1: High-privilege system process spawning suspicious child tools
  process where event.type == "start" and
  process.parent.name in~ ("lsass.exe", "wininit.exe", "smss.exe", "csrss.exe", "winlogon.exe", "services.exe") and
  process.name in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "rundll32.exe", "regsvr32.exe",
                    "mshta.exe", "wscript.exe", "cscript.exe", "msbuild.exe", "certutil.exe",
                    "bitsadmin.exe", "cmstp.exe", "installutil.exe")
] by process.parent.pid

// Standalone query for all three branches (use as separate search)
/*
process where event.type == "start" and
(
  // Branch 1: Spoofed high-value parent spawning LOLBin/shell
  (
    process.parent.name in~ ("lsass.exe", "wininit.exe", "smss.exe", "csrss.exe", "winlogon.exe", "services.exe") and
    process.name in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "rundll32.exe", "regsvr32.exe",
                      "mshta.exe", "wscript.exe", "cscript.exe", "msbuild.exe", "certutil.exe",
                      "bitsadmin.exe", "cmstp.exe", "installutil.exe")
  ) or
  // Branch 2: SYSTEM integrity child from non-SYSTEM integrity parent
  (
    process.token.integrity_level_name == "system" and
    process.parent.token.integrity_level_name in ("medium", "low", "high") and
    process.name in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "rundll32.exe", "regsvr32.exe",
                      "mshta.exe", "wscript.exe", "cscript.exe", "msbuild.exe", "certutil.exe",
                      "bitsadmin.exe", "cmstp.exe", "installutil.exe")
  ) or
  // Branch 3: explorer.exe parent of a SYSTEM-integrity process
  (
    process.parent.name =~ "explorer.exe" and
    process.token.integrity_level_name == "system"
  )
)
*/
high severity high confidence

Detects Parent PID Spoofing (T1134.004) via three branches: (1) impossible parent-child relationships where protected system processes (lsass, wininit, smss, csrss, winlogon, services) appear to spawn LOLBins or shells — these processes never legitimately create interactive children; (2) integrity level mismatch where a SYSTEM-token child process is parented by a Medium/Low/High integrity process, indicating token inheritance via spoofed PROC_THREAD_ATTRIBUTE_PARENT_PROCESS handle; (3) explorer.exe parenting a SYSTEM-integrity process, which cannot occur in normal Windows operation.

Data Sources

EndpointWindows Process Telemetry

Required Tables

logs-endpoint.events.process-*winlogbeat-*

False Positives & Tuning

  • Legitimate security tools or EDR agents that use CreateProcess with explicit parent handles for process injection monitoring or sandboxing may trigger Branch 2 integrity mismatch alerts
  • Windows system updates and patching tools (Windows Update, SCCM/MECM) occasionally spawn elevated child processes in ways that may produce anomalous parent-child telemetry, particularly during component servicing
  • Virtualization or containerization software (Hyper-V, Docker Desktop) may produce unusual process lineage that resembles integrity mismatches due to their privileged operation model
Download portable Sigma rule (.yml)

Other platforms for T1134.004


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1PPID Spoofing via PowerShell P/Invoke — Explorer Parent

    Expected signal: Sysmon Event ID 1: cmd.exe process creation with ParentImage=<path>\explorer.exe and ParentProcessId matching the selected explorer.exe PID. The actual spawning process (PowerShell) does NOT appear as ParentImage. Sysmon Event ID 10: may capture OpenProcess against explorer.exe from PowerShell with GrantedAccess=0x0080. Security Event ID 4688 (if audit enabled): CreatorProcessId=PowerShell's PID, ParentProcessId=explorer.exe's PID — the mismatch confirms spoofing.

  2. Test 2PPID Spoofing for Privilege Escalation — LSASS as Spoofed Parent

    Expected signal: Sysmon Event ID 1: cmd.exe with ParentImage=lsass.exe, ParentProcessId=LSASS PID, IntegrityLevel=System. Sysmon Event ID 10: SourceImage=PowerShell accessing TargetImage=lsass.exe with GrantedAccess=0x0080. Security Event ID 4672: Special privilege logon for the SYSTEM session inherited by cmd.exe. Security Event ID 4688 (if audit enabled): CreatorProcessId=PowerShell PID vs ParentProcessId=LSASS PID — mismatch is the definitive forensic artifact.

  3. Test 3Cobalt Strike Spawn-To Simulation — Rundll32 Under Explorer

    Expected signal: Sysmon Event ID 1: rundll32.exe creation with ParentImage=explorer.exe and ParentProcessId matching the selected explorer.exe PID. Sysmon Event ID 10: OpenProcess from PowerShell against explorer.exe with GrantedAccess=0x0080. The rundll32.exe -> explorer.exe parent relationship is the canonical Cobalt Strike PPID spoofing telemetry signature seen in real incident response engagements.

  4. Test 4PPID Spoofing Detection Validation — Sysmon ParentProcessId vs Security 4688 CreatorProcessId

    Expected signal: Sysmon Event ID 1: cmd.exe with ParentImage=svchost.exe, ParentProcessId=<svchost PID>. Security Event ID 4688 (requires audit process creation + command line enabled): CreatorProcessId=<PowerShell PID>, ParentProcessId=<svchost PID> — the mismatch between Creator and Parent is the definitive PPID spoof indicator. The test outputs exact PID values needed for manual SIEM correlation to confirm the discrepancy is visible in your environment.

Unlock Pro Content

Get the full detection package for T1134.004 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections