The Hackr

Get Instant Root Access in any Linux Distro using Dirty Cow (CVE-2016-5195) Privilege Escalation

Dirty COW (CVE-2016-5195) is a privilege escalation vulnerability in the Linux Kernel.

A race condition was found in the way the Linux kernel’s memory subsystem handled the copy-on-write (COW) breakage of private read-only memory mappings.

An unprivileged local user could use this flaw to gain write access to otherwise read-only memory mappings and thus increase their privileges on the system.


STEP 1 Download/copy the cowroot.c exploit from exploit db or the ‘Dirty Cow’ github page and save it as cowroot.c

STEP 2 Login using local or the non-root account in linux distro.

STEP 3 Check your privilege status using


STEP 4 Now that you are no super user, through the terminal,navigate to the where you’ve downloaded the exploit – cowroot.c

STEP 5 Now compile the exploit using

gcc -pthread cowroot.c -o cowroot

STEP 6 After compiling the program, run the exploit using


STEP 7 You would get a message like “racing, this may take a while” and wait until you get a root shell.

STEP 8 Now check your privilege status using to check whether you’ve achieved root or not.


I hope you enjoyed Dirty COW (CVE-2016-5195) demo.

NOTE This exploit presently freezes some systems momentarily after running the program.

I was able to stabilize this exploit by turning off periodic write-back after the shell pops. As found in the following issue.

echo 0 > /proc/sys/vm/dirty_writeback_centisecs

or get better exploit which disable the writeback and thus avoids freezing the computer from this link!


The hacking trend these days has definitely turned criminal because of e-commerce ¯\_(ツ)_/¯