🌐
GitHub
github.com › j0nk0 › GetRoot-Android-DirtyCow
GitHub - j0nk0/GetRoot-Android-DirtyCow: Get temporary root by exploiting the dirtycow vulnerability. · GitHub
Get temporary root on android by exploiting the dirtycow vulnerability.
Starred by 112 users
Forked by 28 users
Languages   Shell 58.8% | C 36.3% | Makefile 4.9%
🌐
Book-of-gehn
book-of-gehn.github.io › articles › 2021 › 08 › 22 › Rooting-Android-with-a-Dirty-COW.html
Rooting Android with a Dirty COW
August 22, 2021 - In short, it exploits a race condition in the Copy-on-Write (COW) feature in Linux kernel to write in memory pages that are supposed to be read-only. This opens a whole set of opportunities to priv-esc: we could write a setuid program with our payload, execute it and gain root permissions.
Discussions

root access - How to use Dirty COW exploit? - Android Enthusiasts Stack Exchange
I got Sony Xperia M4 Aqua with a locked bootloader, Android 6.01, and July 1, 2016 security patch, but no DM verity. I would like to freeze a few factory apps via ADB's pm disable command (or any o... More on android.stackexchange.com
🌐 android.stackexchange.com
Root tool DirtyCow Apk && adb
Hi, I have developed a tool to exploit the dirtycow vulnerability and get TEMPORAL ROOT It bypass the selinux in lollipop 32bits system only, we are working now in a 64bits and Marshmallow version and will be soon, have a lot of work to do it... More on xdaforums.com
🌐 xdaforums.com
264
December 24, 2016
Dirty cow exploit - Allows root access on any version of linux and even android. All about the exploit, how it works.
I'm betting a dollar that someone is going to try and claim that Linux is bad because of this. Not trying to come off as aggressive, but I just bet it'll happen. More on reddit.com
🌐 r/pcmasterrace
52
141
October 29, 2016
Now android phones are being rooted via Linux "Dirty Cow" exploit - what does this mean for Linux?

For linux: nothing. For android: a lot.
It was already patched in linux but not in android. And since android updates are hard to come...

More on reddit.com
🌐 r/linux
284
384
October 24, 2016
computer security vulnerability
Dirty COW (Dirty copy-on-write) is a computer security vulnerability of the Linux kernel that affected all Linux-based operating systems, including Android devices, that used older versions of the Linux kernel created before … Wikipedia
Factsheet
CVE identifier CVE-2016-5195
Discoverer Vulnerability: unknown
Exploit code: Phil Oester
Affected software Linux kernel (<4.8.3)
Factsheet
CVE identifier CVE-2016-5195
Discoverer Vulnerability: unknown
Exploit code: Phil Oester
Affected software Linux kernel (<4.8.3)
🌐
Wikipedia
en.wikipedia.org › wiki › Dirty_COW
Dirty COW - Wikipedia
April 1, 2026 - Although it is a local privilege ... code to achieve remote root access on a computer. The attack itself does not leave traces in the system log. The vulnerability has the Common Vulnerabilities and Exposures designation CVE-2016-5195. Dirty Cow was one of the first security ...
🌐
University of Toronto
cs.toronto.edu › ~arnold › 427 › 18s › 427_18S › indepth › dirty-cow › index.html
Dirty Cow
It allowed processes to write to read-only files. This exploit made use of a race condition that lived inside the kernel functions which handle the copy-on-write (COW) feature of memory mappings. An example use case includes over-writing a user's UID in /etc/passwd to gain root privileges.
Top answer
1 of 3
4

The reason the command isn't working for you is because "su" is a binary that gets installed by rooting your device. Without a proper root, you have no "su" command.

In order to use the Dirty COW exploit, you have to compile the binary for your device's architecture.

  • Head over to https://github.com/timwr/CVE-2016-5195 and download or git clone the files.

  • (Optional) If you do not know your device architecture, then on the phone, install the "Droid Hardware Info" app from Play Store, open it, and swipe left to get to the System tab. Next to the label "Instruction Sets" will be your supported architecture.

  • On your computer, open a terminal and navigate to where the Dirty COW files are (extract if needed). Then simply type make (insert architecture here). This will create two binaries inside the folder at libs/(your_architecture)/ called dirtycow & run-as. Alternatively, if you have USB Debugging enabled, then simply attach the device and type make root and it will push the binaries into your device at /data/local/tmp, then automate a few ADB commands to exploit and grant you a limited root shell.

  • If you don't see the terminal user icon as # and instead see a $, then the exploit didn't work at some point. Since the files are still on the device, I would suggest to then try and manually patch run-as by using adb shell and typing the following...

    chmod 777 /data/local/tmp/*
    dirtycow /data/local/tmp/run-as /system/bin/run-as
    /system/bin/run-as
    

    If this doesn't prompt you as root user (#), then the exploit won't work for your device in this fashion and you'll need to do some digging into why not. If this happens, try opening an Issue on the Github repo, it's still pretty active so you should have an answer before long.

2 of 3
1

To supplement therealjayvi's answer, note that compiling and using CVE-2016-5195 from timwr requires both ADB and NDK to be installed as well, prior to make [architecture] and make root, and that this must be done from a Linux environment.

All were either assumed that the prerequisites were obtained before doing this, prerequisites may have been added after comment, or little to nothing was known about exploit CVE-2016-5195 from the person who made the comment.

Anyways, this can all be done through: first, being in Linux (Ubuntu, Debian, Mint, ext.) and assuming that adb is in your list of repositories for apt as it usually is by default but not all the time. If sudo isn't present, use su.

sudo apt-get install android-tools-adb

Get latest Linux download from here, then extract and run:

export PATH=$PATH:/root/directory/of/ndk/

You may need to re-run export if you close the current terminal, as I cannot find a solution that stays.

Once all that is done, then you can follow @therealjayvi's way of going about this.

🌐
GitHub
github.com › dirtycow › dirtycow.github.io › wiki › PoCs
PoCs
October 21, 2016 - Gives the user root by injecting shellcode into a SUID file. implemented for amd64 in flatassembly. ... Allows user to write on files meant to be read only. implemented for arm32/x86/amd64 in Golang faster than c implement. https://github.c...
Author   dirtycow
🌐
Jit
jit.io › resources › app-security › 7-tips-to-protect-yourself-from-dirty-cow-exploit
7 Tips to Protect Yourself from Dirty Cow Exploit | Jit
October 22, 2024 - When vulnerabilities like Dirty ... can be compromised. Discovered in the Linux kernel, Dirty Cow is infamous for enabling unauthorized privilege escalation, allowing attackers to manipulate and execute code at the root level....
Find elsewhere
🌐
XDA Forums
xdaforums.com › home › general development › android development and hacking › android software/hacking general [developers only]
Root tool DirtyCow Apk && adb | XDA Forums
December 24, 2016 - Hi, I have developed a tool to exploit the dirtycow vulnerability and get TEMPORAL ROOT It bypass the selinux in lollipop 32bits system only, we are working now in a 64bits and Marshmallow version and will be soon, have a lot of work to do it universal. Im bringing 2 tools, one apk (no computer required) and one rar for adb and linux.
🌐
Jhu
spar.isi.jhu.edu › teaching › 443 › assignment4 › part2 › Dirty_COW.pdf pdf
601.443/643 – Dirty COW Attack Lab 1 Part 2: Dirty COW Attack Lab
It existed in the · Linux kernel since September 2007, and was discovered and exploited in October 2016. The vulnerability · affects all Linux-based operating systems, including Android, and its consequence is very severe: attackers · can gain the root privilege by exploiting the vulnerability.
🌐
YouTube
youtube.com › watch
Explaining Dirty COW local root exploit - CVE-2016-5195 - YouTube
Video walkthrough the dirtyc0w privilege escalation exploit. Exploiting a Kernel race-condition.site: http://dirtycow.ninja/Patch: https://git.kernel.org/cgi...
Published   October 21, 2016
🌐
Reddit
reddit.com › r/pcmasterrace › dirty cow exploit - allows root access on any version of linux and even android. all about the exploit, how it works.
r/pcmasterrace on Reddit: Dirty cow exploit - Allows root access on any version of linux and even android. All about the exploit, how it works.
October 29, 2016 - I meant I didn't understand how Cow changed to root password, when it alters the physical space it redirects the appropriate process to a different physical space and copies to alteration, how does this affect root without actually altering it from root, why doesn't it just redirect the dirtycow process.
🌐
Trend Micro
trendmicro.com › en_us › research › 17 › i › zniu-first-android-malware-exploit-dirty-cow-vulnerability.html
ZNIU: First Android Malware to Exploit Dirty COW | Trend Micro (US)
September 25, 2017 - The vulnerability was discovered in upstream Linux platforms such as Redhat, and Android, which kernel is based on Linux. It was categorized as a serious privilege escalation flaw that allows an attacker to gain root access on the targeted system.
🌐
Red Hat
redhat.com › en › blog › understanding-and-mitigating-dirty-cow-vulnerability
Understanding and mitigating the Dirty Cow Vulnerability
November 17, 2025 - In order to be successful, an attacker ... Dirty Cow works by creating a race condition in the way the Linux kernel's memory subsystem handles copy-on-write (COW) breakage of private read-only memory mappings....
🌐
TechTarget
techtarget.com › searchsecurity › answer › How-can-the-Dirty-COW-vulnerability-be-used-to-attack-Android-devices
How can the Dirty COW vulnerability be used to attack Android devices? | TechTarget
March 7, 2017 - The recently discovered Dirty COW Linux kernel vulnerability, which can allow an attacker to gain root access, has also been found to affect Android devices running on ARM chips.
🌐
MobileEdit
support.mobiledit.com › portal › en › kb › articles › dirty-cow-hack
Rooting a device (Dirty cow) - Manuals - MOBILedit
To achieve a successful phone connection, there are a few important steps that must be taken for this or any other tool. This is only required for the first time, then you can enjoy the functionality of all our products. An Android phone can be · Whats is supported Windows Phone is a very ...
🌐
ResearchGate
researchgate.net › figure › The-code-for-Dirty-COW-exploit-calling-the-root-function_fig9_316989907
The code for Dirty COW exploit: calling the root function | Download Scientific Diagram
In this function the root file is called as read-only (O RDONLY flag) as shown in Figure 5. The next is executing the "mmap" command to create a new mapping in the virtual address space of the etc/passwd process.
🌐
Cyberbit
materials.rangeforce.com › tutorial › 2019 › 11 › 07 › Dirty-Cow
Dirty Cow – Cyberbit
Dirty COW allows processes to write to read-only files. This exploit makes use of a race condition that lives inside the kernel function which handles the copy-on-write feature of memory mappings. A race condition occurs when two or more process threads can access shared data and they try to ...
🌐
GitHub
github.com › talsim › root-dirtyc0w
GitHub - talsim/root-dirtyc0w: DirtyCow root privilege escalation (CVE-2016-5195) · GitHub
An example use case of this vulnerability includes overwriting any SUID (Set User ID) binary such as passwd executable with a different elf executable (which we create) that executes /bin/sh to gain root privileges (as shown in this repository). You can find more executables in Linux that have the SUID bit set and change them in the exploit code here: https://pentestlab.blog/2017/09/25/suid-executables/ Privilege Escalation PoC: Exploiting Dirty COW for Root Access (CVE-2016-5195) - Ran on Kali Linux 2016.2
Starred by 4 users
Forked by 2 users
Languages   C 96.8% | Makefile 3.2%
🌐
Seedsecuritylabs
seedsecuritylabs.org › Labs_16.04 › Software › Dirty_COW
Dirty-COW Attack Lab
It existed in the Linux kernel since September 2007, and was discovered and exploited in October 2016. The vulnerability affects all Linux-based operating systems, including Android, and its consequence is very severe: attackers can gain the root privilege by exploiting the vulnerability.
🌐
GitHub
github.com › davidqphan › DirtyCow
GitHub - davidqphan/DirtyCow: Dirty Cow proof of concept app · GitHub
In order to use our exploit to get access to a root shell, we use the Dirty COW exploit to overwrite a read-only binary in the device’s /system/bin path. This specific binary has the setuid bit that allows the process to run as the root user.
Starred by 2 users
Forked by 2 users
Languages   Java