Detection rules › Elastic

Potential Privilege Escalation via RoguePlanet Windows Defender Exploit

Source
github.com/elastic/protections-artifacts

Identifies attempts to plant a rogue wermgr.exe binary that overwrites the legitimate Windows Error Reporting Manager by exploiting a race condition in Windows Defender custom scanning. The planted file is a ZIP archive (PK header) masquerading as a PE executable. Successful exploitation can result in arbitrary code execution as SYSTEM.

MITRE ATT&CK coverage

TacticTechniques
Privilege Escalation
Stealth
Defense Impairment

Rule body

[rule]
description = """
Identifies attempts to plant a rogue wermgr.exe binary that overwrites the legitimate Windows Error Reporting Manager by
exploiting a race condition in Windows Defender custom scanning. The planted file is a ZIP archive (PK header)
masquerading as a PE executable. Successful exploitation can result in arbitrary code execution as SYSTEM.
"""
id = "15a93e0a-92f8-4c79-9e51-b55ce5e7aede"
license = "Elastic License v2"
name = "Potential Privilege Escalation via RoguePlanet Windows Defender Exploit"
os_list = ["windows"]
reference = ["https://github.com/MSNightmare/RoguePlanet"]
version = "1.0.0"

query = '''
any where (
  (event.category == "file" and event.action == "creation" and file.name : "wermgr.exe" and
   file.Ext.header_bytes like "504b*" and file.path : ("?:\\Users\\*.exe", "?:\\Windows\\Temp\\*.exe")) or

  (event.category == "process" and event.action == "start" and process.executable : "?:\\Windows\\System32\\wermgr.exe" and
   user.id == "S-1-5-18" and process.args == "-upload" and
   process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and 
   (process.Ext.relative_file_creation_time <= 10000 or process.Ext.relative_file_name_modify_time <= 10000) and 
   not (process.code_signature.status in ("trusted", "errorExpired") and 
        process.code_signature.subject_name : ("Microsoft Windows", "Microsoft Corporation", "Microsoft Windows Publisher")))
  )
'''

min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"


[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"

[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: any

any where (
  (event.category == "file" and event.action == "creation" and file.name : "wermgr.exe" and
   file.Ext.header_bytes like "504b*" and file.path : ("?:\\Users\\*.exe", "?:\\Windows\\Temp\\*.exe")) or

  (event.category == "process" and event.action == "start" and process.executable : "?:\\Windows\\System32\\wermgr.exe" and
   user.id == "S-1-5-18" and process.args == "-upload" and
   process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and 
   (process.Ext.relative_file_creation_time <= 10000 or process.Ext.relative_file_name_modify_time <= 10000) and 
   not (process.code_signature.status in ("trusted", "errorExpired") and 
        process.code_signature.subject_name : ("Microsoft Windows", "Microsoft Corporation", "Microsoft Windows Publisher")))
  )

Indicators

These rows show field, operator, and value matches.