網絡安全公司,Metastealer 接棒 Racoon stealer 進行竊密

  • 作者:
  • 時間:2022-05-29 09:29:34
簡介 網絡安全公司,Metastealer 接棒 Racoon stealer 進行竊密

MetaStealer 是一個新出現的竊密惡意軟件,該惡意軟件旨在填補 2022 年 3 月份 Racoon stealer 停止運營帶來的市場空白。

以色列暗網情報公司 Kela 的分析人員首先在地下市場確認了 MetaStealer 的出現,緊接著 SANS 確認該惡意軟件參與了垃圾郵件攻擊。

image.png-84kB攻擊鏈

技術分析

檢測繞過

最開始 Metastealer 使用 PowerShell 執行命令?powershell -inputformat none -outputformat none –NonInteractive -Command Add-MpPreference -ExclusionExtension "exe"。

該命令為 Microsoft Defender 添加了例外規則,將?.exe擴展名排除在掃描外。這樣降低了惡意軟件與攻擊者投遞的其他 Payload 被檢測的概率。

image.png-30.9kBMicrosoft Defender

在處理 Microsoft Defender 后,Metastealer 使用另一個 PowerShell 命令將文件重命名為固定名稱:powershell rename-item -path .xyz -newname hyper-v.exe。

持久化

Metastealer 使用組件對象模型(COM)在?\Microsoft\Windows’下創建名為?sys的計劃任務。該計劃任務會在用戶登錄時觸發,確保惡意軟件在計算機重啟后仍能持久化存在。

image.png-77.2kB計劃任務

字符串混淆

Metastealer 的大部分字符串都是加密的,在運行時根據需要進行解密。加密字符串都被放置在棧上,使用按位異或進行解密。

image.png-51kB字符串混淆邏輯

Python 等效代碼如下所示:

def swap32(x):return int.from_bytes(x.to_bytes(8, byteorder='little'), byteorder='big', signed=False)def split_hex(input):text = hex(input)text = text[2:]text = text.zfill(len(text) + len(text) % 2)output = " ".join(text[i: i+2] for i in range(0, len(text), 2))return(output.split(' '))hexIntXOR = []hexIntKey = []hexIntXOR.append(0x4BFB9390)hexIntXOR.append(0x25C2F251)hexIntXOR.append(0x11C52ED4)hexIntXOR.append(0x5CEDBB0D)hexIntKey.append(0x2489FBF3)hexIntKey.append(0x25C2973C)hexIntKey.append(0x11C52ED4)hexIntKey.append(0x5CEDBB0D)hexbytesxor = []hexbyteskey = []for HexInt in hexIntXOR:hexBytes = split_hex(HexInt)hexBytes.reverse()hexbytesxor = hexbytesxor + hexBytesfor HexInt in hexIntKey:hexBytes = split_hex(HexInt)hexBytes.reverse()hexbyteskey = hexbyteskey + hexBytescount = 0for hexByte in hexbytesxor:print(chr(int(hexByte, base=16) ^ int(hexbyteskey[count], base=16)), end='')count+=1

C&C

分析時 C&C 上線雖然能夠成功,但后續的請求會返回 HTTP 400 錯誤。這可能表示該攻擊是短期的,對新感染者不再下發指令。也有可能是為了限制分析人員對 C&C 通信的分析。

樣本總硬編碼的 C&C 服務器為?193.106.191.162:1775,該地址也是被加密存儲的。

使用?cpp-httplib通過 User Agent 為?cpp-httplib/0.10.1的 HTTP 請求連接 C&C 服務器。

初始請求路徑為?/api/client/new,僅用于注冊上線:

image.png-171kB注冊上線

響應中返回的 UUID 作為?BotId,每個上線請求都會返回一個新的 UUID。

使用 Nlohmann JSON 解析 JSON 字符串提取?BotId,并以明文形式寫入文件?%localappdata%\hyper-v.ver。

隨后的 C&C 通信以 UUID 為請求內容:

image.png-57.2kBUUID

POST 請求發送給?/tasks/get_worker,分析時 C&C 服務器只響應 HTTP 400 錯誤代碼。

image.png-120.4kBC&C 通信

執行命令后,執行結果會發送到?/tasks/collect,其中包含竊密數據或者命令執行輸出。

C&C 命令

命令ID功能描述
1001收集系統信息通過 cmd.exe 獲取系統信息
1002竊取 Cookie竊取 Chrome、Firefox 與 Edge 瀏覽器的 Cookie
1003竊取密碼竊取 Chrome、Firefox 與 Edge 瀏覽器的密碼
1004啟動鍵盤記錄針對 Chrome、Firefox 與 Notepad 啟動鍵盤記錄
1005停止鍵盤記錄
1006啟動 HVNC利用 Kissnet 創建 HVNC 連接
1007停止 HVNC
1008執行命令通過 cmd.exe 執行命令

IOC

193.106.191[.]162:1775
cpp-httplib/0.10.1
hyper-v.exe

Yara

rule metaStealer_memory {meta:description = "MetaStealer Memory"author = "Peter Gurney"date = "2022-04-29"strings:$str_c2_parse = {B8 56 55 55 55 F7 6D C4 8B C2 C1 E8 1F 03 C2 8B 55 C0 8D 04 40 2B 45 C4}$str_filename = ".xyz -newname hyper-v.exe" fullword wide$str_stackstring = {FF FF FF C7 85 ?? ?? ?? ?? ?? ?? ?? ?? C7 85 ?? ?? ?? ?? ?? ?? ?? ?? C7 85 ?? ?? ?? ?? ?? ?? ?? ?? C7 85 ?? ?? ?? ?? ?? ?? ?? ?? 66 0F EF}condition:uint16(0) == 0x5a4d and2 of ($str_*)}

參考來源

NCCGroup

韩国19禁A片在线播放,色猫咪免费人成网站在线观看,中国最猛性XXXXX,五月天天爽天天狠久久久综合