Detection rules › Elastic

Execution of a File Dropped from Kernel Mode

Time window
5m
Sequence by
dll.path, file.path
Source
github.com/elastic/protections-artifacts

Identifies attempt to load an untrusted executable dropped by a Kernel mode code. Adversaries may execute malicious code in user mode via existing malicious Kernel drivers.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = """
Identifies attempt to load an untrusted executable dropped by a Kernel mode code. Adversaries may execute malicious code
in user mode via existing malicious Kernel drivers.
"""
id = "1c618d05-2cac-4979-9c85-6320fc317177"
license = "Elastic License v2"
name = "Execution of a File Dropped from Kernel Mode"
os_list = ["windows"]
version = "1.0.5"

query = '''
sequence with maxspan=5m
  [file where event.action == "creation" and
   /* library dropped via System Virtual Process - Kernel mode code */
   process.pid == 4 and user.id : "S-1-5-18" and
   (file.extension : ("exe", "dll") or file.Ext.header_bytes : "4d5a*")] by file.path 
   [library where process.pid != 4 and not dll.code_signature.status : "trusted" and process.executable != null and
    not dll.hash.sha256 : "6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732c"] by dll.path
'''

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

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

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


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by dll.path, file.path.

Stage 1: file

[file where event.action == "creation" and
   process.pid == 4 and user.id : "S-1-5-18" and
   (file.extension : ("exe", "dll") or file.Ext.header_bytes : "4d5a*")] by file.path

Stage 2: library

[library where process.pid != 4 and not dll.code_signature.status : "trusted" and process.executable != null and
    not dll.hash.sha256 : "6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732c"] by dll.path

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuseqtrustedexcludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted"
dll.hash.sha256eq6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732cexcludes:dll.hash.sha256 field:"dll.hash.sha256" value:"6957be7503737453c3feab129d4924fca55e7b0c026ec878d0d040765002732c"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • creation corpus 58 (elastic 58)
field:"EventType" kind:eq value:"creation"
file.Ext.header_byteswildcard
  • 4d5a* corpus 46 (elastic 46)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.extensionwildcard
  • dll corpus 33 (elastic 33)
  • exe corpus 32 (elastic 32)
field:"file.extension" kind:wildcard
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.pideq
  • 4 transforms: number corpus 19 (elastic 19)
field:"process_id" kind:eq value:"4"
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
user.idwildcard
  • S-1-5-18 corpus 13 (elastic 13)
field:"user.id" kind:wildcard value:"S-1-5-18"