
Dirty Cow exploit - CVE-2016-5195
Dirty COW ist eine Local Privilege Escalation (LPE) im Linux-Kernel, bekannt als CVE-2016-5195. :contentReference[oaicite:0]{index=0}
Allgemein betrifft Dirty COW Linux-Kernel 2.x bis 4.x vor 4.8.3. :contentReference[oaicite:1]{index=1}
Einige Distributionen haben den Patch bereits zurückportiert, daher kann die Kernel-Version „alt“ aussehen, aber dennoch sicher sein.
Dirty COW wurde in folgenden Kerneln gepatcht (und neueren):
Überprüfen Sie die Kernel-Version des Ziels:
uname -r
# dirtycow
This exploit uses the pokemon exploit of the dirtycow vulnerability as a base and automatically generates a new passwd line.
The user will be prompted for the new password when the binary is run.
The original /etc/passwd file is then backed up to /tmp/passwd.bak and overwrites the root account with the generated line.
After running the exploit you should be able to login with the newly created user.
To use this exploit modify the user values according to your needs.
The default user being created is `toor`.
Original exploit (dirtycow's ptrace_pokedata "pokemon" method):
https://github.com/dirtycow/dirtycow.github.io/blob/master/pokemon.c
Compile with:
```bash
gcc -pthread dirty.c -o dirty -lcrypt
Then run the newly create binary by either doing:
./dirty
or
./dirty my-new-password
Afterwards, you can either su toor or ssh toor@...
VERGESSEN SIE NICHT, IHRE /etc/passwd NACH DEM AUSFÜHREN DES EXPLOITS WIEDERHERZUSTELLEN!
mv /tmp/passwd.bak /etc/passwd
Exploit übernommen von Christian "firefart" Mehlmauer