Join our Newsletter — 33% off our NHI Course

How do attackers use Linux delete_module?

Linux delete_module removes a loaded kernel module. Attackers use it to unload security tools, erase traces after loading a malicious module, or destabilise monitoring that depends on kernel components. Defenders should watch for unexpected module removal, especially when it follows a suspicious load, privilege escalation, or tampering with defensive software.

What delete_module gives an attacker, and why it matters

On a compromised Linux host, delete_module is valuable because it changes the kernel’s live footprint, not just user space behavior. If an attacker can invoke it, they may remove a security driver, detach monitoring hooks, or clear away a malicious module after it has done its work. That makes module removal both a concealment technique and an operational disruptor.

The key practitioner point is that module unloading is rarely interesting in isolation. It becomes significant when it follows suspicious module insertion, privilege escalation, or tampering with endpoint defenses, because the attacker is often trying to reduce visibility or remove the component that would reveal the compromise.

How attackers abuse module unloading in real intrusion chains

Attackers usually do not rely on delete_module as a first step. It is more often used after they already have the access needed to load a kernel module or after they have found a path to kernel-level execution. Once that point is reached, unloading can help them erase evidence, disable a defensive module, or make the system less stable so that monitoring becomes unreliable.

A common pattern is “load, act, unload.” The malicious module may alter logging, hide processes, interfere with detection, or support persistence while it is present. Afterward, removing the module can reduce forensic residue and make the host look closer to normal. Even when the attacker does not unload their own code, removing a security module can leave the environment blind at exactly the wrong time.

This is why module lifecycle events matter as much as the module itself. A suspicious load followed by an unexpected unload is a stronger signal than either event alone, especially on systems where kernel module changes are rare in normal operations.

What defenders should monitor when delete_module appears

Defenders should treat module removal as a high-value kernel integrity event and correlate it with process lineage, privilege changes, and recent security tool tampering. The most useful question is not simply “was a module removed?” but “what was removed, who removed it, and what changed immediately before and after?”

That means watching for unusual module events on production hosts, especially security agents, storage components, network inspection drivers, and any custom module that supports observability or hardening. If removal occurs soon after an unexpected module load, a new privileged process, or an outage in telemetry, the event deserves immediate investigation.

It also helps to compare module activity against your approved operational baseline. Routine administration may involve module changes on some systems, but most hardened servers should have a narrow, well understood set of legitimate module actions. Anything outside that pattern should be treated as potential tampering until explained.

Risk and Threat Considerations

Module deletion is risky because it can directly undermine kernel trust, visibility, and stability. If an attacker can remove a defensive or monitoring module, they may suppress alerts, weaken inspection, or create a gap between actual host state and what defenders can observe.

Failure mechanism: The attacker uses kernel privileges to unload a module that enforces security, logging, or visibility, or unloads their own malicious module after it has modified the system. That breaks the normal evidence trail and can leave the host operating with reduced protection.

Impact: The result can be stealthier persistence, missed detections, degraded telemetry, and in some cases kernel instability or service interruption. On systems that depend on kernel instrumentation, the security impact can persist even after the initial attacker action is complete.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
MITRE ATT&CK T1089 — Disabling Security Tools Module removal can be used to disable defensive kernel components.
T1014 — Rootkit Attackers may load then unload kernel modules to hide rootkit activity.
Recommendation — Map module-removal events to T1089 and investigate whether security tooling was intentionally disabled. Correlate kernel module changes with rootkit indicators and verify host integrity after suspicious unloads.
CIS Controls v8 CIS-8 — Audit Log Management Unexpected module removal should be detectable in audit and kernel logs.
Recommendation — Centralize and review kernel/module audit events for unauthorized removal activity.
NIST SP 800-53 Rev 5 SI-7 — Software, Firmware, and Information Integrity Kernel module tampering is an integrity problem that can weaken system trust.
AU-12 — Audit Record Generation Delete_module events need reliable audit generation to support detection and forensics.
Recommendation — Validate module integrity and alert on unauthorized kernel component changes. Generate audit records for module load and unload actions on critical Linux hosts.

Practitioner Guidance

What to verify: Confirm whether the removed module was expected for that host role and whether a legitimate change record exists. If there is no clear administrative reason, treat the event as possible compromise and review the preceding process tree, recent privilege use, and any sign of agent interference.

Decision rule: If module removal follows a suspicious load, privilege escalation, or failure in defensive tooling, prioritise containment and host integrity review before assuming the unload was benign. If the module was security-related, verify whether the host still has equivalent coverage elsewhere.

What practitioners underestimate: Module unloading is often treated as an operational event, but in an intrusion it can be a concealment step or a way to blind the defender. The most important judgment is whether the host’s monitoring and trust assumptions still hold after the event.

Practitioner takeaway: Treat unexpected delete_module activity as a kernel integrity signal, not just a maintenance action, and always interpret it in the context of recent load, privilege, and telemetry changes.