Last active
August 29, 2015 13:56
-
-
Save jeremyroman/9020756 to your computer and use it in GitHub Desktop.
setuid by id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <unistd.h> | |
int main(int argc, char* argv[]) { | |
uid_t uid = (uid_t) atoi(argv[1]); | |
setuid(uid); | |
execl("/bin/sh", "sh", (char*) 0); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment