Skip to content
Threat Feed
high advisory

Potential Privilege Escalation via unshare Followed by Root Process

The rule detects a sequence of events indicating a potential privilege escalation attempt on Linux systems where a non-root user performs namespace activity using unshare, followed by the execution of a root process shortly after.

This detection rule, created by Elastic on May 8, 2026, identifies potential privilege escalation attempts on Linux systems. It focuses on a specific sequence of events where a non-root user utilizes the unshare command or syscall to manipulate namespaces, a technique often associated with privilege escalation. Shortly after this namespace activity, a process running as root is executed. This sequence raises suspicion as it could indicate a successful privilege escalation attempt, where a user gains unauthorized root access by exploiting namespace vulnerabilities. This is relevant for defenders as it helps detect and prevent unauthorized access and maintain system integrity. The rule relies on Auditd Manager or Auditbeat telemetry.

Attack Chain

  1. A non-root user executes the unshare command or syscall to create or join a new namespace. This is often done to isolate processes and resources.
  2. The unshare command is executed with arguments like --user, --map-root-user, or --map-current-user, indicating an attempt to manipulate user namespaces.
  3. The Auditd logs capture the unshare syscall with class “namespace” and specific arguments (a0) related to namespace manipulation.
  4. Shortly after the unshare activity, a process is spawned that executes with root privileges (UID 0).
  5. The root process could be a common utility like su, sudo, pkexec, passwd, bash, or python.
  6. The attacker leverages the elevated privileges to perform malicious actions, such as installing malware or modifying system configurations.
  7. The attacker attempts to establish persistence by modifying system files or creating new user accounts.
  8. The attacker gains complete control over the compromised system.

Impact

A successful privilege escalation can grant an attacker complete control over a Linux system. This allows them to access sensitive data, install malware, modify system configurations, and potentially compromise other systems on the network. The number of victims depends on the scope of the initial compromise and the attacker’s objectives. Sectors targeted could include any organization running Linux systems, particularly those with sensitive data or critical infrastructure.

Recommendation

  • Enable Auditd Manager or Auditbeat with rules that capture process execution events, namespace-related activity, and privilege transitions as described in the rule setup section.
  • Deploy the provided Sigma rules to your SIEM to detect potential privilege escalation attempts via unshare. Tune the rules based on your environment and baseline legitimate unshare usage.
  • Investigate any alerts generated by these rules promptly. Review the auditd logs, process command lines, and network connections associated with the events to determine if the activity is malicious.
  • Implement additional security measures to prevent privilege escalation, such as principle of least privilege and regular security audits.

Detection coverage 2

Detect unshare Command Execution by Non-Root User

medium

Detects execution of the `unshare` command by a non-root user, which may indicate the start of a privilege escalation attempt.

sigma tactics: privilege_escalation techniques: T1068 sources: process_creation, linux

Detect Root Process Started After unshare

high

Detects a root process started shortly after an unshare event, potentially indicating privilege escalation.

sigma tactics: privilege_escalation techniques: T1068 sources: process_creation, linux

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