Awesome-POC/操作系统漏洞/Windows远程桌面服务漏洞 CVE-2019-0708.md
2023-03-28 17:48:31 +08:00

83 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Windows远程桌面服务漏洞 CVE-2019-0708
## 漏洞描述
2019年5月14日微软发布了针对远程桌面服务的关键远程执行代码漏洞CVE-2019-0708的补丁该漏洞影响某些旧版本的Windows。攻击者一旦成功触发该漏洞便可以在目标系统上执行任意代码该漏洞的触发无需任何用户交互操作。这就意味着存在漏洞的计算机只要联网无需任何操作就可能遭遇黑客远程攻击运行恶意代码。其方式与2017年WannaCry恶意软件的传播方式类似。成功利用此漏洞的攻击者可以在目标系统完成安装应用程序查看、更改或删除数据创建完全访问权限的新账户等操作。
## 漏洞影响
该漏洞影响旧版本的Windows系统包括
```
Windows 7
Windows Server 2008 R2
Windows Server 2008
Windows 2003
Windows XP
```
Windows 8和Windows 10及之后版本不受此漏洞影响。
## 漏洞复现
测试环境:
![image-20230328160605922](images/image-20230328160605922.png)
将下载的exp分别放入或替换
```
/usr/share/metasploit-framework/lib/msf/core/exploit/rdp.rb
/usr/share//metasploit-framework/modules/auxiliary/scanner/rdp/rdp_scanner.rb
/usr/share/metasploit-framework/modules/auxiliary/scanner/rdp/cve_2019_0708_bluekeep.rb
```
升级msf
- 使用命令msfupdate按提示apt update
- apt install Metasploit-framework最后reload_all
启动Metasploit用search搜索0708使用use exploit/windows/rdp/cve_2019_0708_bluekeep_rce启用0708RDP模块攻击
![image-20230328160727201](images/image-20230328160727201.png)
用show options进行参数设置
这里只需要设置两项set rhosts 目标ip(我这里是192.168.106.149)以及set target 3
set target ID数字(可选为0-4)设置受害机机器架构wmware=3Virtualbox=2
![image-20230328160741117](images/image-20230328160741117.png)
成功利用。
到目前公开的利用代码可用于攻击 Windows 7 SP1 x64 与 Windows 2008 R2 x64的EXP不太稳定针对 Windows 7 SP1 x64攻击有蓝屏现象。
复现过程中出现的一些问题解决方法:
如提示Exploit failed: NameError undefined local variable or method `rdp_connect' for则需要替换下载的exp4个rb文件
如提示ForceExploit错误需要将ForceExploit设置为true
Windows2008 R2 x64 需要修改[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TerminalServer\WinStations\rdpwd\fDisableCam]值为0。
## 漏洞修复
安装微软的安全更新来给系统打上安全补丁:
- https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0708
同时针对已不受微软更新支持的系统Windows Server 2003和Windows XP提供的安全更新下载地址:
- https://support.microsoft.com/zh-cn/help/4500705/customer-guidance-for-cve-2019-0708
**缓解措施(在无法及时安装微软安全更新的情况下作为临时性解决方案)**
1.若用户不需要用到远程桌面服务,建议禁用该服务。
2.开启网络级别身份验证NLA此方案适用于Windows 7, Windows Server 2008, Windows Server 2008 R2。
以上措施只能暂时性针对该漏洞对系统进行部分缓解,强烈建议在条件允许的情况下及时安装微软安全更新。