Tainted Kernel Object Created and Immediately Loaded
Description
This rule detects when a kernel object is created and then immediately loaded into the kernel. This may indicate an attempt to load a malicious kernel module or rootkit into the system.
Query · eql
sequence with maxspan=30s
[any where (
(event.category == "file" and event.action == "creation") or
(
event.category == "process" and event.type == "start" and event.action == "load_module" and
process.Ext.load_module.taint_flags == "OE" and process.Ext.load_module.name != null and
not (
process.entry_leader.executable == "/opt/ds_agent/ds_agent" or
process.session_leader.executable == "/opt/ds_agent/ds_am" or
(
process.name like "python*" and
process.args == "kcarectl.__main__" and
process.args in ("--auto-update", "--smart-update")
)
)
)
)] as event0
[any where
(
event.category == "file" and event.action == "creation" and
event0.event.action == "load_module" and
stringcontains~(file.name, event0.process.Ext.load_module.name)
) or
(
event.category == "process" and event.type == "start" and event.action == "load_module" and
event0.event.action == "creation" and
stringcontains~(event0.file.name, process.Ext.load_module.name) and
process.Ext.load_module.taint_flags == "OE" and
process.Ext.load_module.name != null and
not (
process.entry_leader.executable == "/opt/ds_agent/ds_agent" or
process.session_leader.executable == "/opt/ds_agent/ds_am" or
(
process.name like "python*" and
process.args == "kcarectl.__main__" and
process.args in ("--auto-update", "--smart-update")
)
)
)
]