Detection of Malicious Linux Kernel Module Loading via Insmod
The execution of the insmod utility on Linux systems is a high-risk indicator often associated with the deployment of rootkits for persistence and privilege escalation.
The 'insmod' utility is a standard Linux command used to insert a module into the kernel. While this is a legitimate administrative function for hardware drivers or file system support, it is a primary technique used by threat actors to install malicious Loadable Kernel Modules (LKMs) or rootkits. Once a malicious module is loaded, the attacker gains the ability to intercept system calls, hide processes or files, and maintain long-term persistence with the highest level of system privileges. This activity is critical for detection engineering teams because kernel-level malware operates beneath the visibility of traditional user-mode security agents, often rendering standard defensive controls ineffective if not detected at the point of initial insertion.
Impact
Successful exploitation allows an attacker to operate within the kernel space, leading to full system compromise, persistent unauthorized access, and the potential to bypass or disable security software on the compromised host.
Recommendation
Deploy detection logic to monitor process execution for the usage of the insmod utility, especially when executed by non-administrative users or atypical parent processes.
- Enable Sysmon for Linux Event ID 1 logging to capture process creation telemetry.
- Implement the provided Sigma rule to alert on unauthorized kernel module insertion.
- Establish a baseline of known-good kernel module loading events to reduce noise from administrative activity.
Immediate actions
Deploy Sigma detection rule to monitor for insmod execution by non-root users.
Threat Hunt
Search logs for unusual kernel module insertions occurring outside of defined maintenance windows.
Data: Process creation logs including command line arguments.
Mitigations
Implement Linux kernel module signing to restrict loading to trusted, cryptographically signed modules.
T1547.006
Detection coverage 1
Detect Linux Kernel Module Insertion via Insmod
mediumDetects the use of the insmod utility to load a kernel module, which may indicate the installation of a rootkit.
Detection queries are available on the platform. Get full rules →