Sub-technique of T1547 Boot or Logon Autostart Execution.View on attack.mitre.org
Adversaries may modify the kernel to automatically execute programs on system boot. Loadable Kernel Modules (LKMs) are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. For example, one type of module is the device driver, which allows the kernel to access hardware connected to the system.
When used maliciously, LKMs can be a type of kernel-mode Rootkit that run with the highest operating system privilege (Ring 0). Common features of LKM based rootkits include: hiding itself, selective hiding of files, processes and network activity, as well as log tampering, providing authenticated backdoors, and enabling root access to non-privileged users.
Kernel extensions, also called kext, are used in macOS to load functionality onto a system similar to LKMs for Linux. Since the kernel is responsible for enforcing security and the kernel extensions run as apart of the kernel, kexts are not governed by macOS security policies. Kexts are loaded and unloaded through kextload and kextunload commands. Kexts need to be signed with a developer ID that is granted privileges by Apple allowing it to sign Kernel extensions. Developers without these privileges may still sign kexts but they will not load unless SIP is disabled. If SIP is enabled, the kext signature is verified before being added to the AuxKC.
Since macOS Catalina 10.15, kernel extensions have been deprecated in favor of System Extensions. However, kexts are still allowed as "Legacy System Extensions" since there is no System Extension for Kernel Programming Interfaces.
Adversaries can use LKMs and kexts to conduct Persistence and/or Privilege Escalation on a system. Examples have been found in the wild, and there are some relevant open source projects as well.
Rules on DetectionCode tagged with T1547.006.
| Rule | Level | Log source |
|---|---|---|
| Loading of Kernel Module via Insmod | high | linux / NULL |
| Rule | Type | Risk | Data source |
|---|---|---|---|
| Linux Auditd Insert Kernel Module Using Insmod Utility | Anomaly | NULL | Linux Auditd Syscall |
| Linux Auditd Install Kernel Module Using Modprobe Utility | Anomaly | NULL | Linux Auditd Syscall |
| Linux Auditd Kernel Module Using Rmmod Utility | TTP | NULL | Linux Auditd Syscall |
| Linux Auditd Unload Module Via Modprobe | TTP | NULL | Linux Auditd Execve |
| Linux File Created In Kernel Driver Directory | Anomaly | NULL | Sysmon for Linux EventID 11 |
| Linux Insert Kernel Module Using Insmod Utility | Anomaly | NULL | Sysmon for Linux EventID 1 |
| Linux Install Kernel Module Using Modprobe Utility | Anomaly | NULL | Sysmon for Linux EventID 1 |
| Windows Snake Malware Kernel Driver Comadmin | TTP | NULL | Sysmon EventID 11 |
| Windows Snake Malware Service Create | TTP | NULL | Windows Event Log System 7045 |
None recorded.
| Used by | Procedure example |
|---|---|
| MalwareDrovorub | Drovorub can use kernel modules to establish persistence. |
| MalwareREPTILE | The REPTILE rootkit is implemented as a loadable kernel module (LKM). |
| MalwareSkidmap | Skidmap has the ability to install several loadable kernel modules (LKMs) on infected machines. |
| Used by | Procedure example |
|---|---|
| CampaignOperation CuckooBees | During Operation CuckooBees, attackers used a signed kernel rootkit to establish additional persistence. |
Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.