Live Memory Analysis
Memory Analysis in Incident Response with Process Hacker
Memory analysis plays a crucial role in identifying malicious activities within a system. Attackers often use running processes to maintain persistence, exfiltrate data, or execute malicious commands. Tools like Process Hacker provide detailed insights into active processes, network connections, and signature statuses, helping responders uncover potential threats.
Key Areas of Memory Analysis
1. Process Tree Analysis
Objective: Identify suspicious child processes spawned by legitimate parent processes.
Indicators of Malicious Activity:
WebShell Detection: A process like
powershell.exe
orcmd.exe
spawned under a web server process (e.g.,w3wp.exe
orapache.exe
) could indicate a webshell executing commands likewhoami
ornet user
.Malicious Macro Detection: If
powershell.exe
is a child ofwinword.exe
(Microsoft Word), this might signal a malicious macro executing embedded scripts. Look for Base64-encoded commands.
Steps:
Open Process Hacker and go to the Processes tab.
Expand processes to view their hierarchy.
Investigate suspicious child processes:
Double-click a process to inspect its properties, including command line arguments and environment variables.
Cross-check the process name and command line with known IOCs (Indicators of Compromise).
2. Network Connections Analysis
Objective: Identify unauthorized or suspicious external communications.
Key Indicators:
Processes with active connections to unknown or suspicious IP addresses.
Use of non-standard ports for communication (e.g., unusual high ports).
Large data transfers indicating potential exfiltration.
Steps:
Navigate to the Network tab in Process Hacker.
Review active connections and focus on:
Process Name: Which process is making the connection.
Remote IP Address: Destination of the connection.
Port Number: Port being used for communication.
Investigate external IPs:
Use tools like VirusTotal, AbuseIPDB, or Shodan to check the reputation of the remote IP.
Terminate suspicious connections if necessary:
Right-click on the process and select Terminate.
3. Signature Status Analysis
Objective: Verify the authenticity of running processes by checking their digital signatures.
Why It Matters:
Legitimate files should be signed by a trusted authority.
Malicious actors sometimes use unsigned or poorly signed binaries to execute attacks.
Steps:
In the Processes tab, right-click the column headers and select Choose Columns.
Add Verification Status and Verified Signer columns.
Review processes:
Focus on those marked as Not Verified or Unknown.
Investigate further if a critical system process like
svchost.exe
orlsass.exe
shows as unsigned.
Example Case Study: Suspicious Python Process Under CMD
Scenario: You notice python.exe
running as a child of cmd.exe
. This could be a legitimate task or a sign of malicious activity.
Action Plan:
Inspect Process Details:
Double-click
python.exe
in Process Hacker.Check the Command Line for parameters or scripts being executed.
Verify Current Directory:
Ensure the script (e.g.,
manage.py
) is running from an expected directory.Unexpected locations like
/tmp
,/dev/shm
, or user directories can indicate malicious intent.
Analyze the Script:
Review the contents of the script for potentially harmful code.
Key Points
Memory analysis with tools like Process Hacker enables responders to:
Detect active malware through suspicious processes.
Identify unauthorized external communications.
Investigate persistence mechanisms, such as unsigned processes or malicious network connections.
This structured approach to memory analysis provides critical insights during incident response, allowing responders to act swiftly and effectively.
Last updated