Lab1 Intro Malware Analysis
Lab1 Intro Malware Analysis
In this laboratory you will practice the knowledge acquired during the classes of em topic.
Specifically, we are going to focus on the basic malware analysis.
IMPORTANT
The malware samples that have been provided bf are real. Therefore, be careful when
you execute them, since they will carry out their malicious behavior in the system. You
will find them available in a file compressed with the “infected” password. It is strongly
recommended to use a virtual or isolated machine to carry out this laboratory
session. The instructor is not responsible for the possible damages that can be caused by
their execution.
1 Laboratory environment
In this practice, you will use the virtual machine of the Windows operating system provided in
the workshop (link available for direct download at https://webdiis.unizar.es/~ricardo/
sbc-2023/).
This virtual machine contains a Windows 7 Enterprise, and it is one of the virtual machines
that Microsoft provides on its official website (https://developer.microsoft.com/es-es/
microsoft-edge/tools/vms/) to evaluate their Internet browsers. The name of the user and
password of the Windows account are:
• User: IEUser
• Password: Passw0rd!
By default, the virtual machine is distributed without having previously activated. It can
be activated to avoid on the one hand the annoying messages that appear during use relative
to being victims of pirate software, as well as to prevent the virtual machine from restarting
unexpectedly after a certain arbitrary time.
Before performing activation, which will provide us with a valid license for 90 days, it is
recommended to capture the current state of the virtual machine (that is, you can make a
snapshot!). To activate it, you have to open a MS-DOS command window with administrator
permission (right click at “cmd.exe ”, Run as administrator ; see Figure 1) and run the command:
slmgr /ato
After executing it, a new window similar to the one shown in Figure 2 will appear indicating
that the activation has been successful.
1 de 4
Distributed under CC BY-NC-SA 4.0 license. (© Ricardo J. Rodrı́guez)
https://creativecommons.org/licenses/by-nc-sa/4.0/
Malware Analysis for Incident Response
Basic Malware Analysis
for a specific function. Specifically, the MSDN provides information about what a sys-
tem function does, what parameters it uses, and what it returns. On Windows, tools
like CFF Explorer (http://www.ntcore.com/exsuite.php) can be used to check the
import functions.
All these described steps correspond to a basic static analysis of the sample. A more
advanced analysis would use disassembly tools or other techniques based on flow control
graphs or symbolic execution, among others. In any case, one of the biggest limitations of
static analysis is that the code of the binary to be analyzed does not have to be obfuscated
or protected. Furthermore, a static analysis shows us all possible execution paths of
that program. That is, the state space of all these paths can be very large and difficult to
manage.
2. Dynamic analysis phase. This phase, also called live or hot code analysis phase, includes
the study of the program during its execution. Specifically, in this phase the interaction of
the malware sample with its environment is studied. This phase can be divided into two
sub-phases, depending on what is meant by environment:
• Interaction with the Operating System. When we understand by environment the
interaction made with the operating system, we must attend to three particular ex-
tremes: files (what files is the program creating, modifying, or deleting?, Registry keys
(what registry keys is the program creating, modifying, or deleting?), and processes
(what processes is the program creating, modifying, or deleting?). If the malware sam-
ple is observed to be creating new files, it will be necessary to analyze what type of
files are created and in the case of executable files, carry out a new malware analysis
with them. In the case of Registry keys, it is necessary to check which registry keys
are affected (configuration changes, persistence, etc.).
• Interaction with the outside (Internet). Finally, we must look at the interaction that
the malware performs with the Internet. Specifically, it will be necessary to locate
if the malware sample makes any connection to the Internet (to which IP addresses
or Internet domains is it trying to connect?), and if it does make any connection,
it is necessary to look at what type of information is sending, how it receives data
and what type of information it receives. These servers to which you connect to send
information and possibly receive orders are called command and control servers (C&C
servers).
This dynamic analysis phase that we have just described will help us to answer (almost)
all the questions related to malware that were discussed at the beginning of this section.
More advanced dynamic analysis would require using a debugger to analyze at runtime
how CPU registers are evolving, the values returned by Windows functions called by the
malware, and so on.
Finally, it should be noted that, unlike the static analysis, in the dynamic analysis
only one of the possible execution paths is analyzed, which may also depend on the
current execution conditions.
3 Laboratory Assignments
As assignments, in this laboratory you are asked to answer the following questions for each of
the malware samples selected. You can get the malware samples used in this laboratory session
Assignment 1.
Are any file in the system being created? If so, how many files and what kind
are they? Detail its name and extension, as well as a brief explanation of its content.
Assignment 2.
Does the sample perform some kind of persistence? If so, detail what kind of
persistence is doing. If there is any other interaction with the Windows Registry, describe
it.
Assignment 3.
Does it interact with any other process? If so, describe which one (or ones) and what
interaction performs.
Assignment 4.
Does it connect with an Internet address or domain? If so, detail with which
domain or IP is trying to connect. In case it is a domain name, discover the IP address
to which the domain name resolves. You can use this web page for this purpose: http:
//whois.domantools.com/.
Assignment 5.
Based on the analysis of the behavior you have observed, how would you categorize this
malware sample?