Detection rules › Elastic
Regsvr32 Scriptlet Execution
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
| Tactic | Techniques |
|---|---|
| Stealth |
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.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | match | scrobj.dll | excludes:process.command_line field:"process.command_line" value:"scrobj.dll" |
process.Ext.token.integrity_level_name | eq | system | excludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system" |
process.parent.executable | eq | ?:\Windows\SysWOW64\msiexec.exe, ?:\Windows\system32\msiexec.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\SysWOW64\msiexec.exe" field:"process.parent.executable" value:"?:\Windows\system32\msiexec.exe" |
process.command_line | match | :\Program Files\, :\Program Files (x86)\ | excludes:process.command_line field:"process.command_line" value:":\Program Files\" field:"process.command_line" value:":\Program Files (x86)\" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_name" kind:wildcard value:"regsvr32.exe" |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"regsvr32.exe" |