Detection rules › Elastic

Inhibit System Recovery Followed by a Suspicious File Rename

Time window
5s
Source
github.com/elastic/protections-artifacts

Identifies the execution of Windows utilities to tamper with system recovery settings and subsequently followed by a suspicious file rename operation. This may indicate Ransomware behavior.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of Windows utilities to tamper with system recovery settings and subsequently followed by a
suspicious file rename operation. This may indicate Ransomware behavior.
"""
id = "92f114fb-7113-4e82-b021-6c2c4ca0a507"
license = "Elastic License v2"
name = "Inhibit System Recovery Followed by a Suspicious File Rename"
os_list = ["windows"]
version = "1.0.31"

query = '''
sequence with maxspan=5s
 [process where event.action == "start" and
  (
    (process.pe.original_file_name == "wmic.exe" and process.command_line : "*shadowcopy*" and process.command_line : "*delete*") or
    (process.pe.original_file_name == "VSSADMIN.EXE" and process.command_line : "*shadows*" and process.command_line : ("*delete*", "*resize*")) or
    (process.pe.original_file_name == "bcdedit.exe" and process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*")) or
    (process.pe.original_file_name == "WBADMIN.EXE" and process.command_line : ("*catalog*", "*systemstatebackup*") and process.command_line : "*delete*") or
    (process.pe.original_file_name == "iCACLS.EXE" and process.command_line : ("*/deny*S-1-1-0*", "*?:\\*\" /grant*Everyone:F*"))
  ) and
  not (process.name : "bcdedit.exe" and process.parent.executable : "?:\\Program Files (x86)\\Faronics\\Deep Freeze\\Install C-0\\DFServ.exe")]
 [file where event.action : "rename" and process.pid != 4 and
  file.extension != null and file.Ext.entropy >= 7 and
  file.Ext.original.name : ("*.jpg", "*.bmp", "*.png", "*.pdf", "*.doc", "*.docx", "*.xls", "*.xlsx", "*.ppt", "*.pptx") and
  not file.extension : ("tmp", "~tmp", "diff", "gz", "download", "bak", "bck", "lnk", "part", "save", "url") and
  not (process.name : "msiexec.exe" and file.path : "?:\\Config.Msi\\*.rbf") and
  not process.executable : ("?:\\Program Files\\Microsoft OneDrive\\OneDrive.exe",
                            "?:\\Program Files\\Fiery\\Components\\Fiery XF\\Job Editor.exe",
                            "?:\\Windows\\explorer.exe")]
'''

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

[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1486"
name = "Data Encrypted for Impact"
reference = "https://attack.mitre.org/techniques/T1486/"

[[threat.technique]]
id = "T1490"
name = "Inhibit System Recovery"
reference = "https://attack.mitre.org/techniques/T1490/"


[threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

[process where event.action == "start" and
  (
    (process.pe.original_file_name == "wmic.exe" and process.command_line : "*shadowcopy*" and process.command_line : "*delete*") or
    (process.pe.original_file_name == "VSSADMIN.EXE" and process.command_line : "*shadows*" and process.command_line : ("*delete*", "*resize*")) or
    (process.pe.original_file_name == "bcdedit.exe" and process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*")) or
    (process.pe.original_file_name == "WBADMIN.EXE" and process.command_line : ("*catalog*", "*systemstatebackup*") and process.command_line : "*delete*") or
    (process.pe.original_file_name == "iCACLS.EXE" and process.command_line : ("*/deny*S-1-1-0*", "*?:\\*\" /grant*Everyone:F*"))
  ) and
  not (process.name : "bcdedit.exe" and process.parent.executable : "?:\\Program Files (x86)\\Faronics\\Deep Freeze\\Install C-0\\DFServ.exe")]

Stage 2: file

[file where event.action : "rename" and process.pid != 4 and
  file.extension != null and file.Ext.entropy >= 7 and
  file.Ext.original.name : ("*.jpg", "*.bmp", "*.png", "*.pdf", "*.doc", "*.docx", "*.xls", "*.xlsx", "*.ppt", "*.pptx") and
  not file.extension : ("tmp", "~tmp", "diff", "gz", "download", "bak", "bck", "lnk", "part", "save", "url") and
  not (process.name : "msiexec.exe" and file.path : "?:\\Config.Msi\\*.rbf") and
  not process.executable : ("?:\\Program Files\\Microsoft OneDrive\\OneDrive.exe",
                            "?:\\Program Files\\Fiery\\Components\\Fiery XF\\Job Editor.exe",
                            "?:\\Windows\\explorer.exe")]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameeqbcdedit.exeexcludes:process.name field:"process.name" value:"bcdedit.exe"
process.parent.executableeq?:\Program Files (x86)\Faronics\Deep Freeze\Install C-0\DFServ.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Faronics\Deep Freeze\Install C-0\DFServ.exe"
file.pathwildcard?:\Config.Msi\*.rbfexcludes:file.path field:"file.path" value:"?:\Config.Msi\*.rbf"
process.nameeqmsiexec.exeexcludes:process.name field:"process.name" value:"msiexec.exe"
file.extensioneqtmp, ~tmp, diff, gz, download, bak, bck, lnk, part, save, urlexcludes:file.extension
process.executableeq?:\Program Files\Microsoft OneDrive\OneDrive.exe, ?:\Program Files\Fiery\Components\Fiery XF\Job Editor.exe, ?:\Windows\explorer.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\Microsoft OneDrive\OneDrive.exe" field:"process.executable" value:"?:\Program Files\Fiery\Components\Fiery XF\Job Editor.exe" field:"process.executable" value:"?:\Windows\explorer.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
event.actionwildcard
  • rename corpus 22 (elastic 21, sigma 1)
field:"EventType" kind:wildcard value:"rename"
file.Ext.entropyge
  • 7 transforms: number corpus 4 (elastic 4)
field:"file.Ext.entropy" kind:ge value:"7"
file.Ext.original.namewildcard
  • *.bmp corpus 6 (elastic 6)
  • *.doc corpus 6 (elastic 6)
  • *.docx corpus 6 (elastic 6)
  • *.jpg corpus 6 (elastic 6)
  • *.pdf corpus 6 (elastic 6)
  • *.png corpus 6 (elastic 6)
  • *.ppt corpus 6 (elastic 6)
  • *.pptx corpus 6 (elastic 6)
  • *.xls corpus 6 (elastic 6)
  • *.xlsx corpus 6 (elastic 6)
field:"file.Ext.original.name" kind:wildcard
file.extensionis_not_null
  • (no value, null check)
field:"file.extension" kind:is_not_null
process.command_linewildcard
  • */deny*S-1-1-0* corpus 2 (elastic 2)
  • *?:\*" /grant*Everyone:F* corpus 2 (elastic 2)
  • *bootstatuspolicy* corpus 10 (elastic 8, sigma 1, splunk 1)
  • *catalog* corpus 12 (elastic 8, sigma 3, splunk 1)
  • *delete* corpus 31 (sigma 16, elastic 8, splunk 6, kusto 1)
  • *recoveryenabled* corpus 10 (elastic 8, sigma 1, splunk 1)
  • *resize* corpus 9 (elastic 5, sigma 3, splunk 1)
  • *shadowcopy* corpus 13 (elastic 7, sigma 3, splunk 3)
  • *shadows* corpus 11 (elastic 8, sigma 3)
  • *systemstatebackup* corpus 8 (elastic 8)
field:"CommandLine" kind:wildcard
process.pe.original_file_nameeq
  • VSSADMIN.EXE corpus 12 (elastic 9, sigma 3)
  • WBADMIN.EXE corpus 19 (elastic 11, sigma 6, splunk 2)
  • bcdedit.exe corpus 13 (elastic 11, sigma 2)
  • iCACLS.EXE corpus 5 (elastic 4, sigma 1)
  • wmic.exe corpus 80 (sigma 38, elastic 24, splunk 18)
field:"OriginalFileName" kind:eq
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"