Advanced Persistent Threat: Analysis of the APT34: OilRig Campaign and Its Techniques

Alex Morgan — Threat Intelligence Analyst

Key Takeaways

  • APT34 leverages social engineering to gain initial access through spear-phishing emails.
  • The malware employed demonstrated advanced persistence mechanisms, including registry modifications and scheduled tasks.
  • Command and Control communications were primarily observed via HTTP and HTTPS, with a focus on obfuscation techniques to evade detection.

Executive Summary

Our analysis of the APT34, also known as OilRig, sheds light on the sophisticated tactics used by this Iranian threat actor. This group has been known to target entities within the energy sector, employing a variety of methodologies to infiltrate networks, maintain persistence, and achieve their objectives. The sample we examined, a malware variant linked to APT34, illustrates a well-structured attack chain that highlights their operational capabilities.

Initial Access

During the investigation, we observed that APT34 often initiates attacks via custom spear-phishing campaigns. These are typically crafted to appear as legitimate business communications, embedded with malicious attachments or links. In the instance we analyzed, the dropper payload was delivered as a Microsoft Word document configured to exploit vulnerabilities within the Microsoft Office suite. Specifically, the document employed Technique T1203 – Exploit Public-Facing Application, executing embedded macros which ultimately triggered the download of the malicious implant from a remote host.

Execution & Persistence

Upon execution, the payload utilized a combination of Technique T1059 – Command-Line Interface and Technique T1547 – Boot or Logon Autostart Execution to establish persistence. Our analysis revealed that the implant created multiple persistence mechanisms, including modifications to the Windows registry, specifically under HKCU\Software\Microsoft\Windows\CurrentVersion\Run to ensure the malware re-executes upon user logon. Additionally, scheduled tasks were established in C:\Windows\System32\Tasks, allowing the actor continued access even after system reboots.

Command and Control

Following successful persistence establishment, we identified that the implant initiated outgoing connections to a remote command and control (C2) server over HTTP and HTTPS. The C2 communication was heavily obfuscated, using a mix of Base64 encoding and dynamic domain generation algorithms to minimize traceability. This is indicative of the actor’s intent to maintain stealth during operations, leveraging Technique T1071 – Application Layer Protocol for its C2 communication protocol. Notably, we detected beaconing behavior every 15 minutes, aligning with the actor’s operational pattern to receive commands and exfiltrate data.

Lateral Movement & Discovery

As the threat actor progressed through the network, our investigation uncovered evidence of lateral movement utilizing Technique T1021 – Remote Services. The implant attempted to leverage Windows Management Instrumentation (WMI) and PowerShell remoting to further propagate within the network. This method allowed the actor to enumerate user accounts and network shares, thereby facilitating unauthorized access to critical assets. The persistence of the malware provided the actor with a foothold, making it easier to deploy additional payloads.

Impact & Objectives

The primary objectives of APT34 in this campaign appeared to be both reconnaissance and data exfiltration. Our analysis found indications that sensitive information related to energy sector operations, including proprietary technology and trade secrets, was targeted. The malware facilitated multiple forms of data extraction, including exfiltrating files via FTP. The actor’s emphasis on maintaining access over an extended period signifies an intention to conduct prolonged surveillance and extraction of sensitive data, aligning with state-sponsored objectives.

MITRE ATT&CK Mapping

  • T1203 – Exploit Public-Facing Application: Exploiting vulnerabilities in public-facing applications to achieve initial access.
  • T1059 – Command-Line Interface: Utilizing CLI for executing commands.
  • T1547 – Boot or Logon Autostart Execution: Establishing persistence through registry edits and scheduled tasks.
  • T1071 – Application Layer Protocol: Leveraging HTTP/HTTPS for C2 communication.
  • T1021 – Remote Services: Using remote services for lateral movement within the network.

Detection Opportunities

  • Monitor for suspicious registry changes, specifically targeting run keys for persistence.
  • Implement detection rules for unusual PowerShell execution patterns or WMI usage across the network.
  • Analyze outbound traffic for anomalies, particularly HTTP/HTTPS connections to newly observed domains.

Analyst Notes

The sophistication of the APT34 attack vector emphasizes the necessity for organizations to fortify defenses against social engineering tactics. Continuous monitoring and proactive threat hunting are imperative to detect early signs of such intrusions. Additionally, organizations should prioritize employee training and awareness programs focusing on phishing attacks and recognizing suspicious communications.

Source: Original Report