Static analysis of malicious code analysis _Lab01-02_

The so-called bottomless abyss, down, also Mileage.
----- Wooden Heart

Lab01-02.exe

Questions and analysis:

First asked

The Lab01-02.exe file uploaded to http://www.VirusTotal.com/ analyze and view reports. File to match the existing features of anti-virus software do?

Chart analysis is as follows:

Here Insert Picture Description

From the above chart can be drawn about characteristics of the virus:

  1. Trojan / Win32.StartPage.C26214 modify the browser home page
  2. Click Trojan virus Trojan Clicker
  3. Trojan Generic: have suspected Trojan code function;
  4. TR / Downloader.Gen downloading function
  5. malware.gen record keyboard input, and came

The second question

Are there any signs of this file is packed or confusing? How so, what are these signs? If the file is packed, please shelling, if possible.
Here Insert Picture Description

By PEiDdetecting, as a detection result Nothing Found. That case is not found, there may be two reasons for this situation: 1 The program is not packed; 2 the program shell, but the shell is relatively new, the software can not be detected...

But I noticed EP Sectionthe logo is UPX1to prove that the exedocument is likely to use a UPXvariety of techniques, so PEiD will not identify them.

Then we use Dependency Walker, we will find the import table KERNEL32.DLL this code has two functions LoadLibraryA, GetProcAddressthese two functions are signs packers , packers because the program runs when the shelling is a must to two functions of.

Here Insert Picture Description

Here again using PE viewer further testing:
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

首先该程序的节部分就非常的可疑,这里显示的是UPX0,UPX1,UPX2.不是常见的.text .data .rdata .rsrc,很明显这是UPX加壳后的表现.下面通过虚拟大小与原始数据大小的对比就可以实锤UPX加壳了.

分节 虚拟大小 原始数据大小
UPX0 00004000 00000000
UPX1 00001000 00000600
UPX2 00001000 00000200

IMAGE_SECTION_HEADER UPX0中可得出Virtual Size00004000 Size of Raw Data00000000, 所以Virtual Size 比Size of Raw Data大
IMAGE_SECTION_HEADER UPX1IMAGE_SECTION_HEADER UPX2中的也是Virtual SizeSize of Raw Data大,所以可以确定该程序被加壳了.

并通过查资料该程序可能是UPX加壳,所以我们尝试一下脱壳:
使用UPX.exe进行脱壳,过程如下:
Here Insert Picture Description
Here Insert Picture Description
​ 脱壳成功!!!
Here Insert Picture Description

第三问

有没有任何导入函数能够暗示这个程序的功能?如果有,是哪些导入函数,它们会告诉你什么?

现在我们继续对脱壳后的程序分析,使用Dependency Walker对该程序进行分析:
Here Insert Picture Description
由上图可以看见该程序共有四个动态链接库:
KERNEL32.DLL ADVAPI32.DLL MSVCRT.DLL WININE.DLL
KERNEL32.DLL 中:
SystemTimeToFileTime是一个进程,即系统时间本地时间。
GetModuleFileNameA获取当前进程已加载模块的文件的完整路径,该模块必须由当前进程加载。
CreatWaitableTimerA创建计时器对象
ExitProcess退出程序
OpenMutex打开互斥
SetWaitableTimer启动一个可等待计时器
WaitForSingleObject
CreatMutex创建一个互斥体
CreatThread创建一个线程
Here Insert Picture Description
Advapi32.dll,使用了注册表,提醒我们注意程序中象注册表键值的字符串,还有服务管理.可能会恶意关闭一些服务是某些程序不能运行,或者自动开启一些服务.
Here Insert Picture Description

WININE.DLL使用了网络服务,InternetOpenUrl,可以访问网站,这里值得警惕,该恶意木马可能会通过访问网络下载更多病毒,或者实时监控该主机,InternetOpenA 初始化一个应用程序

第四问

哪些基于主机或基于网络的迹象可以被用来确定被这个恶意代码所感染的机器?

使用Strings.exe查看脱壳的程序,具体内容如下:
Here Insert Picture Description

出现可疑的URL: www.malwareanalysisbook.com 还有IE8.0 推测应该是使用IE打开该网站

关键提示:

1、使用virustotal.com查看程序,分析报告;
2、用PEview分析是否加壳(注意该程序的节与其它程序的节的区别);
3、UPX0的虚拟大小是多少?实际大小是多少?属性(characteristics)中,表明这个节是否能够运行?
4、这个程序通过UPX工具加壳。
5、使用upx -d 进行脱壳,然后再分析。
upx -o newFilename -d originalFilename
-d 脱壳
-o 指定输出文件名
6、使用Study_PE查看脱壳后的文件:导入函数有哪些?哪些是常用的?
wininet.dll的作用是什么?使用了哪些函数?可能做出什么样的恶意操作?
advapi32.dll的作用是什么?使用了哪些函数?可能做出什么样的恶意操作?
7、使用strings查看字符串。字符串中是否有URL?程序可能会用哪个函数处理这个URL?
注意到Malservice这个字符串吗?猜猜这个字符串的作用是什么?

引用

1.《 Practical Malware Analysis 》 By Michael Sikorski, Andrew Honig · 2012
2. 以及网上前辈的一些作品,由于查阅过多过细,这里就不一一例举。

发布了6 篇原创文章 · 获赞 4 · 访问量 310

Guess you like

Origin blog.csdn.net/qq_43605381/article/details/104062188