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.pswp.cn/news/278458.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278458.shtml
英文地址,請注明出處:http://en.pswp.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 降低填充率技巧…

階乘和 大整數

///大整數階乘的和 #include<bits/stdc.h> using namespace std; int main() {int n;while(cin>>n){int a[2000] {1},b[2000] {0}; //存放結果的數組a。int c; //b用于存放每位存放的結果。int r0; //r用來表示進位的數。int h1,hb1; //h用來表示運算過程中 結果a…

如何添加引文標_如何在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;您需要生…

mongo ttl索引

db.log_events.find() # 查找log_events里的所有數據db.log_events.createIndex( { "LogDT": 1 }, { expireAfterSeconds: 3600 } ) #設置log_events里的TTL過期索引清理時間為3600秒db.runComman…

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;大禮包里不僅有牛奶、果汁、毛衣、長褲、波司登羽絨服、枕頭、毛巾、炊大皇…

java - 匿名類

匿名內部類 概念&#xff1a;即內部類的簡化寫法 前提&#xff1a;存在一個類&#xff08;可以是具體類也可以是抽象類&#xff09;或接口 格式&#xff1a;new 類名或接口名{重寫的方法} 本質&#xff1a;創建的是繼承了類或實現了接口的子類匿名對 象。 匿名類總是final&…

leetcode 342. Power of Four

沒想出來不用循環的。記錄下。 如果是2的次方&#xff0c;必有num & (nums - 1) bool isPowerOfFour(int num) {if (num < 1) return false;if (num & (num - 1)) return false; // 排除不是2的倍數if (num & 0x55555555) return true; // 排除不是4的倍數&am…

克隆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. 無論是設置…

頁面緩存處理的幾種方法

html只要加在頭部就可以了. <HEAD> <META HTTP-EQUIV"Pragma" CONTENT"no-cache"> <META HTTP-EQUIV"Cache-Control" CONTENT"no-cache"> <META HTTP-EQUIV"Expires" CONTENT"0"> </H…

Nginx的Mainline version、Stable version、Legacy version的版本區別

Nginx官網提供了三個類型的版本Mainline version&#xff1a;Mainline 是 Nginx 目前主力在做的版本&#xff0c;可以說是開發版Stable version&#xff1a;最新穩定版&#xff0c;生產環境上建議使用的版本Legacy versions&#xff1a;遺留的老版本的穩定版 nginx下載地址&…

從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…

redis學習目錄

redis學習目錄 redis安裝 說明 python中使用 centos7安裝redis redis.conf配置信息詳解 redis主從同步 redis持久化 RDB與AOF redis不重啟,切換到RDB備份到AOF備份 redis哨兵功能 redis-cluster(集群) 轉載于:https://www.cnblogs.com/yuncong/p/10293624.html

如何在SpringBoot項目中使用攔截器

相比springmvc&#xff0c;springboot中攔截器不需要在xml中配置&#xff0c;只需定義攔截器類 implements HandlerInterceptor 和攔截器攔截路徑的配置類extends WebMvcConfigurerAdapter 1.SessionInterceptor package com.example.demo;import org.springframework.web.serv…

如何在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;可能需要裁剪它們以刪除不需要…

Python 調度算法 死鎖 靜動態鏈接 分頁分段

1 select poll epoll的區別基本上select有3個缺點: 連接數受限查找配對速度慢數據由內核拷貝到用戶態poll改善了第一個缺點 epoll改了三個缺點. (1&#xff09;select&#xff0c;poll實現需要自己不斷輪詢所有fd集合&#xff0c;直到設備就緒&#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 …