Detection rules › Elastic

Registry Modification via WMI StdRegProv

Source
github.com/elastic/protections-artifacts

Identifies registry modification using the Windows Management Instrumentation SrdRegProv provider. Adversaries may leverage WMI to modify system configuration via registry changes.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies registry modification using the Windows Management Instrumentation SrdRegProv provider. Adversaries may
leverage WMI to modify system configuration via registry changes.
"""
id = "325933f6-e0b9-4cd2-bc4f-a91d78f97f1d"
license = "Elastic License v2"
name = "Registry Modification via WMI StdRegProv"
os_list = ["windows"]
version = "1.0.8"

query = '''
api where
  process.Ext.api.name == "IWbemServices::ExecMethod" and user.id != "S-1-5-18" and
   process.Ext.api.parameters.operation : "*StdRegProv::SetStringValue*" and

   process.executable != "C:\\Program Files (x86)\\GreenwayTR\\GMTGC.exe" and

   not (process.code_signature.trusted == true and
        process.code_signature.subject_name in ("Reason Cybersecurity Inc.", "Micro-Star International CO., LTD.", "Lansweeper NV", "LANSWEEPER NV", "YANDEX LLC", "Beijing Sogou Technology Development Co., Ltd.", "HP Inc.", "95895A1E-217A-4242-9200-7E698391758E", "Omnissa, LLC", "Beijing Kingsoft Security software Co.,Ltd")) and
       
   not (process.executable == "C:\\Windows\\SysWOW64\\wscript.exe" and process.parent.executable == "C:\\Windows\\SysWOW64\\cmd.exe" and
        process.command_line in ("WSCRIPT /B parseXML.vbs base_agentdata.xml agentdata.xml", "WSCRIPT /B ae_scan.vbs agentdata")) and

  not (process.name : ("wscript.exe", "cscript.exe") and process.command_line : ("*\\\\*\\netlogon\\*", "\"C:\\Windows\\system32\\wscript.exe\" \"C:\\Program Files (x86)\\RoomSeeker\\DBChange.vbs\"")) and 

   not (process.executable == "C:\\Windows\\System32\\wscript.exe" and process.parent.executable == "C:\\Windows\\System32\\gpscript.exe") and

   not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe") and

   not process.executable : ("C:\\Windows\\System32\\cscript.exe",
                             "C:\\Windows\\SysWOW64\\cscript.exe",
                             "C:\\Windows\\System32\\msiexec.exe",
                             "C:\\Windows\\SysWOW64\\msiexec.exe",
                             "C:\\Program Files (x86)\\Sage\\*.exe") and
   not process.parent.executable : ("C:\\Program Files (x86)\\PCMatic\\PCPitstopScheduleService.exe",
                                    "C:\\Program Files (x86)\\Sage\\Sage 100\\9.0\\Shared\\OLStart.exe",
                                    "E:\\BELOFF_2O2O.O3L\\wpi\\WPI.exe")
'''

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

[[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 = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"


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

[internal]
min_endpoint_version = "8.15.0"

Stages and Predicates

Stage 1: api

api where
  process.Ext.api.name == "IWbemServices::ExecMethod" and user.id != "S-1-5-18" and
   process.Ext.api.parameters.operation : "*StdRegProv::SetStringValue*" and

   process.executable != "C:\\Program Files (x86)\\GreenwayTR\\GMTGC.exe" and

   not (process.code_signature.trusted == true and
        process.code_signature.subject_name in ("Reason Cybersecurity Inc.", "Micro-Star International CO., LTD.", "Lansweeper NV", "LANSWEEPER NV", "YANDEX LLC", "Beijing Sogou Technology Development Co., Ltd.", "HP Inc.", "95895A1E-217A-4242-9200-7E698391758E", "Omnissa, LLC", "Beijing Kingsoft Security software Co.,Ltd")) and
       
   not (process.executable == "C:\\Windows\\SysWOW64\\wscript.exe" and process.parent.executable == "C:\\Windows\\SysWOW64\\cmd.exe" and
        process.command_line in ("WSCRIPT /B parseXML.vbs base_agentdata.xml agentdata.xml", "WSCRIPT /B ae_scan.vbs agentdata")) and

  not (process.name : ("wscript.exe", "cscript.exe") and process.command_line : ("*\\\\*\\netlogon\\*", "\"C:\\Windows\\system32\\wscript.exe\" \"C:\\Program Files (x86)\\RoomSeeker\\DBChange.vbs\"")) and 

   not (process.executable == "C:\\Windows\\System32\\wscript.exe" and process.parent.executable == "C:\\Windows\\System32\\gpscript.exe") and

   not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe") and

   not process.executable : ("C:\\Windows\\System32\\cscript.exe",
                             "C:\\Windows\\SysWOW64\\cscript.exe",
                             "C:\\Windows\\System32\\msiexec.exe",
                             "C:\\Windows\\SysWOW64\\msiexec.exe",
                             "C:\\Program Files (x86)\\Sage\\*.exe") and
   not process.parent.executable : ("C:\\Program Files (x86)\\PCMatic\\PCPitstopScheduleService.exe",
                                    "C:\\Program Files (x86)\\Sage\\Sage 100\\9.0\\Shared\\OLStart.exe",
                                    "E:\\BELOFF_2O2O.O3L\\wpi\\WPI.exe")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_namein95895A1E-217A-4242-9200-7E698391758E, Beijing Kingsoft Security software Co.,Ltd, Beijing Sogou Technology Development Co., Ltd., HP Inc., LANSWEEPER NV, Lansweeper NV, Micro-Star International CO., LTD., Omnissa, LLC, Reason Cybersecurity Inc., YANDEX LLCexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.command_lineinWSCRIPT /B ae_scan.vbs agentdata, WSCRIPT /B parseXML.vbs base_agentdata.xml agentdata.xmlexcludes:process.command_line field:"process.command_line" value:"WSCRIPT /B ae_scan.vbs agentdata" field:"process.command_line" value:"WSCRIPT /B parseXML.vbs base_agentdata.xml agentdata.xml"
process.executableeqC:\Windows\SysWOW64\wscript.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\SysWOW64\wscript.exe"
process.parent.executableeqC:\Windows\SysWOW64\cmd.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\SysWOW64\cmd.exe"
process.command_linewildcard*\\*\netlogon\*, "C:\Windows\system32\wscript.exe" "C:\Program Files (x86)\RoomSeeker\DBChange.vbs"excludes:process.command_line
process.nameeqwscript.exe, cscript.exeexcludes:process.name field:"process.name" value:"wscript.exe" field:"process.name" value:"cscript.exe"
process.executableeqC:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\svchost.exe"
process.parent.executableeqC:\Windows\System32\services.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\services.exe"
process.executableeqC:\Windows\System32\wscript.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\wscript.exe"
process.parent.executableeqC:\Windows\System32\gpscript.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\gpscript.exe"
process.executablewildcardC:\Windows\System32\cscript.exe, C:\Windows\SysWOW64\cscript.exe, C:\Windows\System32\msiexec.exe, C:\Windows\SysWOW64\msiexec.exe, C:\Program Files (x86)\Sage\*.exeexcludes:process.executable
process.parent.executableeqC:\Program Files (x86)\PCMatic\PCPitstopScheduleService.exe, C:\Program Files (x86)\Sage\Sage 100\9.0\Shared\OLStart.exe, E:\BELOFF_2O2O.O3L\wpi\WPI.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\PCMatic\PCPitstopScheduleService.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\Sage\Sage 100\9.0\Shared\OLStart.exe" field:"process.parent.executable" value:"E:\BELOFF_2O2O.O3L\wpi\WPI.exe"

Indicators

These rows show field, operator, and value matches.