3CX供应链攻击样本分析
ffmpeg.dll

3CXDesktopApp.exe 会侧加载 ffmpeg.dll,ffmpeg.dll 中包含恶意代码,也包含正常的功能。
创建名为 AVMonitorRefreshEvent 的事件,修改当前模块的文件名,将 d3dcompiler_47.dll 文件侧加载到系统中 。

读取 d3dcompiler_47.dll 中加密的 Shellcode,该 Shellcode 以 8 字节序列 "0xFE 0xED 0xFA 0xCE 0xFE 0xED 0xFA xCE" 开始

用 RC4 算法解密 d3dcompiler_47.dll 中加密的shellcode ,密钥为 3jB(2bsG#@c7

d3dcompiler_47.dll
d3dcompiler_47.dll (MD5:82187AD3F0C6C225E2FBA0C867280CC9),在此 dll 中可定位到加密的shellcode

解密的dll
ICO文件
其中一个 ICO 文件末尾文件内容如下:

该 ICO 文件 MD5:1640f48cc05c58f4cc077503a5361cea,来自 https://unit42.paloaltonetworks.com/3cxdesktopapp-supply-chain-attack/
解密脚本:https://github.com/volexity/threat-intel/blob/main/2023/2023-03-30%203CX/attachments/decrypt_ico.py

解密结果为:https://azureonlinestorage.com/azure/storage ,这是其中一个 C2 地址。通过 C2 服务器下载 config.json 配置文件,最终会产生最终有效载荷文件。
最终payload
最终payload为64位的 dll (MD5:7FAEA2B01796B80D180399040BB69835),
DllGetClassObject 函数中包含恶意代码,通过 NetWkstaGetInfo、RtlGetVersion 获取当前计算机的工作站信息和当前操作系统的版本信息

将获取的数据格式化,以便于向 C2 传输数据

检索 AppData\Local\Google\Chrome\User Data、AppData\Local\Microsoft\Edge\User Data 、AppData\Local\BraveSoftware\Brave 目录下的 History 文件和 AppData\Roaming\Mozilla\Firefox\Profiles 下的 places.sqlite 文件,即查找 Chrome、Edge、Brave、Firefox 浏览器的储存历史记录的数据库文件

复制数据库文件,然后通过执行SQLite语句 SELECT url, title FROM urls ORDER BY id DESC LIMIT 500 、SELECT url, title FROM moz_places ORDER BY id DESC LIMIT 500 查询前500条已发现的浏览器数据库,并解析 URL 和标题,把相关数据发送至 C2 服务器

参考
https://www.splunk.com/en_us/blog/security/splunk-insights-investigating-the-3cxdesktopapp-supply-chain-compromise.html
https://unit42.paloaltonetworks.com/3cxdesktopapp-supply-chain-attack/
https://news.sophos.com/en-us/2023/03/29/3cx-dll-sideloading-attack/
更多【3CX供应链攻击样本分析】相关视频教程:www.yxfzedu.com