When CISA discovered what it believed to be advanced persistent threat (APT) activity at a Federal Civilian Executive Branch (FCEB) entity between the middle of June through the middle of July 2022, it launched an incident response engagement. Responding to an incident, CISA discovered that attackers had used a Log4Shell flaw in an unpatched VMware Horizon server to install crypto mining software, laterally moved to the domain controller (DC), compromised credentials, and implanted Ngrok reverse proxies on several hosts to maintain persistence. The FCEB network was hacked by Iranian government-backed APT actors, according to the Computer Security Industry Association (CISA) and the Federal Bureau of Investigation (FBI).
Cybersecurity Information Sharing and Analysis Center (CISAC) and Federal Bureau of Investigation (FBI) have released a Cybersecurity Advisory (CSA) detailing the tactics, techniques, and procedures (TTPs) and indicators of compromise (IOCs) of the Iranian government-sponsored actors, with the goal of assisting network defenders in detecting and preventing related compromises.
The Computer Security Industry Association (CISA) and the Federal Bureau of Investigation (FBI) advise that any company using vulnerable VMware systems that has not yet applied the necessary patches or workarounds should assume compromise and begin threat hunting immediately. Assume lateral movement by threat actors, investigate connected systems (including the DC), and conduct privileged account audits if suspected initial access or compromise is detected based on IOCs or TTPs described in this CSA, as recommended by CISA and the FBI. The Mitigations section of this CSA should be applied by all organizations to safeguard against similar malicious cyber activity, regardless of whether or not evidence of compromise has been found.
For more information on Iranian government-sponsored Iranian malicious cyber activity, see CISA’s Iran Cyber Threat Overview and Advisories webpage and FBI’s Iran Threats webpage.
Technical Details
Please take note that MITRE ATT&CK for Enterprise, Version 11 is used in this advisory. Threat actors’ actions are tabulated according to MITRE ATT&CK® tactics and techniques, with mitigation and detection suggestions provided in the table provided in the MITRE ATT&CK Tactics and Techniques section.
Overview
CISA conducted a retrospective analysis in April 2022 using EINSTEIN, an FCEB-wide intrusion detection system (IDS) operated and monitored by CISA, and found evidence of possible APT activity on the network of an FCEB organization. CISA discovered two-way communication between the network and a malicious IP address linked to attacks on VMware Horizon servers using the Log4Shell vulnerability (CVE-2021-44228). Threat hunting incident response efforts were launched by CISA in collaboration with the FCEB organization; nevertheless, more suspected APT activity was spotted by CISA before the deployment of an incident response team. CISA saw traffic from the IP address 51.89.181[.]64 using HTTPS to access the VMware server. Trusted third-party reporting indicates that the LDAP server located at 51.89.181[.]64 is used by threat actors who exploit Log4Shell. CISA discovered a possible LDAP callback to this IP address on port 443 after HTTPS traffic. The victim server returned this Log4Shell LDAP callback to the actors’ server, and CISA saw a DNS query for usnationny[.]cf resolve back to 51.89.181.64 during this time.
Based on the successful callback to the indicator, CISA concluded that this traffic indicated a confirmed compromise and reported its findings to the organization, which subsequently discovered indicators of compromise during an investigation. CISA suspected the threat actors had compromised the organization’s DC after receiving reports that linked activity on 51.89.181[. ]64’s Log4Shell server to lateral movement and the targeting of DCs.
CISA conducted an onsite incident response engagement from the middle of June to the middle of July 2022, during which time it discovered that the company had been compromised as early as February 2022, most likely by APT actors sponsored by the Iranian government who installed XMRig crypto mining software. The attackers compromised credentials and implanted Ngrok reverse proxies before laterally spreading to the domain controller.
Threat Actor Activity
Attackers gained access [TA0001] to an unpatched VMware Horizon server in the company in February 2022 by exploiting Log4Shell [T1190]. CISA discovered an initial exploit that involved a 17.6-second connection to the malicious IP address 182.54.217[. ]2.
The following PowerShell command [T1059.001] was executed as part of the exploit payload, which added an exclusion tool to Windows Defender [T1562.001]:
I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
The exclusion tool allowlisted the entire c:\drive, enabling threat actors to download tools to the c:\drive without virus scans. The exploit payload then downloaded mdeploy.text from 182.54.217[.]2/mdepoy.txt to C:\users\public\mde.ps1 [T1105]. When executed, mde.ps1 downloaded file.zip from 182.54.217[.]2 and removed mde.ps1 from the disk [T1070.004].
file.zip contained XMRig cryptocurrency mining software and associated configuration files.
- WinRing0x64.sys – XMRig Miner driver
- wuacltservice.exe – XMRig Miner
- config.json – XMRig miner configuration
- RuntimeBroker.exe – Associated file. This file can create a local user account [T1136.001] and tests for internet connectivity by pinging 8.8.8.8 [T1016.001]. The exploit payload created a Scheduled Task [T1053.005] that executed RuntimeBroker.exe daily as SYSTEM. Note: By exploiting Log4Shell, the actors gained access to a VMware service account with administrator and system level access. The Scheduled Task was named RuntimeBrokerService.exe to masquerade as a legitimate Windows task.
See MAR 10387061-1.v1 for additional information, including IOCs, on these four files.
After obtaining initial access and installing XMRig on the VMWare Horizon server, the actors used RDP [T1021.001] and the built-in Windows user account DefaultAccount [T1078.001] to move laterally [TA0008] to a VMware VDI-KMS host. Once the threat actor established themselves on the VDI-KMS host, CISA observed the actors download around 30 megabytes of files from transfer[.]sh server associated with 144.76.136[.]153. The actors downloaded the following tools:
- PsExec – a Microsoft signed tool for system administrators.
- Mimikatz – a credential theft tool.
- Ngrok – a reverse proxy tool for proxying an internal service out onto an Ngrok domain, which the user can then access at a randomly generated subdomain at *.ngrok[.]io. CISA has observed this tool in use by some commercial products for benign purposes; however, this process bypasses typical firewall controls and may be a potentially unwanted application in production environments. Ngrok is known to be used for malicious purposes.[1]
The threat actors then executed Mimikatz on VDI-KMS to harvest credentials and created a rogue domain administrator account [T1136.002]. Using the newly created account, the actors leveraged RDP to propagate to several hosts within the network. Upon logging into each host, the actors manually disabled Windows Defender via the Graphical User Interface (GUI) and implanted Ngrok executables and configuration files. The threat actors were able to implant Ngrok on multiple hosts to ensure Ngrok’s persistence should they lose access to a machine during a routine reboot. The actors were able to proxy [T1090] RDP sessions, which were only observable on the local network as outgoing HTTPS port 443 connections to tunnel.us.ngrok[.]com and korgn.su.lennut[.]com (the prior domain in reverse). It is possible, but was not observed, that the threat actors configured a custom domain, or used other Ngrok tunnel domains, wildcarded here as *.ngrok[.]com, *.ngrok[.]io, ngrok.*.tunnel[.]com, or korgn.*.lennut[.]com.
Once the threat actors established a deep foothold in the network and moved laterally to the domain controller, they executed the following PowerShell command on the Active Directory to obtain a list of all machines attached to the domain [T1018]:
Powershell.exe get-adcomputer -filter * -properties * | select name,operatingsystem,ipv4address >
The threat actors also changed the password for the local administrator account [T1098] on several hosts as a backup should the rogue domain administrator account get detected and terminated. Additionally, the threat actor was observed attempting to dump the Local Security Authority Subsystem Service (LSASS) process [T1003.001] with task manager but this was stopped by additional anti-virus the FCEB organization had installed.
MITRE ATT&CK TACTICS AND TECHNIQUES
Initial Access |
|
|
|
Technique Title |
ID |
Use |
Recommendations |
Exploit Public-Facing Application |
The actors exploited Log4Shell for initial access to the organization’s VMware Horizon server. |
Mitigation/Detection: Use a firewall or web-application firewall and enable logging to prevent and detect potential Log4Shell exploitation attempts [M1050]. Mitigation: Perform regular vulnerability scanning to detect Log4J vulnerabilities and update Log4J software using vendor provided patches [M1016],[M1051]. |
|
Execution |
|
|
|
Technique Title |
ID |
Use |
Recommendation |
Command and Scripting Interpreter: PowerShell |
The actors ran PowerShell commands that added an exclusion tool to Windows Defender. The actors executed PowerShell on the AD to obtain a list of machines on the domain. |
Mitigation: Disable or remove PowerShell for non-administrative users [M1042],[M1026] or enable code-signing to execute only signed scripts [M1045]. Mitigation: Employ anti-malware to automatically detect and quarantine malicious scripts [M1049]. |
|
Persistence |
|
|
|
Technique Title |
ID |
Use |
Recommendations |
Account Manipulation |
The actors changed the password for the local administrator account on several hosts. |
Mitigation: Use multifactor authentication for user and privileged accounts [M1032]. Detection: Monitor events for changes to account objects and/or permissions on systems and the domain, such as event IDs 4738, 4728, and 4670. Monitor for modification of accounts in correlation with other suspicious activity [DS0002]. |
|
Create Account: Local Account |
The actors’ malware can create local user accounts. |
Mitigation: Configure access controls and firewalls to limit access to domain controllers and systems used to create and manage accounts. Detection: Monitor executed commands and arguments for actions that are associated with local account creation, such as net user /add , useradd, and dscl -create [DS0017]. Detection: Enable logging for new user creation [DS0002]. |
|
Create Account: Domain Account |
The actors used Mimikatz to create a rogue domain administrator account. |
Mitigation: Configure access controls and firewalls to limit access to domain controllers and systems used to create and manage accounts. Detection: Enable logging for new user creation, especially domain administrator accounts [DS0002]. |
|
Scheduled Task/Job: Scheduled Task |
The actors’ exploit payload created Scheduled Task RuntimeBrokerService.exe, which executed RuntimeBroker.exe daily as SYSTEM. |
Mitigation: Configure settings for scheduled tasks to force tasks to run under the context of the authenticated account instead of allowing them to run as SYSTEM [M1028]. Detection: Monitor for newly constructed processes and/or command-lines that execute from the svchost.exe in Windows 10 and the Windows Task Scheduler taskeng.exe for older versions of Windows [DS0009] Detection: Monitor for newly constructed scheduled jobs by enabling the Microsoft-Windows-TaskScheduler/Operational setting within the event logging service [DS0003]. |
|
Valid Accounts: Default Accounts |
The actors used built-in Windows user account DefaultAccount. |
Mitigation: Change default usernames and passwords immediately after the installation and before deployment to a production environment [M1027]. Detection: Develop rules to monitor logon behavior across default accounts that have been activated or logged into [DS0028]. |
|
Defense Evasion |
|
|
|
Technique Title |
ID |
Use |
Recommendations |
Impair Defenses: Disable or Modify Tools
|
The actors added an exclusion tool to Windows Defender. The tool allowlisted the entire c:\drive, enabling the actors to bypass virus scans for tools they downloaded to the c:\drive. The actors manually disabled Windows Defender via the GUI. |
Mitigation: Ensure proper user permissions are in place to prevent adversaries from disabling or interfering with security services. [M1018]. Detection: Monitor for changes made to Windows Registry keys and/or values related to services and startup programs that correspond to security tools such as HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender [DS0024]. Detection: Monitor for telemetry that provides context for modification or deletion of information related to security software processes or services such as Windows Defender definition files in Windows and System log files in Linux [DS0013]. Detection: Monitor processes for unexpected termination related to security tools/services [DS0009]. |
|
Indicator Removal on Host: File Deletion |
The actors removed malicious file mde.ps1 from the dis. |
Detection: Monitor executed commands and arguments for actions that could be utilized to unlink, rename, or delete files [DS0017]. Detection: Monitor for unexpected deletion of files from the system [DS0022]. |
|
Credential Access |
|
|
|
Technique Title |
ID |
Use |
Recommendations |
OS Credential Dumping: LSASS Memory |
The actors were observed trying to dump LSASS process. |
Mitigation: With Windows 10, Microsoft implemented new protections called Credential Guard to protect the LSA secrets that can be used to obtain credentials through forms of credential dumping [M1043] Mitigation: On Windows 10, enable Attack Surface Reduction (ASR) rules to secure LSASS and prevent credential stealing [M1040]. Mitigation: Ensure that local administrator accounts have complex, unique passwords across all systems on the network [M1027]. Detection: Monitor for unexpected processes interacting with LSASS.exe. Common credential dumpers such as Mimikatz access LSASS.exe by opening the process, locating the LSA secrets key, and decrypting the sections in memory where credential details are stored. [DS0009]. Detection: Monitor executed commands and arguments that may attempt to access credential material stored in the process memory of the LSASS [DS0017]. |
|
Credentials from Password Stores |
The actors used Mimikatz to harvest credentials. |
Mitigation: Organizations may consider weighing the risk of storing credentials in password stores and web browsers. If system, software, or web browser credential disclosure is a significant concern, technical controls, policy, and user training may be used to prevent storage of credentials in improper locations [M1027]. Detection: Monitor for processes being accessed that may search for common password storage locations to obtain user credentials [DS0009]. Detection: Monitor executed commands and arguments that may search for common password storage locations to obtain user credentials [DS0017]. |
|
Discovery |
|
|
|
Technique Title |
ID |
Use |
Recommendations |
Remote System Discovery |
The actors executed a PowerShell command on the AD to obtain a list of all machines attached to the domain. |
Detection: Monitor executed commands and arguments that may attempt to get a listing of other systems by IP address, hostname, or other logical identifier on a network that may be used for lateral movement [DS0017]. Detection: Monitor for newly constructed network connections associated with pings/scans that may attempt to get a listing of other systems by IP address, hostname, or other logical identifier on a network that may be used for lateral movement [DS0029]. Detection: Monitor for newly executed processes that can be used to discover remote systems, such as ping.exe and tracert.exe, especially when executed in quick succession [DS0009]. |
|
System Network Configuration Discovery: Internet Connection Discovery |
The actors’ malware tests for internet connectivity by pinging 8.8.8.8. |
Mitigation: Monitor executed commands, arguments [DS0017] and executed processes (e.g., tracert or ping) [DS0009] that may check for internet connectivity on compromised systems. |
|
Lateral Movement |
|
|
|
Technique Title |
ID |
Use |
Recommendations |
Remote Services: Remote Desktop Protocol |
The actors used RDP to move laterally to multiple hosts on the network. |
Mitigation: Use MFA for remote logins [M1032]. Mitigation: Disable the RDP service if it is unnecessary [M1042]. Mitigation: Do not leave RDP accessible from the internet. Enable firewall rules to block RDP traffic between network security zones within a network [M1030]. Mitigation: Consider removing the local Administrators group from the list of groups allowed to log in through RDP [M1026]. Detection: Monitor for user accounts logged into systems associated with RDP (ex: Windows EID 4624 Logon Type 10). Other factors, such as access patterns (ex: multiple systems over a relatively short period of time) and activity that occurs after a remote login, may indicate suspicious or malicious behavior with RDP [DS0028]. |
|
Command and Control |
|
|
|
Technique Title |
ID |
Use |
Recommendations |
Proxy |
The actors used Ngrok to proxy RDP connections and to perform command and control. |
Mitigation: Traffic to known anonymity networks and C2 infrastructure can be blocked through the use of network allow and block lists [M1037]. Detection: Monitor and analyze traffic patterns and packet inspection associated to protocol(s) that do not follow the expected protocol standards and traffic flows (e.g., extraneous packets that do not belong to established flows, gratuitous or anomalous traffic patterns, anomalous syntax, or structure) [DS0029]. |
|
Ingress Tool Transfer |
The actors downloaded malware and multiple tools to the network, including PsExec, Mimikatz, and Ngrok. |
Mitigation: Employ anti-malware to automatically detect and quarantine malicious scripts [M1049].
|
Source: CISA, Cyber Threat Actors ATT&CK Techniques for Enterprise
INCIDENT RESPONSE
If indicators of compromise (IOCs) or techniques of compromise (TTPs) in this CSA lead to a suspicion of initial access or compromise, CISA recommends that organizations investigate connected systems and the DC as a first line of defense against further lateral movement by threat actors.
- Immediately isolate affected systems.
- Collect and review relevant logs, data, and artifacts. Take a memory capture of the device(s) and a forensic image capture for detailed analysis.
- Consider soliciting support from a third-party incident response organization that can provide subject matter expertise to ensure the actor is eradicated from the network and to avoid residual issues that could enable follow-on exploitation.
I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
Mitigations
- Install updated builds to ensure affected VMware Horizon and UAG systems are updated to the latest version.
- If updates or workarounds were not promptly applied following VMware’s release of updates for Log4Shell in December 2021, treat those VMware Horizon systems as compromised. Follow the pro-active incident response procedures outlined above prior to applying updates. If no compromise is detected, apply these updates as soon as possible.
- See VMware Security Advisory VMSA-2021-0028.13 and VMware Knowledge Base (KB) 87073 to determine which VMware Horizon components are vulnerable.
- Note: Until the update is fully implemented, consider removing vulnerable components from the internet to limit the scope of traffic. While installing the updates, ensure network perimeter access controls are as restrictive as possible.
- If upgrading is not immediately feasible, see KB87073 and KB87092 for vendor-provided temporary workarounds. Implement temporary solutions using an account with administrative privileges. Note that these temporary solutions should not be treated as permanent fixes; vulnerable components should be upgraded to the latest build as soon as possible.
- Prior to implementing any temporary solution, ensure appropriate backups have been completed.
- Verify successful implementation of mitigations by executing the vendor supplied script Horizon_Windows_Log4j_Mitigations.zip without parameters to ensure that no vulnerabilities remain. See KB87073 for details.
- If updates or workarounds were not promptly applied following VMware’s release of updates for Log4Shell in December 2021, treat those VMware Horizon systems as compromised. Follow the pro-active incident response procedures outlined above prior to applying updates. If no compromise is detected, apply these updates as soon as possible.
- Keep all software up to date and prioritize patching known exploited vulnerabilities (KEVs).
- Minimize the internet-facing attack surface by hosting essential services on a segregated DMZ, ensuring strict network perimeter access controls, and not hosting internet-facing services that are not essential to business operations. Where possible, implement regularly updated web application firewalls (WAF) in front of public-facing services. WAFs can protect against web-based exploitation using signatures and heuristics that are likely to block or alert on malicious traffic.
- Use best practices for identity and access management (IAM) by implementing phishing resistant multifactor authentication (MFA), enforcing use of strong passwords, regularly auditing administrator accounts and permissions, and limiting user access through the principle of least privilege. Disable inactive accounts uniformly across the AD, MFA systems, etc.
- If using Windows 10 version 1607 or Windows Server 2016 or later, monitor or disable Windows DefaultAccount, also known as the Default System Managed Account (DSMA).
- Audit domain controllers to log successful Kerberos Ticket Granting Service (TGS) requests and ensure the events are monitored for anomalous activity.
- Secure accounts.
- Enforce the principle of least privilege. Administrator accounts should have the minimum permission necessary to complete their tasks.
- Ensure there are unique and distinct administrative accounts for each set of administrative tasks.
- Create non-privileged accounts for privileged users and ensure they use the non-privileged accounts for all non-privileged access (e.g., web browsing, email access).
- Create a deny list of known compromised credentials and prevent users from using known-compromised passwords.
- Secure credentials by restricting where accounts and credentials can be used and by using local device credential protection features.
- Use virtualizing solutions on modern hardware and software to ensure credentials are securely stored.
- Ensure storage of clear text passwords in LSASS memory is disabled. Note: For Windows 8, this is enabled by default. For more information see Microsoft Security Advisory Update to Improve Credentials Protection and Management.
- Consider disabling or limiting NTLM and WDigest Authentication.
- Implement Credential Guard for Windows 10 and Server 2016 (refer to Microsoft: Manage Windows Defender Credential Guard for more information). For Windows Server 2012R2, enable Protected Process Light for Local Security Authority (LSA).
- Minimize the AD attack surface to reduce malicious ticket-granting activity. Malicious activity such as “Kerberoasting” takes advantage of Kerberos’ TGS and can be used to obtain hashed credentials that threat actors attempt to crack.
The CSA includes a malware analysis report (MAR), MAR-10387061-1-v1 XMRig Cryptocurrency Mining Software, on the mining software that the APT actors used against the compromised FCEB network. The CSA also provides tactics, techniques, and procedures (TTPs) and indicators of compromise (IOCs) obtained from the incident response as well as recommended mitigations.