Skip to content

Instantly share code, notes, and snippets.

@ngaro
ngaro / dirty_passwd_adjust_cow.c
Last active November 20, 2023 03:44
A dirty cow exploit that automatically finds the current user in passwd and changes it's uid to 0
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>