Privileges Elevation via Parent Process PID Spoofing

Identifies parent process spoofing used to create an elevated child process. Adversaries may spoof the parent process identifier (PPID) of a new process to evade process-monitoring defenses or to elevate privileges.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/10/20"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies parent process spoofing used to create an elevated child process. Adversaries may spoof the parent process
 11identifier (PPID) of a new process to evade process-monitoring defenses or to elevate privileges.
 12"""
 13from = "now-9m"
 14index = ["logs-endpoint.events.process-*"]
 15language = "eql"
 16license = "Elastic License v2"
 17name = "Privileges Elevation via Parent Process PID Spoofing"
 18references = [
 19    "https://gist.github.com/xpn/a057a26ec81e736518ee50848b9c2cd6",
 20    "https://blog.didierstevens.com/2017/03/20/",
 21    "https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthreadattribute",
 22    "https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1134.002/T1134.002.md",
 23]
 24risk_score = 73
 25rule_id = "26b01043-4f04-4d2f-882a-5a1d2e95751b"
 26severity = "high"
 27tags = [
 28    "Domain: Endpoint",
 29    "OS: Windows",
 30    "Use Case: Threat Detection",
 31    "Tactic: Privilege Escalation",
 32    "Data Source: Elastic Defend",
 33]
 34timestamp_override = "event.ingested"
 35type = "eql"
 36
 37query = '''
 38/* This rule is compatible with Elastic Endpoint only */
 39
 40process where host.os.type == "windows" and event.action == "start" and
 41
 42 /* process creation via seclogon */
 43 process.parent.Ext.real.pid > 0 and
 44
 45 /* PrivEsc to SYSTEM */
 46 user.id : "S-1-5-18"  and
 47
 48 /* Common FPs - evasion via hollowing is possible, should be covered by code injection */
 49 not process.executable : ("?:\\Windows\\System32\\WerFault.exe",
 50                           "?:\\Windows\\SysWOW64\\WerFault.exe",
 51                           "?:\\Windows\\System32\\WerFaultSecure.exe",
 52                           "?:\\Windows\\SysWOW64\\WerFaultSecure.exe",
 53                           "?:\\Windows\\System32\\Wermgr.exe",
 54                           "?:\\Windows\\SysWOW64\\Wermgr.exe",
 55                           "?:\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe") and
 56 /* Logon Utilities */
 57 not (process.parent.executable : "?:\\Windows\\System32\\Utilman.exe" and
 58     process.executable : ("?:\\Windows\\System32\\osk.exe",
 59                           "?:\\Windows\\System32\\Narrator.exe",
 60                           "?:\\Windows\\System32\\Magnify.exe")) and
 61
 62 not process.parent.executable : "?:\\Windows\\System32\\AtBroker.exe" and
 63
 64 not (process.code_signature.subject_name in
 65           ("philandro Software GmbH", "Freedom Scientific Inc.", "TeamViewer Germany GmbH", "Projector.is, Inc.",
 66            "TeamViewer GmbH", "Cisco WebEx LLC", "Dell Inc") and process.code_signature.trusted == true) and 
 67
 68 /* AM_Delta_Patch Windows Update */
 69 not (process.executable : ("?:\\Windows\\System32\\MpSigStub.exe", "?:\\Windows\\SysWOW64\\MpSigStub.exe") and
 70      process.parent.executable : ("?:\\Windows\\System32\\wuauclt.exe", 
 71                                   "?:\\Windows\\SysWOW64\\wuauclt.exe", 
 72                                   "?:\\Windows\\UUS\\Packages\\Preview\\*\\wuaucltcore.exe", 
 73                                   "?:\\Windows\\UUS\\amd64\\wuauclt.exe", 
 74                                   "?:\\Windows\\UUS\\amd64\\wuaucltcore.exe", 
 75                                   "?:\\ProgramData\\Microsoft\\Windows\\UUS\\*\\wuaucltcore.exe")) and
 76 not (process.executable : ("?:\\Windows\\System32\\MpSigStub.exe", "?:\\Windows\\SysWOW64\\MpSigStub.exe") and process.parent.executable == null) and
 77
 78 /* Other third party SW */
 79 not process.parent.executable :
 80                   ("?:\\Program Files (x86)\\HEAT Software\\HEAT Remote\\HEATRemoteServer.exe",
 81                    "?:\\Program Files (x86)\\VisualCron\\VisualCronService.exe",
 82                    "?:\\Program Files\\BinaryDefense\\Vision\\Agent\\bds-vision-agent-app.exe",
 83                    "?:\\Program Files\\Tablet\\Wacom\\WacomHost.exe",
 84                    "?:\\Program Files (x86)\\LogMeIn\\x64\\LogMeIn.exe",
 85                    "?:\\Program Files (x86)\\EMC Captiva\\Captiva Cloud Runtime\\Emc.Captiva.WebCaptureRunner.exe",
 86                    "?:\\Program Files\\Freedom Scientific\\*.exe",
 87                    "?:\\Program Files (x86)\\Google\\Chrome Remote Desktop\\*\\remoting_host.exe",
 88                    "?:\\Program Files (x86)\\GoToAssist Remote Support Customer\\*\\g2ax_comm_customer.exe") and
 89 not (
 90    process.code_signature.trusted == true and process.code_signature.subject_name == "Netwrix Corporation" and
 91    process.name : "adcrcpy.exe" and process.parent.executable : (
 92      "?:\\Program Files (x86)\\Netwrix Auditor\\Active Directory Auditing\\Netwrix.ADA.EventCollector.exe",
 93      "?:\\Program Files (x86)\\Netwrix Auditor\\Active Directory Auditing\\Netwrix.ADA.Analyzer.exe",
 94      "?:\\Netwrix Auditor\\Active Directory Auditing\\Netwrix.ADA.EventCollector.exe"
 95    )
 96 )
 97'''
 98
 99
100[[rule.threat]]
101framework = "MITRE ATT&CK"
102[[rule.threat.technique]]
103id = "T1134"
104name = "Access Token Manipulation"
105reference = "https://attack.mitre.org/techniques/T1134/"
106[[rule.threat.technique.subtechnique]]
107id = "T1134.002"
108name = "Create Process with Token"
109reference = "https://attack.mitre.org/techniques/T1134/002/"
110
111[[rule.threat.technique.subtechnique]]
112id = "T1134.004"
113name = "Parent PID Spoofing"
114reference = "https://attack.mitre.org/techniques/T1134/004/"
115
116
117
118[rule.threat.tactic]
119id = "TA0004"
120name = "Privilege Escalation"
121reference = "https://attack.mitre.org/tactics/TA0004/"

References

Related rules

to-top