Unraveling a Sophisticated Phishing Campaign: A Detailed Malware Analysis

Sarah Chen — Malware Reverse Engineer

Key Takeaways

  • A sophisticated phishing campaign leads to initial access through a malicious Excel document.
  • The payload utilized a .NET-based backdoor for persistence and command execution.
  • The attacker leveraged lateral movement techniques to access sensitive data across the network.

Executive Summary

During our investigation of a recent malware incident, we uncovered a complex attack sequence that commenced with a targeted phishing campaign. The actor disseminated an enticing email containing a malicious Excel document, which, upon opening, executed a series of obfuscated scripts leading to the download of a .NET-based implant. This implant was specifically designed to maintain persistence and facilitate command execution, effectively giving the actor continuous access to the affected environment.

Initial Access

The initial infection vector was a well-crafted phishing email that contained a link to a seemingly harmless Excel document. This document leverages Excel 4.0 macros, a method that has seen a resurgence due to its effectiveness in bypassing some security filters. Upon enabling the macros, the document executed a PowerShell command that downloaded the malicious payload from an external URL, which we traced back to a compromised web server. This behavior is consistent with the T1203 – Exploitation for Client Execution technique, which highlights common practices by threat actors to gain initial access through user interaction.

Execution & Persistence

Once the payload was stored on the system, our analysis revealed that it operated as a .NET console application. The implant was compiled to include multiple layers of obfuscation, aimed at evading static and dynamic analysis. We noted that the executable was dropped into the user profile directory at %UserProfile%\Documents\malicious.exe, where it was less likely to raise suspicion. To ensure persistence, the implant modified the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\malicious, establishing a mechanism to run the payload on every user logon. This aligns with the T1547 – Boot or Logon Autostart Execution technique.

Command and Control

Command and Control (C2) communication was established via HTTP POST requests to a remote server, where we observed a consistent pattern of beaconing occurring every five minutes. The data sent included system information, such as OS version and installed software, which indicates that the actor aimed at reconnaissance early in the infection lifecycle. The C2 server responded with commands for executing further payloads or exfiltration tasks, demonstrating the use of the T1071 – Application Layer Protocol technique. Importantly, the external IP was associated with previously reported malicious activities, which highlights the importance of threat intelligence in tracking neo-emerging C2 infrastructures.

Lateral Movement & Discovery

Utilizing the initial foothold, the threat actor proceeded to conduct lateral movement within the environment using techniques associated with T1021 – Remote Services. They exploited remote desktop protocols and shared drives to access other systems within the network, which was facilitated by credential dumping using tools embedded within the implant. Our examination of network traffic revealed attempts to access additional hosts via RDP connections, with successful connections logged against several sensitive servers. We also identified the use of Windows Management Instrumentation (WMI) for executing commands on remote machines, presenting a sophisticated level of operational capability.

Impact & Objectives

The overarching goal of this operation was the exfiltration of sensitive data, specifically targeting financial records and personal identifiable information (PII) stored across the network. Once the actor had mapped the environment and extracted relevant data, we observed clear indicators suggesting potential secondary objectives, such as establishing a foothold for future attacks. This aligns with the lateral movement and data exfiltration techniques outlined in T1041 – Exfiltration Over Command and Control Channel, demonstrating the actor’s intent to leverage the compromised environment for significant data theft.

MITRE ATT&CK Mapping

  • T1203 – Exploitation for Client Execution: Gaining initial access via malicious document exploitation.
  • T1547 – Boot or Logon Autostart Execution: Maintaining persistence through registry modifications.
  • T1071 – Application Layer Protocol: C2 communication over HTTP.
  • T1021 – Remote Services: Leveraging remote services for lateral movement.
  • T1041 – Exfiltration Over Command and Control Channel: Exfiltration of sensitive data.

Detection Opportunities

  • Monitor for unusual Office macro activity and execute logging for the execution of scripts.
  • Establish alerts for modifications to the registry keys related to startup programs.
  • Implement network traffic analysis to identify unusual outbound HTTP requests indicative of beaconing.

Analyst Notes

This incident underscores the importance of vigilant email filtering and user training around phishing threats. Additionally, the mechanisms used for persistence and lateral movement exemplify the need for robust endpoint detection and response solutions. The reliance on legitimate services for C2 and lateral movement further challenges detection efforts, underlying the necessity of leveraging behavioral analytics alongside traditional signature-based methods.

Source: Original Report