Skip to content
Threat Feed
medium advisory

Abuse of Linux Magic SysRq Key Mechanisms

Adversaries with root privileges may abuse the Linux Magic SysRq interface via /proc/sysrq-trigger to perform unauthorized system reboots, process termination, or system destabilization.

Adversaries possessing root or elevated privileges on Linux systems may abuse the Magic SysRq (System Request) functionality to facilitate post-exploitation objectives or disruptive activity. By interacting with the /proc/sysrq-trigger interface, an attacker can issue low-level commands directly to the kernel, bypassing standard user-space process management and logging. This technique allows for immediate system reboots, the forced termination of critical processes, or the complete destabilization of the operating system.

These actions are often associated with wiper malware or anti-forensic post-exploitation activities intended to disrupt incident response or hide malicious footprint. Monitoring interactions with /proc/sysrq-trigger, /proc/sys/kernel/sysrq, and /etc/sysctl.conf is critical for detecting such high-privilege manipulation. Defenders must correlate these file modifications with process creation events (EXECVE) or process title changes (PROCTITLE) to attribute the activity to a specific user or malicious process.

Attack Chain

  1. Attacker gains initial access to the Linux system (e.g., via exploit or stolen credentials).
  2. Attacker executes privilege escalation commands (e.g., sudo, SUID exploitation) to acquire root access.
  3. Attacker identifies the need to disrupt the environment or terminate security monitoring processes.
  4. Attacker modifies kernel parameters in /etc/sysctl.conf to enable the SysRq interface if disabled.
  5. Attacker writes specific command characters (e.g., 'b' for reboot, 'o' for poweroff, 'e' for terminate) to /proc/sysrq-trigger.
  6. The kernel immediately executes the command, overriding standard operating system state.
  7. System service disruption or unexpected shutdown occurs, resulting in potential data loss or persistent denial of service.

Impact

Successful abuse of the Magic SysRq key results in immediate system destabilization or forced shutdown, which can effectively bypass security tooling, prevent the writing of event logs to disk, and disrupt critical business services. This activity is frequently observed in wiper attacks or during the final stages of ransomware deployment to ensure the target environment is left in an unrecoverable or non-responsive state.

Recommendation

  • Configure auditd to monitor write and attribute changes to /proc/sysrq-trigger, /proc/sys/kernel/sysrq, and /etc/sysctl.conf.
  • Enable the 'sysrq' rule key in auditd configuration and ensure the 'type=CWD' event record is ingested into your SIEM.
  • Implement the following detection logic to identify unauthorized writes to these kernel trigger paths.
  • Correlate any detected activity against legitimate administrative debugging logs to minimize noise during system maintenance windows.

Immediate actions

Deploy auditd rules for /proc/sysrq-trigger and /etc/sysctl.conf

IT Operations 48h

Threat Hunt

Auditd logs showing writes to /proc/sysrq-trigger

T1529 high high confidence hunt now

Data: Auditd PATH and CWD events

Mitigations

Disable SysRq key functionality in kernel if not required for standard operations

medium_term IT Operations

T1529

Detection coverage 1

Detect Unauthorized Access to Linux SysRq Triggers

medium

Detects write access to SysRq configuration or trigger files which may indicate system destabilization attempts

sigma tactics: execution, impact techniques: T1059.004, T1529 sources: process_creation, linux

Detection queries are available on the platform. Get full rules →