Detection rules › Elastic

Regsvr32 Scriptlet Execution

Source
github.com/elastic/protections-artifacts

Identifies the native Windows tool, regsvr32.exe, executing a scriptlet file. This can allow an attacker to bypass whitelisting and run arbitrary scripts.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the native Windows tool, regsvr32.exe, executing a scriptlet file. This can allow an attacker to bypass
whitelisting and run arbitrary scripts.
"""
id = "0524c24c-e45e-4220-b21a-abdba0c46c4d"
license = "Elastic License v2"
name = "Regsvr32 Scriptlet Execution"
os_list = ["windows"]
version = "1.0.32"

query = '''
process where event.action == "start" and
 (process.pe.original_file_name : "regsvr32.exe" or process.name : "regsvr32.exe") and
  (
    (process.command_line : "*scrobj*" and process.command_line : ("* /i:*", "* -i:*", "*.sct*")) or
      /* attackers may rename scrobj.dll */
      (
        process.command_line : "* /u*" and
        process.command_line :
          (
            "* /i:C:\\*",
            "* /i:\"C:\\*",
            "* -i:C:\\*",
            "* -i:\"C:\\*",
            "* /i:*http*",
            "* -i:*http*"
          )
      )
  ) and
  /* Issue #326 */
  not (process.Ext.token.integrity_level_name == "system" and not process.command_line : "*scrobj.dll*") and
  not process.command_line : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*") and
  not (process.parent.executable : ("?:\\Windows\\SysWOW64\\msiexec.exe", "?:\\Windows\\system32\\msiexec.exe") and
      not process.command_line : "*scrobj.dll*")
'''

min_endpoint_version = "7.15.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 = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 (process.pe.original_file_name : "regsvr32.exe" or process.name : "regsvr32.exe") and
  (
    (process.command_line : "*scrobj*" and process.command_line : ("* /i:*", "* -i:*", "*.sct*")) or
      (
        process.command_line : "* /u*" and
        process.command_line :
          (
            "* /i:C:\\*",
            "* /i:\"C:\\*",
            "* -i:C:\\*",
            "* -i:\"C:\\*",
            "* /i:*http*",
            "* -i:*http*"
          )
      )
  ) and
  not (process.Ext.token.integrity_level_name == "system" and not process.command_line : "*scrobj.dll*") and
  not process.command_line : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*") and
  not (process.parent.executable : ("?:\\Windows\\SysWOW64\\msiexec.exe", "?:\\Windows\\system32\\msiexec.exe") and
      not process.command_line : "*scrobj.dll*")

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • * -i:"C:\*
  • * -i:* corpus 2 (sigma 1, elastic 1)
  • * -i:*http*
  • * -i:C:\*
  • * /i:"C:\*
  • * /i:*
  • * /i:*http*
  • * /i:C:\*
  • * /u*
  • *.sct* corpus 2 (sigma 1, elastic 1)
  • *scrobj* corpus 2 (elastic 1, splunk 1)
  • *scrobj.dll* corpus 2 (sigma 1, elastic 1)
field:"CommandLine" kind:wildcard
process.namewildcard
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
field:"process_name" kind:wildcard value:"regsvr32.exe"
process.pe.original_file_namewildcard
  • regsvr32.exe corpus 37 (sigma 17, elastic 15, splunk 5)
field:"OriginalFileName" kind:wildcard value:"regsvr32.exe"