Detection rules › Elastic

Suspicious Critical System Files Modification

Source
github.com/elastic/protections-artifacts

Identifies attempts to delete or modify critical files used during the boot process to prevent the system from booting. This may indicate a destructive attack behavior.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies attempts to delete or modify critical files used during the boot process to prevent the system from booting.
This may indicate a destructive attack behavior.
"""
id = "e2c925f7-fccb-4199-a345-cab12acedab0"
license = "Elastic License v2"
name = "Suspicious Critical System Files Modification"
os_list = ["windows"]
version = "1.0.4"

query = '''
file where process.pid != 4 and process.executable != null and
(
(event.action in ("deletion", "overwrite") and
 file.path : ("C:\\Windows\\System32\\winload.exe",
              "C:\\Windows\\System32\\winload.efi",
              "C:\\Windows\\System32\\ntoskrnl.exe",
              "C:\\Windows\\Boot\\PCAT\\bootmgr",
              "C:\\Windows\\System32\\Boot\\winload.efi",
              "C:\\Windows\\System32\\Boot\\winload.exe",
              "C:\\Windows\\WinSxS\\amd64_microsoft-windows-os-kernel_*\\ntoskrnl.exe")) or
 (event.action == "rename" and
  file.Ext.original.path :
             ("C:\\Windows\\System32\\winload.exe",
              "C:\\Windows\\System32\\winload.efi",
              "C:\\Windows\\System32\\ntoskrnl.exe",
              "C:\\Windows\\Boot\\PCAT\\bootmgr",
              "C:\\Windows\\System32\\Boot\\winload.efi",
              "C:\\Windows\\System32\\Boot\\winload.exe",
              "C:\\Windows\\WinSxS\\amd64_microsoft-windows-os-kernel_*\\ntoskrnl.exe"))
) and not process.executable :
        ("C:\\Windows\\System32\\poqexec.exe",
         "C:\\Windows\\System32\\wbengine.exe",
         "C:\\Windows\\WinSxS\\*\\TiWorker.exe")
'''

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 = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"

[[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: file

file where process.pid != 4 and process.executable != null and
(
(event.action in ("deletion", "overwrite") and
 file.path : ("C:\\Windows\\System32\\winload.exe",
              "C:\\Windows\\System32\\winload.efi",
              "C:\\Windows\\System32\\ntoskrnl.exe",
              "C:\\Windows\\Boot\\PCAT\\bootmgr",
              "C:\\Windows\\System32\\Boot\\winload.efi",
              "C:\\Windows\\System32\\Boot\\winload.exe",
              "C:\\Windows\\WinSxS\\amd64_microsoft-windows-os-kernel_*\\ntoskrnl.exe")) or
 (event.action == "rename" and
  file.Ext.original.path :
             ("C:\\Windows\\System32\\winload.exe",
              "C:\\Windows\\System32\\winload.efi",
              "C:\\Windows\\System32\\ntoskrnl.exe",
              "C:\\Windows\\Boot\\PCAT\\bootmgr",
              "C:\\Windows\\System32\\Boot\\winload.efi",
              "C:\\Windows\\System32\\Boot\\winload.exe",
              "C:\\Windows\\WinSxS\\amd64_microsoft-windows-os-kernel_*\\ntoskrnl.exe"))
) and not process.executable :
        ("C:\\Windows\\System32\\poqexec.exe",
         "C:\\Windows\\System32\\wbengine.exe",
         "C:\\Windows\\WinSxS\\*\\TiWorker.exe")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcardC:\Windows\System32\poqexec.exe, C:\Windows\System32\wbengine.exe, C:\Windows\WinSxS\*\TiWorker.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\poqexec.exe" field:"process.executable" value:"C:\Windows\System32\wbengine.exe" field:"process.executable" value:"C:\Windows\WinSxS\*\TiWorker.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • rename corpus 22 (elastic 21, sigma 1)
field:"EventType" kind:eq value:"rename"
event.actionin
  • deletion corpus 12 (elastic 12)
  • overwrite corpus 8 (elastic 8)
field:"EventType" kind:in
file.Ext.original.pathwildcard
  • C:\Windows\Boot\PCAT\bootmgr
  • C:\Windows\System32\Boot\winload.efi
  • C:\Windows\System32\Boot\winload.exe
  • C:\Windows\System32\ntoskrnl.exe
  • C:\Windows\System32\winload.efi
  • C:\Windows\System32\winload.exe
  • C:\Windows\WinSxS\amd64_microsoft-windows-os-kernel_*\ntoskrnl.exe
field:"file.Ext.original.path" kind:wildcard
file.pathwildcard
  • C:\Windows\Boot\PCAT\bootmgr
  • C:\Windows\System32\Boot\winload.efi
  • C:\Windows\System32\Boot\winload.exe
  • C:\Windows\System32\ntoskrnl.exe
  • C:\Windows\System32\winload.efi
  • C:\Windows\System32\winload.exe
  • C:\Windows\WinSxS\amd64_microsoft-windows-os-kernel_*\ntoskrnl.exe
field:"TargetFilename" kind:wildcard
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"