Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Dirty-Pipe — Proof-of-concept exploit for CVE-2022-0847 (Dirty Pipe) enabling local privilege escalation on Linux kernels 5.8–5.16 via pipe buffer manipulation and SUID binary hijacking. | Kitploit
Tools/GitHubGitHub/bytereaper77/dirty-pipe
Privilege EscalationVulnerability AnalysisExploitationShellcodeLearning & EducationPayload DevelopmentBinary Exploitation
GitHubbytereaper77/dirty-pipe

Dirty-Pipe

Proof-of-concept exploit for CVE-2022-0847 (Dirty Pipe) enabling local privilege escalation on Linux kernels 5.8–5.16 via pipe buffer manipulation and SUID binary hijacking.

View Repository
31341 year agoNot yet reviewed
Share

Dirty Pipe Exploit (CVE-2022-0847)

Overview

This repository contains a Proof of Concept (PoC) exploit for the Dirty Pipe vulnerability (CVE-2022-0847), which affects Linux kernel versions 5.8 to 5.16. This vulnerability allows local privilege escalation by exploiting improper handling of pipe buffers in the kernel, enabling an attacker to modify read-only files (such as SUID binaries) and execute arbitrary code with elevated privileges.

Description

The Dirty Pipe vulnerability is a critical issue found in Linux kernel versions between 5.8 and 5.16. It allows local privilege escalation by exploiting improper handling of pipe buffers in the kernel. This vulnerability can be triggered by writing to a read-only file (such as SUID binaries), which can lead to arbitrary code execution and potentially a root shell on the affected system.

Key Features:

  • Privilege Escalation: Escalates privileges from an unprivileged user to root.
  • Targeted Attack: Targets read-only files like SUID binaries.
  • Custom ELF Shellcode: Injects custom shellcode into a target file to spawn a root shell.
  • Anti-Debugging: Contains anti-debugging mechanisms to avoid detection by reverse engineers.

Exploit Flow

  1. Kernel Version Check: Verifies the kernel version to ensure it lies within the vulnerable range (5.8 to 5.16).
  2. Pipe Buffer Manipulation: The exploit manipulates the pipe buffer flags to trigger the Dirty Pipe vulnerability.
  3. Payload Injection: A custom ELF shellcode is injected into the target file (e.g., a SUID binary).
  4. Hijack SUID Binary: The targeted binary is hijacked by overwriting its contents with the injected shellcode.
  5. Execute Hijacked Binary: The hijacked binary is executed, resulting in the spawning of a root shell.
  6. Restore Original Binary: The original content of the SUID binary is restored to avoid detection.
  7. Persistent Root Shell: A root shell is opened with elevated privileges.

Prerequisites

  • A Linux system running a vulnerable kernel version (5.8 to 5.16).
  • A SUID binary that can be exploited for privilege escalation.

Compilation and Running the Exploit

To compile the exploit, run the following command:

gcc dirtypipe.c -Wall -O2 -fno-pie -no-pie -o dirtypipe

Notes:

Ensure that the target SUID binary is exploitable and resides in a path that can be accessed by the user running the exploit.

The system must be running a vulnerable version of the Linux kernel (5.8 to 5.16).

Anti-Debugging Features The exploit contains an anti-debugging mechanism to prevent detection by debugging tools such as gdb. If the exploit detects the presence of a debugger, it will terminate early, making it more difficult for attackers to analyze the code.

How It Works: The exploit checks for debugging activity by inspecting /proc/self/status and uses ptrace system calls to detect if the program is being traced by a debugger.

If a debugger is detected, the exploit will stop executing and exit, making reverse engineering harder.

Disclaimer This exploit is provided for educational and research purposes only. Unauthorized use of this exploit is illegal and unethical. Running this exploit on any system without explicit permission from the system owner is prohibited and could result in legal consequences.

The author is not responsible for any damages, data loss, or legal ramifications resulting from the use or misuse of this exploit.

Download Tool

Related Tools

  • PEASS-ng

    PEASS - Privilege Escalation Awesome Scripts SUITE (with colors)

  • PrivescCheck

    Privilege Escalation Enumeration Script for Windows

  • LinEnum

    Scripted Local Linux Enumeration & Privilege Escalation Checks

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    869
  • 3

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    433
  • 4

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    374
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    367
  • 6

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    339

Explore all tools

Browse our collection of tools

View all tools →