A Deep Dive into the Recent XYZ Malware Campaign: From Initial Compromise to Exfiltration

Sarah Chen — Malware Reverse Engineer

Key Takeaways

  • The attacker used a sophisticated spear-phishing technique to gain initial access to target organizations.
  • The implant employed was a multi-stage dropper, facilitating persistent access through various methods.
  • Our investigation uncovered C2 communications utilizing encrypted traffic to obfuscate malicious commands.

Executive Summary

In recent weeks, our analysis of a sophisticated malware campaign dubbed “XYZ” revealed an extensive operation designed to compromise and exfiltrate data from high-value targets. The threat actor behind this campaign employed a multi-faceted approach, combining social engineering tactics with various malware techniques to establish deep footholds within networks. Throughout our investigation, we observed that the campaign heavily utilized tactics and techniques aligned with the MITRE ATT&CK framework, specifically focusing on initial access through spear-phishing and leveraging custom implementations of well-known malware frameworks.

Initial Access

The initial access vector we identified was through tailored spear-phishing emails designed to lure recipients into downloading a malicious attachment. This attachment, identified as XYZDropper.exe, was a Windows executable masquerading as an innocuous document. Once executed, this dropper employed T1566.001 – Phishing: Spear Phishing Attachment to initiate a series of payload deployments. The dropper extracted its secondary payload, a more robust backdoor, from a local directory after decrypting it.

Execution & Persistence

During the investigation, we found that the primary backdoor, referred to as XYZBackdoor, was executed through a series of scheduled tasks to ensure persistence. Our analysis revealed that the malware registered itself under the path C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\xyz.lnk, using the Windows Task Scheduler to invoke itself during system boot, effectively maintaining long-term access to compromised systems. Furthermore, our telemetry indicated that the malware also leveraged T1053.005 – Scheduled Task/Job: Scheduled Task to execute follow-up commands without user intervention.

Command and Control

The actor established a Command and Control (C2) infrastructure utilizing a combination of HTTP and HTTPS protocols to communicate with previously established beacons. We observed that the malware utilized domain generation algorithms (DGA) to create a rotating pool of C2 domains, which obscured its activity and made tracking and mitigation difficult. The generated domains were nested within legitimate-looking URLs to evade detection. Notably, the C2 traffic employed encryption, specifically T1071.001 – Application Layer Protocol: Web Services, which hampered our ability to analyze the commands being executed. The frequency of beaconing was approximately every 30 minutes, allowing the actor to issue commands or receive exfiltrated data efficiently.

Lateral Movement & Discovery

Following the initial establishment of a foothold, the actor embarked on lateral movement within the network, utilizing credential dumping techniques. We identified the use of Mimikatz for credential harvesting, which aligned with T1003.001 – Credential Dumping: LSASS Memory. The malware extracted credentials from memory and attempted to access additional systems within the network. Additionally, it scanned for open shares and leveraged remote desktop connections to escalate privileges and move laterally to additional hosts.

Impact & Objectives

This campaign’s impact was significant, with our analysis indicating that a broad range of sensitive data was exfiltrated, including employee credentials, proprietary company information, and financial data. The objectives of this operation appeared to focus on economic espionage, potentially with a goal of reselling the data in underground markets or using it for further attacks on related entities. The actors demonstrated a clear understanding of the target organization’s operational structure, leading us to believe they conducted thorough reconnaissance before launching their attack.

MITRE ATT&CK Mapping

  • T1566.001 – Phishing: Spear Phishing Attachment: Delivery of a malicious executable through a spear-phishing email.
  • T1053.005 – Scheduled Task/Job: Scheduled Task: Use of scheduled tasks for persistence.
  • T1071.001 – Application Layer Protocol: Web Services: Encrypted C2 communications using web services.

Detection Opportunities

  • Monitor email gateways for suspicious attachments and URLs associated with spear-phishing campaigns.
  • Implement file integrity monitoring on startup folders to detect unauthorized changes.
  • Analyze outbound network traffic for signs of DGA-related C2 communications and anomalous beaconing patterns.

Analyst Notes

Throughout our investigation, we noted the importance of robust phishing detection capabilities and user training to mitigate the risk of initial access through social engineering. Additionally, the utilization of EDR solutions capable of detecting unusual process behavior related to scheduled tasks and unauthorized execution of known malware could significantly improve defenses against this type of attack. Continuous monitoring of network traffic for indicators of compromise, especially concerning encrypted C2 flows, will assist in early detection and response to similar campaigns.

Source: Original Report