Detection rules › Elastic

Potential Data wiping Attack Behavior

Time window
1s
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies a suspicious sequence of file modifications where the entropy of the file is set to zero and its original size is still shown as unmodified. This may indicate a data wiping attack behavior.

MITRE ATT&CK coverage

TacticTechniques
Impact

Rule body

[rule]
description = """
Identifies a suspicious sequence of file modifications where the entropy of the file is set to zero and its original
size is still shown as unmodified. This may indicate a data wiping attack behavior.
"""
id = "c8776070-eca6-4370-8438-f2b6282615ef"
license = "Elastic License v2"
name = "Potential Data wiping Attack Behavior"
os_list = ["windows"]
version = "1.0.34"

query = '''
sequence by process.entity_id with maxspan=1s

  /* a sequence of file mod by same process */

 [file where event.action == "modification" and process.pid != 4 and process.executable != null and 
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10 and
  not process.executable :
            ("?:\\Program Files\\*.exe",
             "?:\\Program Files (x86)\\*.exe",
             "?:\\Windows\\System32\\spoolsv.exe",
             "?:\\Windows\\System32\\svchost.exe",
             "?:\\Windows\\Explorer.exe",
             "?:\\Program Files (x86)\\Steam\\steamapps\\*.exe",
             "\\Device\\HarddiskVolume?\\Steam\\steam.exe") and
  not (process.name : "steam.exe" and file.path : "?:\\Users\\*\\steamapps\\downloading\\*.txt") and
  not (process.code_signature.subject_name : "Valve Corp." and process.code_signature.trusted == true) and
  not file.path : "?:\\Program Files (x86)\\Steam\\steamapps\\downloading\\*" and
  not (file.extension : ("dll", "exe", "txt") and process.executable : "C:\\Windows\\System32\\msiexec.exe") and
  not (process.executable : "C:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe" and
       process.code_signature.subject_name == "Microsoft Corporation" and process.code_signature.trusted == true)
  ]
 [file where event.action == "modification" and
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10]
 [file where event.action == "modification" and
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10]
 [file where event.action == "modification" and
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10]
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"


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

[internal]
min_endpoint_version = "8.0.0"

Stages and Predicates

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

Stage 1: file

[file where event.action == "modification" and process.pid != 4 and process.executable != null and 
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10 and
  not process.executable :
            ("?:\\Program Files\\*.exe",
             "?:\\Program Files (x86)\\*.exe",
             "?:\\Windows\\System32\\spoolsv.exe",
             "?:\\Windows\\System32\\svchost.exe",
             "?:\\Windows\\Explorer.exe",
             "?:\\Program Files (x86)\\Steam\\steamapps\\*.exe",
             "\\Device\\HarddiskVolume?\\Steam\\steam.exe") and
  not (process.name : "steam.exe" and file.path : "?:\\Users\\*\\steamapps\\downloading\\*.txt") and
  not (process.code_signature.subject_name : "Valve Corp." and process.code_signature.trusted == true) and
  not file.path : "?:\\Program Files (x86)\\Steam\\steamapps\\downloading\\*" and
  not (file.extension : ("dll", "exe", "txt") and process.executable : "C:\\Windows\\System32\\msiexec.exe") and
  not (process.executable : "C:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe" and
       process.code_signature.subject_name == "Microsoft Corporation" and process.code_signature.trusted == true)
  ]

Stage 2: file

[file where event.action == "modification" and
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10]

Stage 3: file

[file where event.action == "modification" and
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10]

Stage 4: file

[file where event.action == "modification" and
  file.Ext.entropy == 0 and file.Ext.header_bytes : "0000000*" and
  file.extension : ("exe", "dll", "html", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt", "png") and file.size > 10]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.extensioneqdll, exe, txtexcludes:file.extension field:"file.extension" value:"dll" field:"file.extension" value:"exe" field:"file.extension" value:"txt"
process.executableeqC:\Windows\System32\msiexec.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\msiexec.exe"
file.pathwildcard?:\Users\*\steamapps\downloading\*.txtexcludes:file.path field:"file.path" value:"?:\Users\*\steamapps\downloading\*.txt"
process.nameeqsteam.exeexcludes:process.name field:"process.name" value:"steam.exe"
process.code_signature.subject_nameeqMicrosoft Corporationexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Corporation"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcardC:\Users\*\AppData\Local\Microsoft\OneDrive\OneDrive.exeexcludes:process.executable field:"process.executable" value:"C:\Users\*\AppData\Local\Microsoft\OneDrive\OneDrive.exe"
process.code_signature.subject_nameeqValve Corp.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Valve Corp."
file.pathstarts_with?:\Program Files (x86)\Steam\steamapps\downloading\excludes:file.path field:"file.path" value:"?:\Program Files (x86)\Steam\steamapps\downloading\"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\spoolsv.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\Explorer.exe, ?:\Program Files (x86)\Steam\steamapps\*.exe, \Device\HarddiskVolume?\Steam\steam.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
file.Ext.entropyeq
  • 0 transforms: number
field:"file.Ext.entropy" kind:eq value:"0"
file.Ext.header_byteswildcard
  • 0000000*
field:"file.Ext.header_bytes" kind:wildcard value:"0000000*"
file.extensionwildcard
  • dll corpus 33 (elastic 33)
  • doc corpus 3 (elastic 3)
  • docx corpus 3 (elastic 3)
  • exe corpus 32 (elastic 32)
  • html corpus 3 (elastic 3)
  • pdf corpus 2 (elastic 2)
  • png corpus 4 (elastic 4)
  • ppt corpus 3 (elastic 3)
  • pptx corpus 3 (elastic 3)
  • txt corpus 4 (elastic 4)
  • xls corpus 3 (elastic 3)
  • xlsx corpus 3 (elastic 3)
field:"file.extension" kind:wildcard
file.sizegt
  • 10 transforms: number
field:"file.size" kind:gt value:"10"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"