Execution via a Suspicious WMI Client


Description

Identifies the execution of a process via Windows Management Instrumentation (WMI) and with an unusual effective parent. Adversaries may abuse Windows Management Instrumentation (WMI) to execute malicious commands and payloads.

Query · eql

process where event.action == "start" and
  process.parent.name :"WmiPrvSE.exe" and
   (
    process.Ext.effective_parent.name : ("excel.exe", "powerpnt.exe", "winword.exe", "mshta.exe",
                                         "wscript.exe", "rundll32.exe", "regsvr32.exe",
                                         "msbuild.exe", "InstallUtil.exe") or
    process.Ext.effective_parent.executable : ("?:\\Users\\Public\\*", "?:\\ProgramData\\*", "?:\\Users\\*\\AppData\\*", "?:\\Windows\\Microsoft.NET\\*")
    ) and 
  not (user.id : "S-1-5-18" and process.name : "powershell.exe") and
  not process.hash.sha256 : 
             ("0e692d9d3342fdcab1ce3d61aed0520989a94371e5898edb266c92f1fe11c97f", 
              "8ee339af3ce1287066881147557dc3b57d1835cbba56b2457663068ed25b7840", 
              "f27cb78f44fc8f70606be883bbed705bd1dd2c2f8a84a596e5f4924e19068f22") and
  not (process.name : "powershell.exe" and process.args : "C:\\Windows\\TEMP\\RestartHealthService.ps1" and
       process.args : "60" and process.args : "1" and
       not process.Ext.effective_parent.name : ("excel.exe", "powerpnt.exe", "winword.exe")) and

  not (process.code_signature.subject_name : ("Immense Networks LLC", "Synology Inc.", "Xerox Corporation", "Beijing Qihu Technology Co., Ltd.") and
       process.code_signature.trusted == true) and

  not (process.args : "?:\\Windows\\TEMP\\RestartHealthService.js" and process.args : "60" and user.id : "S-1-5-18" and
       process.Ext.effective_parent.name : "cscript.exe") and

  /* ansible */
  not (process.name : "powershell.exe" and
       process.command_line : "*CgAgACAAIAAgAHQAcgBhAHAAIAB7AAoAIAAgACAAIAAgACAAIAAgACQAdwByAGEAcABwAGUAcgBfAHAAYQB0AGgAIAA9ACAAIgAkACgAJABlAG4AdgA6AFQARQBNAFAAKQBcAGEAbgBzAGkAYgBsAGUALQBhAHMAeQBuAGMALQB3AHIAYQBwAHAAZQByAC0AZ*") and

  not (process.name : "powershell.exe" and
       process.command_line : ("powershell.exe -WindowStyle \"Hidden\" -Command \"Enable-PSRemoting -Force\"",
                               "powershell.exe -WindowStyle \"Hidden\" -Command \"Set-WSManQuickConfig -Force\"",
                               "powershell.exe -WindowStyle \"Hidden\" -Command \"WinRM QuickConfig -Quiet -Force\"")) and
  not process.executable :
             ("?:\\Windows\\System32\\WerFault.exe",
              "?:\\Windows\\SysWOW64\\WerFault.exe",
              "?:\\Windows\\System32\\typeperf.exe",
              "?:\\Program Files*\\Adobe\\Acrobat DC\\Acrobat\\AcroTray.exe",
              "?:\\Program Files*\\Google\\Chrome\\Application\\chrome.exe",
              "?:\\Program Files*\\Mozilla Firefox\\firefox.exe",
              "\\Device\\Mup\\*.exe") and
  not (process.name : "cmd.exe" and
       process.args : ("\\\\*\\netlogon\\logon.cmd",
                       "?:\\ProgramData\\Package Cache\" %a in (cybereasonsensor.exe)*",
                       "(x86)\\EOG\\iFileMenu\\iFileMenu.bat"))
Raw source Execution via a Suspicious WMI Client · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Identifies the execution of a process via Windows Management Instrumentation (WMI) and with an unusual effective parent.
Adversaries may abuse Windows Management Instrumentation (WMI) to execute malicious commands and payloads.
"""
id = "b0a0d293-f85e-4994-97e6-95541c0bc181"
license = "Elastic License v2"
name = "Execution via a Suspicious WMI Client"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/spring-cleaning-with-latrodectus"]
version = "1.0.33"

query = '''
process where event.action == "start" and
  process.parent.name :"WmiPrvSE.exe" and
   (
    process.Ext.effective_parent.name : ("excel.exe", "powerpnt.exe", "winword.exe", "mshta.exe",
                                         "wscript.exe", "rundll32.exe", "regsvr32.exe",
                                         "msbuild.exe", "InstallUtil.exe") or
    process.Ext.effective_parent.executable : ("?:\\Users\\Public\\*", "?:\\ProgramData\\*", "?:\\Users\\*\\AppData\\*", "?:\\Windows\\Microsoft.NET\\*")
    ) and 
  not (user.id : "S-1-5-18" and process.name : "powershell.exe") and
  not process.hash.sha256 : 
             ("0e692d9d3342fdcab1ce3d61aed0520989a94371e5898edb266c92f1fe11c97f", 
              "8ee339af3ce1287066881147557dc3b57d1835cbba56b2457663068ed25b7840", 
              "f27cb78f44fc8f70606be883bbed705bd1dd2c2f8a84a596e5f4924e19068f22") and
  not (process.name : "powershell.exe" and process.args : "C:\\Windows\\TEMP\\RestartHealthService.ps1" and
       process.args : "60" and process.args : "1" and
       not process.Ext.effective_parent.name : ("excel.exe", "powerpnt.exe", "winword.exe")) and

  not (process.code_signature.subject_name : ("Immense Networks LLC", "Synology Inc.", "Xerox Corporation", "Beijing Qihu Technology Co., Ltd.") and
       process.code_signature.trusted == true) and

  not (process.args : "?:\\Windows\\TEMP\\RestartHealthService.js" and process.args : "60" and user.id : "S-1-5-18" and
       process.Ext.effective_parent.name : "cscript.exe") and

  /* ansible */
  not (process.name : "powershell.exe" and
       process.command_line : "*CgAgACAAIAAgAHQAcgBhAHAAIAB7AAoAIAAgACAAIAAgACAAIAAgACQAdwByAGEAcABwAGUAcgBfAHAAYQB0AGgAIAA9ACAAIgAkACgAJABlAG4AdgA6AFQARQBNAFAAKQBcAGEAbgBzAGkAYgBsAGUALQBhAHMAeQBuAGMALQB3AHIAYQBwAHAAZQByAC0AZ*") and

  not (process.name : "powershell.exe" and
       process.command_line : ("powershell.exe -WindowStyle \"Hidden\" -Command \"Enable-PSRemoting -Force\"",
                               "powershell.exe -WindowStyle \"Hidden\" -Command \"Set-WSManQuickConfig -Force\"",
                               "powershell.exe -WindowStyle \"Hidden\" -Command \"WinRM QuickConfig -Quiet -Force\"")) and
  not process.executable :
             ("?:\\Windows\\System32\\WerFault.exe",
              "?:\\Windows\\SysWOW64\\WerFault.exe",
              "?:\\Windows\\System32\\typeperf.exe",
              "?:\\Program Files*\\Adobe\\Acrobat DC\\Acrobat\\AcroTray.exe",
              "?:\\Program Files*\\Google\\Chrome\\Application\\chrome.exe",
              "?:\\Program Files*\\Mozilla Firefox\\firefox.exe",
              "\\Device\\Mup\\*.exe") and
  not (process.name : "cmd.exe" and
       process.args : ("\\\\*\\netlogon\\logon.cmd",
                       "?:\\ProgramData\\Package Cache\" %a in (cybereasonsensor.exe)*",
                       "(x86)\\EOG\\iFileMenu\\iFileMenu.bat"))
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"



[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1047"
name = "Windows Management Instrumentation"
reference = "https://attack.mitre.org/techniques/T1047/"


[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.004"
name = "InstallUtil"
reference = "https://attack.mitre.org/techniques/T1218/004/"

[[threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"

[[threat.technique.subtechnique]]
id = "T1218.009"
name = "Regsvcs/Regasm"
reference = "https://attack.mitre.org/techniques/T1218/009/"

[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"

[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



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

[internal]
min_endpoint_version = "8.4.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.