diff --git a/CVE-2020-0796检测与修复.md b/CVE-2020-0796检测与修复.md new file mode 100644 index 0000000..8f92091 --- /dev/null +++ b/CVE-2020-0796检测与修复.md @@ -0,0 +1,70 @@ +## CVE-2020–0796检测与修复 + +漏洞影响版本: + +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版(服务器核心安装) + +**漏洞检测工具** + +python版本 + +来源:https://github.com/ollypwn/SMBGhost/blob/master/scanner.py + +```python +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版本: + +```shell + +#!/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 +``` + +**漏洞缓解方法** + +Disable compression: + +> Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” DisableCompression -Type DWORD -Value 1 -Force + +Enable compression: + +> Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” DisableCompression -Type DWORD -Value 0 -Force \ No newline at end of file diff --git a/README.md b/README.md index c487c28..6562734 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ - [CVE-2020-0674: Internet Explorer远程代码执行漏洞检测](https://github.com/binaryfigments/CVE-2020-0674) - [CVE-2020-8794: OpenSMTPD 远程命令执行漏洞](./CVE-2020-8794-OpenSMTPD%20远程命令执行漏洞.md) - [Linux平台-CVE-2020-8597: PPPD 远程代码执行漏洞](https://github.com/marcinguy/CVE-2020-8597) -- [Windows-CVE-2020-0796:疑似微软SMBv3协议“蠕虫级”漏洞](https://cert.360.cn/warning/detail?id=04f6a686db24fcfa478498f55f3b79ef)|[相关讨论](https://linustechtips.com/main/topic/1163724-smbv3-remote-code-execution-cve-2020-0796/) +- [Windows-CVE-2020-0796:疑似微软SMBv3协议“蠕虫级”漏洞](https://cert.360.cn/warning/detail?id=04f6a686db24fcfa478498f55f3b79ef)|[相关讨论](https://linustechtips.com/main/topic/1163724-smbv3-remote-code-execution-cve-2020-0796/)|[CVE-2020–0796检测与修复](CVE-2020–0796检测与修复.md) ## tools-[小工具集合](./tools)