This hunt hypothesis targets adversaries exploiting the Dirty COW vulnerability to execute specific shellcode that facilitates local privilege escalation on Linux systems within Azure Sentinel. Proactive hunting is essential because this critical-severity threat allows attackers to gain root access from a compromised user context, potentially enabling lateral movement and persistent control over sensitive infrastructure.
rule EXPL_HKTL_LNX_DirtyFragShellcode_May26 {
meta:
description = "Detects a shellcode observed in dirtyfrag, a local privilege escalation exploit for Linux."
reference = "https://github.com/V4bel/dirtyfrag/tree/master"
author = "Pezier Pierre-Henri (Nextron Systems)"
date = "2026-05-07"
score = 80
hash = "a02ea2ba8108a9b7a997faa8808cfc55bb69af54e69178fa5aa1785681cf0ced"
id = "c156da87-c029-5084-9cd3-a233fefdaf25"
strings:
$op1 = {
31 ff // xor edi, edi
31 f6 // xor esi, esi
31 c0 // xor eax, eax
b0 6a // mov al, 6Ah ; 'j'
0f 05 // syscall; LINUX - sys_setgid
b0 69 // mov al, 69h ; 'i'
0f 05 // syscall; LINUX - sys_setuid
b0 74 // mov al, 74h ; 't'
0f 05 // syscall; LINUX - sys_setgroups
6a 00 // push 0
48 [6] // lea rax, aTermXterm; "TERM=xterm"
50 // push rax
48 89 e2 // mov rdx, rsp
48 [6] // lea rdi, aBinSh; "/bin/sh"
31 f6 // xor esi, esi
6a 3b // push 3Bh ; ';'
58 // pop rax
0f 05 // syscall; LINUX - sys_execve
}
condition:
$op1
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
Here are 3-5 specific false positive scenarios and corresponding filters/exclusions for the “DirtyCov/Shellcode in dirtyfrag” detection rule:
Scenario: Automated Kernel Patching via unattended-upgrades
unattended-upgrades service (common on Ubuntu/Debian) or yum-cron (on RHEL/CentOS) automatically downloads and applies kernel security patches during maintenance windows. These tools often invoke shell scripts that interact with kernel modules or memory structures similar to those targeted by DirtyCov, potentially triggering the shellcode detection logic as they manipulate file descriptors or page tables.unattended-upgrades (e.g., apt-get, dpkg) and yum. Filter out alerts where the parent process is systemd or cron running on known maintenance hosts, specifically excluding events occurring between 02:00–04:00 UTC.Scenario: Container Orchestration Node Reconciliation (Kubernetes/Kubelet)
kubelet agent constantly reconciles node states and manages pod lifecycles. When kubelet performs garbage collection or updates cgroup configurations on Linux nodes, it may execute low-level shell operations that mimic the memory manipulation patterns of the DirtyCov exploit, particularly when interacting with shared libraries in the dirtyfrag namespace./usr/bin/kubelet, /var/run/docker/libcontainerd, or /opt/containerd. Additionally, filter out alerts originating from container runtime namespaces (e.g., docker-default, k8s.io) rather than the host OS namespace.**Scenario: Database