CVE-2020-0796:疑似微软SMBv3协议“蠕虫级”漏洞的检测与修复
时间:2020-3-12 11:18 作者:admin 分类: 网络安全
0x1:背景
2020年3月11日,海外厂家发布安全规则通告,通告中描述了一处微软SMBv3协议的内存破坏漏洞,编号CVE-2020-0796,并表示该漏洞无需授权验证即可被远程利用,可能形成蠕虫级漏洞。
0x2:受影响版本
Windows 10版本1903(用于32位系统)
Windows 10版本1903(用于基于ARM64的系统)
Windows 10版本1903(用于基于x64的系统)
Windows 10版本1909(用于32位系统)
Windows 10版本1909(用于基于ARM64的系统)
Windows 10版本1909(用于)基于x64的系统
Windows Server 1903版(服务器核心安装)
Windows Server 1909版(服务器核心安装)
0x3:漏洞检测复现
如上图所示,在未停用 SMBv3 中的压缩功能时,我的测试机器win10 1909 18363.719是存在漏洞的,在powershell停用 SMBv3 中的压缩功能后,再次检测就不存在了,暂时只有这个缓解措施,还没有补丁。
0x4:漏洞检测工具
python版本
来源:https://github.com/ollypwn/SMBGhost/blob/master/scanner.py
import socket import struct import sys pkt = b'\x00\x00\x00\xc0\xfeSMB@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$\x00\x08\x00\x01\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00x\x00\x00\x00\x02\x00\x00\x00\x02\x02\x10\x02"\x02$\x02\x00\x03\x02\x03\x10\x03\x11\x03\x00\x00\x00\x00\x01\x00&\x00\x00\x00\x00\x00\x01\x00 \x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\n\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00' sock = socket.socket(socket.AF_INET) sock.settimeout(3) sock.connect(( sys.argv[1], 445 )) sock.send(pkt) nb, = struct.unpack(">I", sock.recv(4)) res = sock.recv(nb) if not res[68:70] == b"\x11\x03": exit("Not vulnerable.") if not res[70:72] == b"\x02\x00": exit("Not vulnerable.") exit("Vulnerable.")
nmap版本:
#!/bin/bash if [ $# -eq 0 ] then echo $'Usage:\n\tcheck-smb-v3.11.sh TARGET_IP_or_CIDR {Target Specification - Nmap}' exit 1 fi echo "Checking if there's SMB v3.11 in" $1 "..." nmap -p445 --script smb-protocols -Pn -n $1 | grep -P '\d+\.\d+\.\d+\.\d+|^\|.\s+3.11' | tr '\n' ' ' | tr 'Nmap scan report for' '@' | tr "@" "\n" | tr '|' ' ' | tr '_' ' ' | grep -oP '\d+\.\d+\.\d+\.\d+' if [[ $? != 0 ]]; then echo "There's no SMB v3.11" fi
0x5:漏洞缓解措施
powershell 中运行如下命令:
# 停用 Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" DisableCompression -Type DWORD -Value 1 -Force # 恢复 Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" DisableCompression -Type DWORD -Value 0 -Force
0x6:漏洞修复
微软昨日发布了更新补丁,下载地址:
https://www.catalog.update.microsoft.com/Search.aspx?q=KB4551762
也可以自行在Windows的更新管理界面手动更新,也可以更新下载补丁.
推荐阅读: