S1xHcL's Blog.

CVE-2019-0708 复现

Word count: 831Reading time: 3 min
2019/09/09 Share

0x01 概要

上周末更新 CVE-2019-0708 , 经过踩坑现在可以对特定机器进行攻击

0x02 影响范围

1
2
3
4
5
6
7
8
9
10
Exploit targets:

Id Name
-- ----
0 Automatic targeting via fingerprinting
1 Windows 7 SP1 / 2008 R2 (6.1.7601 x64)
2 Windows 7 SP1 / 2008 R2 (6.1.7601 x64 - Virtualbox)
3 Windows 7 SP1 / 2008 R2 (6.1.7601 x64 - VMWare)
4 Windows 7 SP1 / 2008 R2 (6.1.7601 x64 - Hyper-V)

经测试,目前所公布的 exp 仅对虚拟机有效果

0x03 漏洞环境

本次的漏洞需要配置 WindowsKali Linux 两种环境

Windows 环境配置

系统安装

本篇使用 Vmware 安装 Windows 7 sp1 旗舰版

Windows 7 sp1 下载链接:
ed2k://|file|cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.iso|3420557312|B58548681854236C7939003B583A8078|/

ver

关闭防火墙

fire

远程桌面设置

开启3389端口

3389

在【控制面板】-【系统和安全】-【系统】-【远程设置】-【远程】中选择允许运行任意版本远程桌面的计算机连接

mstsc

Kali Linux 环境配置

Kali 中我们自己将攻击套件放到 msf 相对应文件夹中

bluekeep-exploit 下载

https://github.com/TinToSer/bluekeep-exploit

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

cve_2019_0708_bluekeep_rce.rb 需要自行添加文件夹,其余直接覆盖和替换原有文件即可

注意:添加完4个 .rb 文件后,需要先进入 metasploit-framework 使用 reload_all 命令重新加载0708RDP利用模块。

如果出现报错,请查看本篇第5部分

0x04 漏洞攻击

  1. 使用 0708 攻击模块

use

  1. 设置 RHOSTS (设置被攻击机IP)

ip

  1. 设置 targets (设置被攻击机型号)
1
2
3
4
5
6
7
8
9
10
Exploit targets:

Id Name
-- ----
0 Automatic targeting via fingerprinting
1 Windows 7 SP1 / 2008 R2 (6.1.7601 x64)
2 Windows 7 SP1 / 2008 R2 (6.1.7601 x64 - Virtualbox)
3 Windows 7 SP1 / 2008 R2 (6.1.7601 x64 - VMWare)
4 Windows 7 SP1 / 2008 R2 (6.1.7601 x64 - Hyper-V)

我们使用的是 Vmware ,所以 target 设置为 3

targets

  1. 攻击

exp

攻击成功


注:使用 info 可查看相关工具信息,使用 show options 可查看相关设置详情。另外,端口一般默认为3389,如有改动自行设置即可。

options

0x05 常见报错汇总

reload_all 加载失败

error1

解决方法:更新 msf 到最新版 5.0.46-dev

中科大源

1
2
3
#中科大
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib

攻击失败1

error2

提示不存在该漏洞

解决方法:

  1. 所使用的系统有问题(目前exp仅支持对win7 sp1 旗舰版/专业版 和 Win2008 R2)
  2. 远程桌面选项有误(参照本篇漏洞环境配置远程桌面部分)

攻击失败2

error3

解决方法:

重新导入 bluekeep-exploit 中4个rb文件

0x06 补充

Windows 2008 R2 版本利用需要先修改注册表信息

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

或者直接执行命令

1
2
@echo offcolor 1c sc config MpsSvc start= auto sc start MpsSvc reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v "fDenyTSConnections" /t REG_DWORD /d 0 /f 

0x07 后话

目前所公开的exp利用条件过多,如果有失败也属于正常现象
耐心等待更多的exp

CATALOG
  1. 1. 0x01 概要
  2. 2. 0x02 影响范围
  3. 3. 0x03 漏洞环境
    1. 3.1. Windows 环境配置
      1. 3.1.1. 系统安装
      2. 3.1.2. 关闭防火墙
      3. 3.1.3. 远程桌面设置
    2. 3.2. Kali Linux 环境配置
    3. 3.3. bluekeep-exploit 下载
  4. 4. 0x04 漏洞攻击
  5. 5. 0x05 常见报错汇总
    1. 5.1. reload_all 加载失败
    2. 5.2. 攻击失败1
    3. 5.3. 攻击失败2
  6. 6. 0x06 补充
  7. 7. 0x07 后话