V2Chapter 6 Advanced Malware Analysis Techniques V2
V2Chapter 6 Advanced Malware Analysis Techniques V2
• Kernel-Level Debugging
• Fuzzing
Introduction to Advanced Dynamic Analysis
Techniques
• Dynamic analysis allows malware analysts to observe the behavior of
malicious software while it executes in a controlled environment. This
technique is crucial for uncovering malware behavior that may not be
evident in static analysis, such as:
o Persistence mechanisms
o Network communications
o Process creation and manipulation.
Importance of Dynamic Analysis in Malware
Detection
• Dynamic analysis plays a critical role in detecting:
2. Rootkits:
o Malware designed to hide its presence and persist in kernel mode.
3. Function Hooking:
o A technique to intercept function calls to system APIs.
Tools for Kernel-Level Debugging
1. WinDbg:
o A comprehensive debugger for analysing both user-mode and kernel-mode
applications.
2. KD (Kernel Debugger):
o Used for debugging kernel components from a remote machine.
3. Example Session:
o A typical analysis session involves attaching WinDbg to the system kernel to
examine system calls, memory access, and potential malware injection points.
Common Malware Techniques in Kernel-
Level Malware
• Code Injection:
Malware injects code into other processes to remain hidden.
• Process Hiding:
Rootkits modify the kernel to hide processes from task managers and security
tools.
• Hooking System Functions:
Intercepting critical OS functions to alter behavior or hide malicious activity.
Analyzing Network Communications of
Malware
• Network analysis is critical to understand how malware communicates
with Command and Control (C2) servers.
• Malware uses HTTP to blend malicious traffic with regular web traffic.
2. DNS:
3. SSL/TLS:
1. Filtering Packets:
§ Using tools like Wireshark, analysts filter traffic based on protocols or
suspicious IP addresses.
2. Detecting C2 Communications:
§ Indicators include repeated connections to the same IP/domain, encrypted
traffic, or unusual packet sizes.
Memory Forensics Overview
ØTools:
qVolatility: A powerful framework for analysing memory dumps,
identifying injected code, and detecting hidden processes.
qFTK Imager: Useful for acquiring and imaging memory for forensic
analysis.
ØCommon Commands and Techniques in Volatility:
qpslist: Lists running processes to detect anomalies.
qnetscan: Identifies open network connections.
qmalfind: Scans for malicious injections in memory.
Memory Forensics Tools
1. Volatility:
• An open-source framework for
analysing memory dumps to detect
malware behaviors.
2. FTK Imager:
• A tool to capture and analyse memory
dumps from infected machines.
Fuzzing Techniques Overview
•Definition:
Fuzzing is a software testing technique that involves providing invalid, unexpected, or random data as inputs to a
program.
The goal is to detect bugs or vulnerabilities by observing crashes, unexpected behavior, or security flaws in the
software.
•Purpose of Fuzzing:
•Uncover vulnerabilities that may not be easily identifiable through static analysis or manual testing.
•Test the robustness and security of software by simulating unusual inputs or user behavior.
•Help identify memory corruption issues, such as buffer overflows, use-after-free errors, and input validation failures.
Types of Fuzzing:
1.Generation-based Fuzzing:
1. Inputs are generated from scratch according to predefined rules, specifications, or
protocols.
2. Effective for well-documented file formats or network protocols.
2.Mutation-based Fuzzing:
1. Inputs are derived by altering existing valid inputs (e.g., flipping bits, removing
data).
2. Useful when you have a set of valid inputs and want to explore edge cases or
anomalies.
Black-box vs. White-box Fuzzing
• Black-box Fuzzing:
• Definition: The tester has no knowledge of the internal workings of the
system being tested.
• Advantages:
• Simple to set up, as it does not require access to the codebase or knowledge of the system
internals.
• Can uncover vulnerabilities in the overall behavior and interactions of the system with
external inputs.
• Use Cases:
• Ideal for testing commercial off-the-shelf (COTS) software or third-party applications.
• Focused on identifying flaws in exposed interfaces like APIs or network protocols.
Black-box vs. White-box Fuzzing
• White-box Fuzzing:
• Definition: The tester has full access to the system’s source code, internal
structure, and functionality.
• Advantages:
• Enables more thorough testing by guiding the input generation process based on
knowledge of the system’s code paths.
• Can identify deep vulnerabilities by targeting specific code paths or complex logic.
• Use Cases:
• Effective for internal software development where the source code is available.
• Suitable for targeting sensitive areas like authentication modules, encryption
algorithms, or memory management.
• Comparison:
• Black-box:
• Requires no knowledge of internal code.
• White-box:
• In-depth exploration of code paths.
• Test Case Generation: A collection of test cases that caused the program to
behave abnormally are saved for further investigation.