This project outlines a scenario in which an IT employee’s machine is potentially compromised after using a virtual machine (VM) from a compromised Capture the Flag (CTF) site. The incident involves a series of tasks designed to investigate the potential breach by analyzing network traffic and the memory of the compromised machine using tools like Wireshark, Volatility, and others. Here's a step-by-step approach to completing the incident response investigation.
Objective: Analyze the network traffic captured in the provided pcap file to understand communication between the compromised machine and the attacker.
Steps:
- Open Wireshark and load the provided
.pcapfile. - Filter the traffic using the suspected IP addresses:
- Filter communication between the compromised machine (192.168.248.100) and the malicious IPs (192.168.248.217 and 192.168.248.200) using the filter:
ip.src == 192.168.248.100 && (ip.dst == 192.168.248.217 || ip.dst == 192.168.248.200)
- Filter communication between the compromised machine (192.168.248.100) and the malicious IPs (192.168.248.217 and 192.168.248.200) using the filter:
- Analyze packet timestamps to identify the first connection between the victim and the malicious server.
In this case, packet 30197 shows that the victim connected to the compromised VM (192.168.248.217). - Identify malicious traffic: Look for unusual connections (e.g., to port 8080 and 4444). These ports are commonly associated with backdoors or control mechanisms like Metasploit reverse shells.
- Suspicious files: If you find files being transferred or downloaded (e.g., using HTTP), export the files for further analysis.
Objective: Identify and analyze malicious processes running on the compromised machine using memory dump analysis.
Steps:
-
Load the memory dump into Volatility.
-
Check for running processes using the
pslistorpstreeplugins:volatility -f <memory_dump> pslist
- From your investigation, some of the suspicious processes identified were:
ghost.exemXvtj.exeHgTg.exe
- From your investigation, some of the suspicious processes identified were:
-
Identify network connections: Use the
netscanplugin to analyze network activity.volatility -f <memory_dump> netscan
- This revealed connections to malicious IPs and ports (7777, 4444, 9999) associated with the attacker’s IP (192.168.248.200).
-
Malicious files identification: Use the
filescanormalfindplugins to search for rogue files.volatility -f <memory_dump> filescan volatility -f <memory_dump> malfind
- Export the suspicious files for further analysis using the
procdumpplugin:volatility -f <memory_dump> procdump --pid <PID> -D /path/to/export/
- Export the suspicious files for further analysis using the
Objective: Examine the malicious files using tools like VirusTotal or other malware analysis tools to identify the exact threat.
Steps:
-
Submit the files extracted from the memory dump (e.g.,
ghost.exe,HgRgTVSdX.exe, etc.) to VirusTotal or a similar service for detailed analysis.
Since these files are associated with attacker-controlled IPs, they are likely involved in maintaining access to the compromised machine. -
Check for malware signatures: If VirusTotal or other tools recognize these files, they may provide information on whether these are known malware variants (e.g., Metasploit backdoors).
Objective: Determine the attacker’s level of access and whether they achieved system-level privileges.
Steps:
-
Analyze system privileges using the
getsidsplugin to determine if the attacker has escalated their privileges.volatility -f <memory_dump> getsids
- If the output shows the presence of high-privileged accounts (e.g.,
S-1-5-18), this indicates the attacker has gained system-level privileges.
- If the output shows the presence of high-privileged accounts (e.g.,
-
Identify privilege escalation techniques: If Metasploit or similar tools were used, this might indicate how the attacker escalated privileges to gain full control of the system.
Objective: Document findings and suggest mitigation steps.
Key Findings:
- Attacker’s IP: 192.168.248.200
- Victim’s machine: 192.168.248.100
- Compromised VM hosting malicious site: 192.168.248.217
- Malicious processes:
ghost.exe,mXvtj.exe,HgTg.exe - Ports involved: 7777, 4444, 9999
- Evidence of system-level privileges: Yes, based on the
getsidsoutput.
Recommendations:
- Isolate the compromised machine: Immediately take the affected system offline to prevent further spread or control by the attacker.
- Patch vulnerabilities: Ensure that any known vulnerabilities exploited during the attack (e.g., cross-site scripting) are patched.
- Conduct forensic analysis: Perform a more thorough analysis to ensure no other machines were compromised via lateral movement.
- Rebuild the compromised system: Once analysis is complete, rebuild the system from a clean image to remove any backdoors or persistent malware.
- User training: Reinforce the importance of only downloading trusted VMs or other training materials to avoid compromised practice environments.