Kernel Driver Registered via NtLoadDriver


Description

Adversaries may load a driver to a compromised machine to execute code in kernel mode. A majority of legitimate kernel driver installations involve a new service creation via the Windows Service Control Manager (SCM) which generate audit logs. Adversaries can leverage the undocumented Windows API NtLoadDriver to load a driver directly, avoiding service creation traces.

Query · eql

sequence by process.entity_id with maxspan=5m
 [process where event.action == "start" and 
  (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  (process.Ext.relative_file_creation_time <= 3600 or process.Ext.relative_file_name_modify_time <= 500)]
 [registry where
  registry.path : "HKLM\\SYSTEM\\ControlSet001\\*\\Type" and registry.data.strings : "1"]
Raw source Kernel Driver Registered via NtLoadDriver · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Adversaries may load a driver to a compromised machine to execute code in kernel mode. A majority of legitimate kernel
driver installations involve a new service creation via the Windows Service Control Manager (SCM) which generate audit
logs. Adversaries can leverage the undocumented Windows API NtLoadDriver to load a driver directly, avoiding service
creation traces.
"""
id = "5b5fa228-596a-4df2-a0ff-4d98b97e67b3"
license = "Elastic License v2"
name = "Kernel Driver Registered via NtLoadDriver"
os_list = ["windows"]
reference = [
    "http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FExecutable%20Images%2FNtLoadDriver.html",
]
version = "1.0.27"

query = '''
sequence by process.entity_id with maxspan=5m
 [process where event.action == "start" and 
  (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  (process.Ext.relative_file_creation_time <= 3600 or process.Ext.relative_file_name_modify_time <= 500)]
 [registry where
  registry.path : "HKLM\\SYSTEM\\ControlSet001\\*\\Type" and registry.data.strings : "1"]
'''

min_endpoint_version = "8.10.0"
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[[threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "8.10.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.