Detection rules › Elastic
Windows Script Execution via MMC Console File
Identifies attempts to execute a Windows script via a malicious Microsoft Management Console File. Adversaries may use MSC files for execution and evasion.
MITRE ATT&CK coverage
Rule body
[rule]
description = """
Identifies attempts to execute a Windows script via a malicious Microsoft Management Console File. Adversaries may use
MSC files for execution and evasion.
"""
id = "5b5926cf-03ad-476b-959c-a0d15cd1efe0"
license = "Elastic License v2"
name = "Windows Script Execution via MMC Console File"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/grimresource"]
version = "1.0.4"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
process.executable : "?:\\Windows\\System32\\mmc.exe" and process.args : "*.msc" and
not process.args : ("?:\\Windows\\System32\\*.msc", "?:\\Windows\\SysWOW64\\*.msc", "?:\\Program files\\*.msc", "?:\\Program Files (x86)\\*.msc") and
not process.parent.executable : ("C:\\Windows\\System32\\ServerManager.exe", "C:\\Program Files (x86)\\Citrix\\System32\\wfshell.exe") and
not (process.working_directory : "C:\\Windows\\system32\\" and process.command_line : "\"C:\\Windows\\System32\\mmc.exe\" rrasmgmt.msc") and
not process.parent.executable : "C:\\Program Files\\Devolutions\\Remote Desktop Manager\\RemoteDesktopManager.exe"
]
[file where event.action in ("creation", "overwrite") and
process.executable : "?:\\Windows\\System32\\mmc.exe" and
file.path : "?:\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*"]
'''
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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"
[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"
[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.014"
name = "MMC"
reference = "https://attack.mitre.org/techniques/T1218/014/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
process.executable : "?:\\Windows\\System32\\mmc.exe" and process.args : "*.msc" and
not process.args : ("?:\\Windows\\System32\\*.msc", "?:\\Windows\\SysWOW64\\*.msc", "?:\\Program files\\*.msc", "?:\\Program Files (x86)\\*.msc") and
not process.parent.executable : ("C:\\Windows\\System32\\ServerManager.exe", "C:\\Program Files (x86)\\Citrix\\System32\\wfshell.exe") and
not (process.working_directory : "C:\\Windows\\system32\\" and process.command_line : "\"C:\\Windows\\System32\\mmc.exe\" rrasmgmt.msc") and
not process.parent.executable : "C:\\Program Files\\Devolutions\\Remote Desktop Manager\\RemoteDesktopManager.exe"
]
Stage 2: file
[file where event.action in ("creation", "overwrite") and
process.executable : "?:\\Windows\\System32\\mmc.exe" and
file.path : "?:\\Users\\*\\AppData\\Local\\Microsoft\\Windows\\INetCache\\IE\\*"]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | eq | "C:\Windows\System32\mmc.exe" rrasmgmt.msc | excludes:process.command_line |
process.working_directory | eq | C:\Windows\system32\ | excludes:process.working_directory field:"process.working_directory" value:"C:\Windows\system32\" |
process.args | wildcard | ?:\Windows\System32\*.msc, ?:\Windows\SysWOW64\*.msc, ?:\Program files\*.msc, ?:\Program Files (x86)\*.msc | excludes:process.args |
process.parent.executable | eq | C:\Program Files\Devolutions\Remote Desktop Manager\RemoteDesktopManager.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\Devolutions\Remote Desktop Manager\RemoteDesktopManager.exe" |
process.parent.executable | eq | C:\Windows\System32\ServerManager.exe, C:\Program Files (x86)\Citrix\System32\wfshell.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\ServerManager.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\Citrix\System32\wfshell.exe" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event.action | in |
| field:"EventType" kind:in |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"?:\Users\*\AppData\Local\Microsoft\Windows\INetCache\IE\*" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"*.msc" |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"?:\Windows\System32\mmc.exe" |