Detection rules › Elastic

Suspicious File Rename by an Unusual Process

Time window
5m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies the execution of commonly abused signed proxy execution utilities such as rundll32, regsvr32 and powershell followed by a suspicious file rename operation. This may indicate Ransomware behavior leveraging legit Windows utilities.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of commonly abused signed proxy execution utilities such as rundll32, regsvr32 and powershell
followed by a suspicious file rename operation. This may indicate Ransomware behavior leveraging legit Windows
utilities.
"""
id = "df874d7e-6639-44ce-b47d-96254022ccd5"
license = "Elastic License v2"
name = "Suspicious File Rename by an Unusual Process"
os_list = ["windows"]
version = "1.0.28"

query = '''
sequence by process.entity_id with maxspan=5m
 [process where event.action == "start" and process.name : ("rundll32.exe", "regsvr32.exe")]
 [file where event.action : "rename" 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", "jpg", "bmp",
                        "png", "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx")]
'''

min_endpoint_version = "7.15.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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"



[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.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"

[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[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

Ordered sequence: each step below must occur in order within 5m, correlated by process.entity_id.

Stage 1: process

[process where event.action == "start" and process.name : ("rundll32.exe", "regsvr32.exe")]

Stage 2: file

[file where event.action : "rename" 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", "jpg", "bmp",
                        "png", "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx")]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.extensioneqtmp, ~tmp, diff, gz, download, bak, bck, lnk, part, save, url, jpg, bmp, png, pdf, doc, docx, xls, xlsx, ppt, pptxexcludes:file.extension

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.namewildcard
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
field:"process_name" kind:wildcard