Lab 6-4

In this lab, we’ll analyze the malware found in the file Lab06-04.exe.

Questions and Short Answers

  1. What is the difference between the calls made from the main method in Labs 6-3 and 6-4?

    A: The function at 0x401000 is the check Internet connection method, 0x401040 is the parse HTML method, 0x4012B5 is printf, and 0x401150 is the switch statement.

  2. What new code construct has been added to main?

    A: A for loop has been added to the main method.

  3. What is the difference between this lab’s parse HTML function and those of the previous labs?

    A: The function at 0x401040 now takes a parameter and calls sprintf with the format string Internet Explorer 7.50/pma%d. It builds a User-Agent for use during HTTP communication using the argument passed in.

  4. How long will this program run? (Assume that it is connected to the Internet.)

    A: This program will run for 1440 minutes (24 hours).

  5. Are there any new network-based indicators for this malware?

    A: Yes, a new User-Agent is used. It takes the form Internet Explorer 7.50/
    pma%d, where %d is the number of minutes the program has been running.

  6. What is the purpose of this malware?

    A: First, the program checks for an active Internet connection. If none is found, the program terminates. Otherwise, the program will use a unique User-Agent to attempt to download a web page containing a counter that tracks the number of minutes the program has been running. The web page downloaded contains an embedded HTML comment starting with <!--. The next character is parsed from this comment and used in a switch statement to determine the action to take on the local system. These are hard-coded actions, including deleting a file, creating a directory, setting a registry run key, copying a file, and sleeping for 100 seconds. This program will run for 24 hours before terminating.

Detailed Analysis

We begin by performing basic static analysis on the binary. We see one new string of interest that was not in Lab 6-3, as follows:

Internet Explorer 7.50/pma%d

605033-20190114163946210-1314509411.png

It looks like this program may use a dynamically generated User-Agent. Looking at the imports, we don’t see any Windows API functions that were not in Lab 6-3. When performing dynamic analysis, we also notice this User-Agent change when we see Internet Explorer 7.50/pma0.

605033-20190114163957630-1849433888.png

注:可参考 Lab 6-2 相应部分。

Next, we perform more in-depth analysis with disassembly. We load the executable into IDA Pro and look at the main method, which is clearly structurally different from main in Lab 6-3, although many of the same functions are called. We see the functions 0x401000 (check Internet connection method), 0x401040 (parse HTML method), 0x4012B5 as printf, and 0x401150 (the switch statement). You should rename these functions as such in IDA Pro to make them easier to analyze.

605033-20190114164009679-1981897879.png

View -> Graphs -> Flow chart :

605033-20190114164022070-980446744.png

Looking at the main method in IDA Pro’s graphical view mode, we see an upward-facing arrow, which signifies looping. Listing 6-9L shows the loop structure.

605033-20190114164035576-411882943.png

Listing 6-9L: The loop structure

The variable var_C is the local variable used for the loop counter. The counter is initialized to 0 at \({\color{red} 1 }\), jumps past the incrementing at \({\color{red} 2 }\), performs a check at \({\color{red} 3 }\), and loops back to the incrementor when it gets to \({\color{red} 4 }\). The presence of these four code sections tells us that we are looking at a for loop code construct. If the var_C (counter) is greater than or equal to 0x5A0 (1440), the loop will end. Otherwise, the code starting at \({\color{red} 5 }\) is executed. The code pushes var_C on the stack before calling 0x401040, and then sleeps for 1 minute before looping up at \({\color{red}4}\) and incrementing the counter by one. Therefore, this process will repeat for 1440 minutes, which is equal to 24 hours.

In previous labs, 0x401040 did not take a parameter, so we need to investigate this further. Listing 6-10L shows the start of 0x401040.

605033-20190114164048538-1902272619.png

Listing 6-10L: The function at 0x401040

Here, arg_0 is the only parameter, and main is the only method calling 0x401040, so we conclude that arg_0 is always the counter (var_C) from the main method. Arg_0 is pushed on the stack at? \({\color{red}1}\), along with a format string and a destination. We also see that sprintf is called, which creates the string and stores it in the destination buffer, the local variable labeled szAgent. And szAgent is passed to InternetOpenA at \({\color{red}2}​\), which means that every time the counter increases, the User-Agent will change. This mechanism can be used by an attacker managing and monitoring a web server to track how long the malware has been running.

605033-20190114164059944-485908745.png

To summarize, the program checks for an active Internet connection using the if construct. If no connection is found, the program terminates. Otherwise, the program uses a unique User-Agent to attempt to download a web page containing a counter from a for loop construct. This counter contains the number of minutes the program has been running. The web page contains an embedded HTML comment and is read into an array construct of characters and compared to <!--. The next character is parsed from this comment and used in a switch construct to determine what action to take on the local system. These are hard-coded actions, including deleting a file, creating a directory, setting a registry run key, copying a file, and sleeping for 100 seconds. This program will run for 1440 minutes (24 hours) before terminating.

Preference

恶意代码分析实战 Lab 6-4 习题笔记

转载于:https://www.cnblogs.com/kafffka/p/10267680.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278458.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

步入三十岁前的总结:看似经历很多得到很多,但,实际却一无所得

本文算是一篇审视自己的文章吧&#xff0c;感觉跟我类似经历的人应该很多&#xff0c;认同感应该也大一些。我是12年网络专业很普通的一所大专院校毕业&#xff0c;到现在为止工作已经超过五年。这五年里&#xff0c;做过运维工程师&#xff0c;也在小车床工作间里做了一下技工…

vue---day03

1. Vue的生命周期 - 创建和销毁的时候可以做一些我们自己的事情 - beforeCreated - created - beforeMount - mounted - beforeUpdate - updated - activated - deactivated - beforeDestroy - destroyed 1.1 知识点回顾 1.1.1 be…

U Sparkle 开发者计划招募中!

向我们投稿吧 在此之前&#xff0c;我们有收到过几篇民间高手的投稿&#xff0c;如&#xff1a; USequencer 初识&#xff08;作者&#xff1a;焱燚(七火)&#xff09; Unity游戏界面解决方案: PSD For UGUI&#xff08;作者&#xff1a;张俊钦&#xff09; UGUI 降低填充率技巧…

如何添加引文标_如何在Google文档中查找和添加引文

如何添加引文标When writing papers, you need to generate a detailed and accurate list of all the sources you’ve cited in your paper. With Google Docs, you can easily find and then add citations to all of your research papers. 撰写论文时&#xff0c;您需要生…

Linux Centos下SQL Server 2017安装和配置

Linux Centos下SQL Server 2017安装和配置 原文:Linux Centos下SQL Server 2017安装和配置我们知道在Linux下安装服务有很多方式&#xff0c;最为简单的也就是yum安装&#xff0c;但是很多服务通过yum是无法安装的&#xff0c;如果想使用yum安装&#xff0c;需要指定yum安装仓库…

如何在Linux上使用端口敲门(以及为什么不应该这样做)

Photographee.eu/ShutterstockPhotographee.eu/ShutterstockPort knocking is a way to secure a server by closing firewall ports—even those you know will be used. Those ports are opened on demand if—and only if—the connection request provides the secret knoc…

小到年货大到产业,刘村长的扶贫模式有点厉害!

河北省阜平县平石头村的村民&#xff0c;今年春节再也不用头疼买什么年货&#xff0c;去哪买年货的问题了&#xff0c;因为他们的“村长”刘强东&#xff0c;给每户人家都送来了年货大礼包&#xff01;大礼包里不仅有牛奶、果汁、毛衣、长裤、波司登羽绒服、枕头、毛巾、炊大皇…

克隆ubuntu硬盘_使用Ubuntu Live CD克隆硬盘

克隆ubuntu硬盘Whether you’re setting up multiple computers or doing a full backup, cloning hard drives is a common maintenance task. Don’t bother burning a new boot CD or paying for new software – you can do it easily with your Ubuntu Live CD. 无论是设置…

从Boxee的Amie Street访问音乐

One of our favorite sites for discovering new music is Amie Street. Today we take a look at the Amie Street app for Boxee that allows you to access your favorite tunes from the Boxee interface. 我们最喜欢的发现新音乐的网站之一是Amie Street。 今天&#xff0…

如何在Word,Excel和PowerPoint 2010中裁剪图片

When you add pictures to your Office documents you might need to crop them to remove unwanted areas, or isolate a specific part. Today we’ll take a look at how to crop images in Office 2010. 将图片添加到Office文档时&#xff0c;可能需要裁剪它们以删除不需要…

在Windows 7 Media Center中创建音乐播放列表

One of the new features in Windows 7 Media Center is the ability to easily create music playlists without using Media Player. Today we’ll take a closer look at how to create them directly in Media Center. Windows 7 Media Center的新功能之一是无需使用Media …

SQL Server2008导入导出数据库

一、导出数据库 1.新建一个.bak的文本 右击数据库--》Tasks--》BackUp--》Remove原来的数据库--》Add后选择之前建立的.bak档 二、导入数据库 1.右击数据库--》Tasks--》Restore--》Database--》From device--》勾选数据库之后--》点击左上角Options--》点击 --》OK覆盖 转载于…

如何使YouTube视频连续循环播放

Should you need a YouTube video on a continuous loop, a few methods can help you keep repeating a video without having to start it over manually. Here’s how to do it. 如果您需要连续循环播放YouTube视频&#xff0c;可以采用以下几种方法来继续播放视频&#xff…

Android ABI

2019独角兽企业重金招聘Python工程师标准>>> 获取当前ABI var supportsABIs:Array<String>? null if(Build.VERSION.SDK_INT > 21) {supportsABIs Build.SUPPORTED_ABIS } var currentABI Build.CPU_ABI 通过Build可以获取当前手机支持的abi集以及cpu的…

nginx限流健康检查

Nginx原生限流模块:ngx_http_limit_conn_module模块根据前端请求域名或ip生成一个key&#xff0c;对于每个key对应的网络连接数进行限制。配置如下:http模块server模块#http模块内 http {include mime.types;default_type application/octet-stream;log_format main [$t…

如何在Ubuntu上创建桌面快捷方式

Desktop icons should be simple, but they’re not on Ubuntu 18.04 LTS and newer releases like Ubuntu 19.10. Follow these easy steps to get desktop shortcuts for your favorite applications, just like on other operating systems and other Linux desktops. 桌面图…

阿里再破记录!代表中国企业首次在这项国际比赛中摘得银牌!

2月9日在洛杉矶举行的第11届网络搜索与数据挖掘国际会议&#xff08;WSDM 2018&#xff09;上&#xff0c;公布了今年的WSDM Cup竞赛成绩&#xff0c;来自阿里巴巴的AliOS团队凭借优秀的算法能力&#xff0c;摘得榜眼。这是该赛事举办11届以来&#xff0c;中国企业在该赛事上首…

闪存驱动器_将闪存驱动器变成便携式Web服务器

闪存驱动器Portable applications are very useful for getting work done on the go, but how about portable servers? Here’s how you can turn your flash drive into a portable web server. 便携式应用程序对于在旅途中完成工作非常有用&#xff0c;但是便携式服务器呢…

Android中文API-ViewStub

ViewStub控件是一个不可见&#xff0c;0尺寸得惰性控件。当ViewStub控件设置可见&#xff0c;或者调用inflate()&#xff0c;并运行完毕之后&#xff0c;ViewStub所指定的layout资源就会被载入。这个ViewStub就会被新载入的layout文件取代。ViewStub也会从其父控件中移除。因此…

如何播放梅西百货的感恩节大游行2019

Macy’s梅西百货As we draw ever closer to the Thanksgiving holiday, multiple things come to mind: turkey, Black Friday, and the Macy’s Thanksgiving Day Parade. With that in mind, you might want to find a way to stream it for your family. 随着我们越来越接近…