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
DirtyPipePython — A Python-based DirtyPipe (CVE-2022-0847) POC to pop a root shell | Kitploit
Tools/GitHubGitHub/crusoe112/dirtypipepython
Privilege EscalationPayload GenerationVulnerability AnalysisExploitationPenetration TestingBinary Exploitation
GitHubcrusoe112/dirtypipepython

DirtyPipePython

A Python-based DirtyPipe (CVE-2022-0847) POC to pop a root shell

View Repository
10828Mar 23, 2022Not yet reviewed
Share

dirty.py

Description

This is an exploit for the Linux kernel vulnerability CVE-2022-0847 (DirtyPipe) discovered by Max Kellerman.

This code combines two existing DirtyPipe POC's into one:

  • febinrev
    • Overwrites sudo binary to directly pop a root shell
  • eremus-dev
    • A direct copy of Kellerman's POC into Python

This code checks if:

  • /etc/passwd can be overwritten to get a root shell
  • The sudo binary can be overwritten to get a root shell
  • The su binary can be overwritten to get a root shell
  • The current user can be added to the sudo group in /etc/group

It then executes the first option that is possible in that order and drops the user directly into a root shell.

For an excellent explanation of the vulnerability itself, see Kellerman's writeup.

Getting Started

Requires python 10.X for the use of os.splice

Usage

usage: dirty.py [-h] [--target {passwd,group,sudo,su}]

Use dirty pipe vulnerability to pop root shell

options:
  -h, --help            show this help message and exit
  --target {passwd,group,sudo,su}
                        The target read-only file to overwrite

Examples

Try all targets until one works

vulnerable@kali:~$ python dirty.py

Try a specific target

vulnerable@kali:~$ python dirty.py --target passwd

Cleanup

The script may write several files to /tmp:

  • /tmp/backup_sudo
  • /tmp/backup_su
  • /tmp/passwd
  • /tmp/sh
  • /tmp/group

The generated files should be removed after execution, but may require root access to do so.

Dealing with errors

This exploit will overwrite a page of the file that resides in the page cache. It is unlikely to corrupt the actual file. If there is corruption or an error, you likely just need to wait until the page is overwritten in the cache, or restart your computer to fix any problems. That being said, I bear no responsibility for damage done by this code, so please read carefully and hack responsibly. Be sure to check out Max Kellerman's writeup at cm4all.com as well.

Acknowledgements

  • Max Kellerman
  • febinrev
  • eremus-dev
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.3k
  • 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.

    843
  • 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.

    445
  • 4

    ARTEX

    baarai/artex

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

    387
  • 5

    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.

    352
  • 6

    faraday

    infobyte/faraday

    Open-source and AI-powered cybersecurity tools for offensive security, vulnerability management, and autonomous pentesting. Built by hackers in Latin America, used worldwide.

    344

Explore all tools

Browse our collection of tools

View all tools →