mirror of
https://github.com/Mr-xn/Penetration_Testing_POC.git
synced 2025-08-13 03:17:26 +00:00
add CVE-2020-0796 微软SMBv3协议“蠕虫级”漏洞检测与修复
This commit is contained in:
parent
2926ad8648
commit
6d9e9ff799
70
CVE-2020-0796检测与修复.md
Normal file
70
CVE-2020-0796检测与修复.md
Normal file
@ -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
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user