GithubHelp home page GithubHelp logo

majicmike / cve-2022-0847-dirtypipe-exploits Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexisahmed/cve-2022-0847-dirtypipe-exploits

0.0 0.0 0.0 16 KB

A collection of exploits and documentation that can be used to exploit the Linux Dirty Pipe vulnerability.

Shell 0.54% C 99.46%

cve-2022-0847-dirtypipe-exploits's Introduction

Dirty Pipe

CVE-2022-0847-DirtyPipe-Exploits

A collection of exploits and documentation for penetration testers and red teamers that can be used to aid the exploitation of the Linux Dirty Pipe vulnerability.

About The Vulnerability

  • Dirty Pipe (CVE-2022-0847) is a local privilege escalation vulnerability in the Linux kernel that could potentially allow an unprivileged user to do the following:
    • Modify/overwrite arbitrary read-only files like /etc/passwd.
    • Obtain an elevated shell.

Affected versions

DirtyPipe Vulnerability Scanner

Compiling the exploit

  • An automated compiler bash script has been provided to you to automate the compilation of both exploits.
  • In order to compile the exploit succesfully, you will need to have GCC installed.
sudo apt-get install gcc
  • After installing GCC, you can run the 'compile.sh" script as follows:
chmod +x compile.sh
./compile.sh

Exploit-1 - Modifying/overwriting read only files

  • This repo contains 2 exploits, the 'exploit-1.c' exploit can be used to modify or overwrite arbitrary read only files.
  • This exploit is a proof of concept that was developed by Max Kellermann and has been modified to change the root password in the /etc/passwd file, consequently providing you with access to an elevated shell.

Running the exploit binary

  • The exploit code has already been configured to replace the root password with the password "piped" and will take a backup of the /etc/passwd file under /tmp/passwd.bak. Furthermore, the exploit will also provide you with an elevated root shell and will restore the original passwd file when done.
./exploit-1

Exploit-2 - Hijacking SUID binaries

  • This exploit can be used to inject and overwrite data in read-only SUID process memory that run as root.

Finding SUID binaries

find / -perm -4000 2>/dev/null

Running the exploit binary

./exploit-2 /usr/bin/sudo

Important Note

  • I do not claim credit/ownership/disclosure of the vulnerability and all corresponding exploits hosted in this GitHub repo.
  • All the credit goes to the awesome Max Kellerman, you can check out the official disclosure here: https://dirtypipe.cm4all.com/

Credits

cve-2022-0847-dirtypipe-exploits's People

Contributors

alexisahmed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.