Linux Detection Engineering – Local Privilege Escalation

Linux Detection Engineering – Local Privilege Escalation
The article describes a layered Linux privilege escalation detection framework that combines general root-transition logic with technique-specific rules for SUID abuse, unshare, Python-driven exploits, and kernel page-cache corruption. It also reviews 2026 Linux LPE cases such as Copy Fail, DirtyFrag, Fragnesia, DirtyDecrypt, pedit COW, DirtyClone, CIFSwitch, OVSwrap, and CVE-2026-46333, showing how Elastic Defend and Auditd can catch them in practice. #CopyFail #DirtyFrag #Fragnesia #DirtyDecrypt #peditCOW #DirtyClone #CIFSwitch #OVSwrap #CVE-2026-46333

Keypoints

  • The article presents a layered detection model for Linux local privilege escalation, centered on the common pattern of an unprivileged process becoming root.
  • It combines broad outcome-based rules with narrower rules for SUID/SGID helper abuse, unshare-based escalation, Python exploit behavior, and suspicious descendant processes.
  • Several 2026 kernel page-cache corruption bugs are highlighted, including Copy Fail, DirtyFrag, Fragnesia, DirtyDecrypt, pedit COW, and DirtyClone.
  • The article explains how namespace creation with unshare can support both kernel exploitation and trusted-helper abuse, including CIFSwitch and OVSwrap.
  • It also covers privileged helper and service abuse involving sudo, pkexec, busctl, ssh-keysign, and chage_pwn behavior tied to CVE-2026-46333.
  • Elastic Defend, Auditd, and prebuilt Elastic detection rules are used to detect exploit primitives, root transitions, and suspicious execution chains.
  • The detection strategy is designed to be durable against changing PoCs by focusing on host behavior rather than individual CVEs.

MITRE Techniques

  • [T1548.001 ] Abuse Elevation Control Mechanism: Setuid and Setgid – Used to detect SUID/SGID helper abuse where a process runs with effective uid 0 while the real user is non-root (ā€˜setuid-root binaries and helpers are the single most common final step in a Linux LPE’).
  • [T1068 ] Exploitation for Privilege Escalation – The article focuses on Linux LPE exploits that use kernel bugs, helper abuse, and self-elevation to gain root (ā€˜local privilege escalation … turns a foothold into full control of a host’).
  • [T1055 ] Process Injection – Mentioned as part of kernel and subsystem coverage involving ptrace-related escalation paths (ā€˜kernel bugs scattered across … ptrace’).
  • [T1069.001 ] Permission Groups Discovery: Local Groups – Relevant to checks on real user/group IDs versus effective IDs during escalation detection (ā€˜while the real user/group ID is not’).
  • [T1202 ] Indirect Command Execution – Used where helpers are proxied through arguments or shell one-liners (ā€˜proxying the execution so a name-based rule sees the wrong thing’).
  • [T1059.004 ] Command and Scripting Interpreter: Unix Shell – Detected when exploits spawn shells or use shell one-liners from writable paths (ā€˜a shell one-liner’, ā€˜root shell’).
  • [T1059.006 ] Command and Scripting Interpreter: Python – Used for Python-based PoCs that escalate to root (ā€˜A growing share of public PoCs finish with a one-line interpreter payload, and Python is the workhorse’).
  • [T1135 ] Network Share Discovery – Not directly central, but namespace and network-related exploit paths touch network setup and access to privileged interfaces (ā€˜private user and network namespace’).
  • [T1136.001 ] Create Account: Local Account – Implied by account and helper abuse involving passwd, chage, and related privileged utilities (ā€˜passwd’, ā€˜accounts-daemon’).
  • [T1611 ] Escape to Host – Relevant to container and namespace-based escalation attempts that aim to reach host privileges (ā€˜container escapes’, ā€˜escape-to-host case’).
  • [T1021.004 ] Remote Services: D-Bus – The busctl abuse section describes interaction with privileged D-Bus services (ā€˜talks to a privileged D-Bus system service directly with busctl’).
  • [T1610 ] Deploy Container – Namespace creation and container-style isolation are used as a precursor in several exploits (ā€˜unshare(CLONE_NEWUSER)’).
  • [T1613 ] Container and Resource Discovery – The article discusses user namespaces, mount namespaces, and network namespaces as escalation primitives (ā€˜new user namespace’, ā€˜private network namespace’).

Indicators of Compromise

  • [File names ] Privileged helpers and PoC binaries used as execution or finish points – /usr/bin/su, /usr/lib/openssh/ssh-keysign, ./dirtydecrypt
  • [File paths ] Writable staging locations used by exploit chains – /tmp, /dev/shm, /var/tmp, /run/user/
  • [Command-line strings ] Common root-check and privilege-confirmation commands run after escalation – whoami, id, logname
  • [Command-line strings ] Namespace and helper abuse flags seen in exploit setup – unshare -r, unshare –user, sudo -n bash
  • [File paths ] Sensitive targets discussed in descriptor-theft and SUID abuse scenarios – /etc/shadow, ssh_host_*_key
  • [Binary names ] Frequently abused SUID/SGID helpers and privileged utilities – sudo, pkexec, passwd, chsh, newgrp
  • [Binary names ] User-controlled PoC executables and helper launchers referenced in the article – ./skb_segment_exploit, ./sshkeysign_pwn, ./chage_pwn
  • [Kernel/interface names ] Exploit-related interfaces and helpers observed in the article – AF_ALG, splice(), skb_segment(), request_key(), pidfd_getfd()


Read more: https://www.elastic.co/security-labs/threat-command/linux-privilege-escalation-detection-framework