[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"