Week 4 - Malware Forensics
Week 4 - Malware Forensics
WEEK 4 -
MALWARE FORENSICS
Malware forensics and analysis is a critical discipline within digital forensics that
focuses on detecting, identifying, and analyzing malicious software (malware) to
understand its behavior, purpose, and impact on compromised systems. As cyber
threats evolve, the need for sophisticated techniques to investigate and mitigate
malware attacks becomes increasingly important. This discussion covers key
aspects of malware forensics, including the different types of malware,
techniques for identification and analysis, behavioral analysis in sandbox
environments, reverse engineering, and case studies of major malware incidents.
1. Viruses:
2. Worms:
3. Trojans:
Trojans are malware disguised as legitimate software. Once executed, they can
create backdoors, steal data, or install additional malware. Unlike viruses and
worms, Trojans do not replicate themselves.
4. Ransomware:
1. Static Analysis
Static analysis involves examining the malware’s code without executing it. This
approach is often the first step in malware analysis, as it allows analysts to
gather information about the malware's structure and intent without the risk of
running potentially harmful code. Static analysis is essential for understanding
how the malware is constructed, what it aims to do, and how it might behave
once executed.
The first step in static analysis is to inspect the malware’s binary file. Tools like
PEiD, Exeinfo PE, or Detect It Easy (DIE) are used to determine the file type,
compiler used, and whether the file is packed or obfuscated. This information
helps analysts understand the nature of the malware and its complexity.
b. String Analysis:
By extracting and analyzing strings (sequences of readable text) from the binary,
analysts can gain insights into the malware’s functionality. Strings can reveal
filenames, URLs, IP addresses, commands, error messages, and other potentially
revealing information embedded in the code. Tools like `strings` (a command-
line utility) or BinText are commonly used for this purpose.
c. Disassembly:
Disassembly converts the malware’s binary code into assembly language, which
is a human-readable format that represents the low-level instructions the
malware will execute. Tools like IDA Pro and Ghidra are used to disassemble the
malware. This step allows analysts to trace the execution flow, understand the
malware's logic, and identify key functions and system calls.
Malware executables often contain headers and metadata that provide additional
information about the file. This includes details about the file’s origin, the
compilation date, and embedded resources. Analyzing this metadata can help
determine if the malware is part of a known family or if it contains signatures
that match previously identified threats.
Malware authors often use obfuscation techniques to hide the true intent of their
code. This can include packing the malware (compressing and encrypting the
code) to make static analysis more difficult. Analysts may use tools like UPX,
OllyDbg, or x64dbg to unpack and deobfuscate the malware, revealing its original
code for further analysis.
2. Dynamic Analysis
a. Sandboxing:
Malware often interacts with the file system and registry to achieve persistence,
spread, or carry out its payload. Dynamic analysis tools monitor these
interactions, recording any new files created, modifications to existing files, or
changes to the Windows Registry (for Windows-based malware). This helps in
understanding the malware’s impact on the infected system.
d. Process Monitoring:
Analyzing the processes that the malware creates, terminates, or injects code
into provides insights into its execution flow. By monitoring processes, analysts
can determine how the malware loads into memory, what dependencies it
requires, and how it interacts with other system processes. Tools like Process
Explorer or Process Monitor are useful for this purpose.
API calls made by the malware are recorded and analyzed to understand how it
interacts with the operating system. This can reveal the malware’s attempts to
manipulate files, initiate network connections, or modify system settings. Tools
like API Monitor or Sysinternals Suite are used to trace and analyze these calls.
- Key Insights: Identifying specific API calls can reveal the malware's intentions,
such as attempts to access sensitive data, bypass security mechanisms, or
perform privilege escalation.
Static analysis tools focus on examining the code and structure of the malware
without executing it. These tools are essential for understanding the malware’s
design, identifying embedded threats, and predicting potential behavior.
- Usage: IDA Pro is widely used for reverse engineering malware, particularly
for unpacking and deobfuscating complex samples.
Dynamic analysis tools are designed to observe and analyze the behavior of
malware while it is executed in a controlled environment. These tools provide
real-time insights into how malware interacts with the system, the network, and
other components.
a. Cuckoo Sandbox
- Features: ProcMon is a Windows tool that logs all file and registry activity as
well as process and thread creation or termination. It provides a detailed view of
what the malware is doing on the system during execution.
- Usage: ProcMon is used to trace how malware interacts with the file system
and registry, helping analysts understand how it achieves persistence,
manipulates files, or alters system configurations.