Malware Analysis
Malware Analysis
A software that was designed with the purpose of harming the victims CIA
3
Goals of Malware Analysis
2
Indications of Compromise
Host Based
Signatures
Indications of Compromise
IOC
3
MSN Malware (1992)
https://zeltser.com/malware-sample-sources/
General Rules of Malware Analysis
▶ Malware can be complex programs. Avoid the details and focus on key
features.
▶ Utilize the different tools and approaches available depending on the type of
analysis you intend to do.
▶ Tools overlap in functionality, if you don’t get lucky with one try another.
▶ Analyse the malware from different angles and using different approaches. To
confirm your theories.
▶ Malware programmers can be clever and can come up with techniques to hide
their traces.
5
Malware Analysis Techniques
6
Automated Analysis
10
DemoA vailable
Automated Solutions-Examples
9
Static Malware Analysis-Introduction
▶ Fingerprints: Hash the suspicious software to uniquely identify it. Search and
share with the malware analyst communities.
▶ Strings: A program contains strings if it prints a message, connects to a URL,
copies a file to a specific location, or error messages, etc.
▶ Portable Executable (PE) file format is used by Windows executables, object
code, and DLLs and includes information about the code, the type of
application, required library functions, and space requirements.
▶ Linked Libraries and Functions are Imports of code and functions used by the
malware that are actually stored in an already known and existing library.
10
DemoA vailable
Static Analysis-PEStudio
11
Behavior Based Analysis
17
DemoA vailable
Email: [email protected] 18
Password: bbbb
Behavior Analysis Network Oriented
14
Behavior Analysis Network Oriented
Wireshark
Fiddler
Microsoft Network
Analyzer
15
Behavior Analysis Network Oriented
16
Code Based Analysis
17
Code Based Analysis-Ollydbg
int main()
{ string Y;
int rnd;
while(!(Y=="PASSWORD")){
printf("No, What is the secret word? ");
getline(cin, Y);
}
Malware Author High Level Language Malware Analyst Low Level Language
int main()
{ string Y;
int rnd;
while(!(Y=="PASSWORD")){
printf("No, What is the secret word? ");
getline(cin, Y);
}
Compile Disassemble
19
Code Based Analysis-ollydbg
1 2
3
20
5 4
Code Based Analysis-ollydbg
Debugging Commands
1. Step into
2. Step over
3. Create break point
4. Go to next reference
5.Go to previous reference
6. …
Assembly Commands
1. JMP, JNZ, JE, JZ <LOC>
2. CALL, RETN <LOC>
3. MOV <VALUE><VALUE>
4. AND,OR,XOR <VALUE><VALUE>
5. POP, PUSH <VALUE>
6. TEST
7. NOP
8. …. 27
22
Code Based Analysis
int main()
{ string Y;
int rnd;
while(!(Y=="PASSWORD")){
printf("No, What is the secret word? ");
getline(cin, Y);
}
Goal: Understanding the assembly code Goal: Tracing within the assembly code
and manipulating it to change the to understand the logic behind the file
logical behavior of the program. msnsetting.dat
23
24
Analysis Summary for MSN Malware
25
Questions
26
IBM ICE (Innovation Centre for Education)
Welcome to:
Malware Analysis
9.1
Analyzing Live Windows System for Malware
IBM ICE (Innovation Centre for Education)
• Dynamic analysis is an efficient way to identify malware functionality from a live windows
system.
• Although dynamic analysis techniques are extremely powerful, they should be performed
only after basic static analysis has been completed, because dynamic analysis can put your
network and system at risk.
• Usually it is simple enough to run executable malware by double-clicking the executable or
running the file from the command line, it can be tricky to launch malicious DLLs because
Windows doesn’t know how to run them automatically.
• Process Monitor, or procmon, is an advanced monitoring tool for Windows that provides a
way to monitor certain registry, file system, network, process, and thread activity.
• One way to recognize process replacement is to use the Strings tab in the Process
Properties window to compare the strings contained in the disk executable (image) against
the strings in memory for that same executable running in memory.
• Regshot is an open source registry comparison tool that allows you to take and compare two
registry snapshots.
• Wireshark is an open source sniffer, a packet capture tool that intercepts and logs network
traffic. Wireshark provides visualization, packet-stream analysis, and in-depth analysis of
individual packets.
• The advancement in malware, rootkit detection and digital forensics in the commercial
products just discussed was due in large part to a resurgence of interest in a research area
that has been around the digital forensics community for some time.
• KNTList forensic tool can parse information from the memory dump, reconstruct evidence
such as process listings and loaded DLLs, and analyze the memory dump to decipher the
intrusion scenario.
• Volatility is a memory analysis environment with an extensible underlying framework of tools
based on research by Aaron Walters of Volatile Systems.
• Volatility provides basic information that it parses from the memory dump, including:
– Running processes and threads
– Open network sockets and connections
– Loaded modules in user and kernel mode
– The resources a process is using such as fi les, objects, registry keys and other data
– The capability to dump a single process or any binary in the dump & use for analysis
• The predecessor of the first rootkit was actually not a rootkit at all but a set of applications
that removed evidence of an intrusion from a machine.
• The first-generation served one major purpose—execute commands for an attacker without
being seen.
• With the ability to log back into a server with full administrative privileges, the attacker can
leverage the server for other attacks, store data, or host a malicious website. Rootkits
maintain access by installing either local or remote backdoors.
• Rootkits have the ability to conceal traces of their existence on the system
• Network-based rootkits do not run on the network but are accessible via the hacked system’s
web server.
• The two types of rootkits: user-mode and kernel-mode.
• One of the simplest and most used techniques, System Service Descriptor Table or SSDT
hooking is fairly easy to detect, and almost every tool available detects SSDT hooks.
• The method for detecting IRP hooking is the same as for detecting SSDT hooking. Each
driver exports a set of 28 function pointers to handle I/O request packets.
• Machine code is the form of code that the computer can run quickly and efficiently. When we
disassemble malware, we take the malware binary as input and generate assembly language
code as output, usually with a disassembler.
• Instructions are the building blocks of assembly programs. In x86 assembly, an instruction is
made of a mnemonic and zero or more operands.
• Each instruction corresponds to opcodes (operation codes) that tell the CPU which operation
the program wants to perform.
• All general registers are 32 bits in size and can be referenced as either 32 or 16 bits in
assembly code.
• The simplest and most common instruction is mov, which is used to move data from one
location to another.
• It is possible to read data from the stack without using the push or pop instructions.
• All programming languages have the ability to make comparisons and make decisions based
on those comparisons. Conditionals are instructions that perform the comparison.
• The Interactive Disassembler Professional (IDA Pro) is an extremely powerful disassembler
distributed by Hex-Rays.