πŸ’§Dirty Pipe

🎯 Overview

Dirty Pipe kernel vulnerability allows unauthorized writing to root-owned files through pipe mechanism exploitation, similar to Dirty Cow but affecting newer kernels (5.8-5.17).

🚨 CVE-2022-0847 Details

Vulnerability Info

  • Impact: Write to arbitrary files as root with only read access

  • Affected Kernels: 5.8 to 5.17 (including Android)

  • Mechanism: Pipe-based unidirectional communication exploitation

  • Similar to: Dirty Cow (CVE-2016-5195) but different attack vector

Kernel Version Check

# Check vulnerable kernel version
uname -r
# Vulnerable: 5.8.x - 5.17.x

# Examples of vulnerable versions:
# 5.13.0-46-generic
# 5.15.0-25-generic
# 5.16.x-x-generic

πŸš€ Exploitation

Download and Compile Exploits

Method 1: /etc/passwd Modification

Method 2: SUID Binary Hijacking

πŸ”§ Alternative Exploits

Other Dirty Pipe PoCs

Manual File Modification

πŸ” Detection & Enumeration

Dirty Pipe Vulnerability Check

Quick Kernel Check

πŸ”‘ Quick Reference

Immediate Checks

Emergency Exploitation

HTB Academy Example

⚠️ Exploit Considerations

Dirty Pipe Characteristics

  • Kernel-level vulnerability - Direct kernel exploitation

  • High reliability - Works on most affected systems

  • File corruption risk - Can damage system files

  • Cleanup required - exploit-2 creates /tmp/sh

Limitations

  • Specific kernel range - Only 5.8-5.17

  • Compilation needed - Requires gcc on target

  • Modern systems patched - Fixed in newer kernels

  • Detection possible - Kernel module monitoring


Dirty Pipe (CVE-2022-0847) exploits kernel pipe mechanisms for arbitrary file writes - any user can modify root-owned files, leading to immediate privilege escalation on vulnerable kernel versions.

Last updated