Malware

PurpleFox botnet variant uses WebSockets for more secure C2 communication

Researchers warn of a new evolution of the PurpleFox botnet, operators included exploits and leverage WebSockets for C2 communication.

Researchers from TrendMicro have documented a recent evolution of the PurpleFox botnet, the experts discovered a new .NET backdoor, dubbed FoxSocket, that is highly associated with the PurpleFox operation.

Its operators have added new exploits and payloads, according to the experts, the new variant leverages WebSockets to implement more secure C2 bidirectional communication.

Currently, the new variant was employed in attacks aimed at users in the Middle East. The analysis of the C2 infrastructure revealed that the most notable activity is in the US, Turkey, UAE, Iraq, and Saudi Arabia.

The attack chain starts with the execution of PowerShell commands that fetch a malicious payload from URLs associated with multiple compromised servers. Most of the servers are located in China and belong to the infrastructure of the PurpleFox botnet.

The payload fetched by the PowerShell targets 64-bit architecture systems, it is a long script consisting of three components:

  1. Tater (Hot Potato – privilege escalation)
  2. PowerSploit
  3. Embedded exploit bundle binary (privilege escalation)

Upon executing the script, it will check the Windows version of the targeted host and the presence of patches for the following list of vulnerabilities:

  • Windows 7/Windows Server 2008 [CVE-2020-1054 (KB4556836, KB4556843), CVE-2019-0808 (KB4489878, KB4489885, KB2882822]
  • Windows 8/Windows Server 2012 [CVE-2019-1458 (KB4530702, KB4530730)]
  • Windows 10/Windows Server 2019 [CVE-2021-1732 (KB4601354, KB4601345, KB4601315, KB4601319)]

“After selecting the appropriate vulnerability, it uses the PowerSploit module to reflectively load the embedded exploit bundle binary with the target vulnerability and an MSI command as arguments. As a failover, it uses the Tater module to launch the MSI command.” reads the analysis published by TrendMicro. “The goal is to install the MSI package as an admin without any user interaction.”

The MSI package first removes registry keys associated with the old Purple Fox installations if any are present, then it replaces the components of the malware with new ones.

The package also sets two registry values under the key “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager” and runs a .vbs script that creates a Windows firewall rule to block incoming connections on ports 135, 139, and 445. 

The final backdoor is a DLL file protected by the VMProtect.

The installer also uses a rootkit driver that hides its files, registry keys, and processes, to avoid detection.

This variant outstands for the use of WebSockets for communications.

“Afterward, the client will try to send the property PublicKey, which will be used at the C&C side on another ECDiffieHellmanCng object to generate a shared secret agreement. Eventually, this data will be sent on the WebSocket as the first key exchange message.” continues the analysis. “However, instead of sending it in cleartext, the client deploys a symmetric AES encryption for any communication over the WebSocket for the first exchange, as no shared secret is established yet, and the AES encryption will generate a default key for this first exchange. “

TrendMicro observed the following list of WebSocket commands and highlighted that there are some minor differences between variants across them.

Command codeFunctionality
20Sends the current date on the victim machine
30Leaks DriveInfo.GetDrives() results info for all the drives
40Leaks DirectoryInfo() results info for a specific directory
50FileInfo()results info for a specific file
60Recursive directory search
70Executes WMI queries – ManagementObjectSearcher()
80Closes the WebSocket Session
90Exits the process
100Spawns a new process
110Downloads more data from a specific URL to the victim machine
120DNS lookup from the victim machine
130Leaks specific file contents from the victim machine
140Writes new content to a specific location
150Downloads data then write to a specific file
160Renegotiates session key for symmetric encryption
180Gets current process ID/Name
210Returns the configuration parameter for the backdoor
220Kills the process then start the new process with a different config
230Kills specific process with PID
240Queries internal backdoor object properties
260Leaks hashes of some specific files requested
270Kills list of PIDs
280Deletes list of files/directories requested
290Moves list of files/directories to another location
300Creates new directory to a specific location

Researchers from TrendMicro also shared a list of Indicators of Compromise for this threat.

Follow me on Twitter: @securityaffairs and Facebook

[adrotate banner=”9″][adrotate banner=”12″]

Pierluigi Paganini

(SecurityAffairs – hacking, PurpleFox botnet)

[adrotate banner=”5″]

[adrotate banner=”13″]

Pierluigi Paganini

Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer. Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines. Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.

Recent Posts

Cisco addressed high-severity flaws in IOS and IOS XE software

Cisco addressed multiple vulnerabilities in IOS and IOS XE software that can be exploited to…

4 hours ago

Google: China dominates government exploitation of zero-day vulnerabilities in 2023

Google's Threat Analysis Group (TAG) and Mandiant reported a surge in the number of actively…

11 hours ago

Google addressed 2 Chrome zero-days demonstrated at Pwn2Own 2024

Google addressed two zero-day vulnerabilities in the Chrome web browser that have been demonstrated during…

22 hours ago

INC Ransom stole 3TB of data from the National Health Service (NHS) of Scotland

The INC Ransom extortion group hacked the National Health Service (NHS) of Scotland and is threatening…

1 day ago

CISA adds Microsoft SharePoint bug disclosed at Pwn2Own to its Known Exploited Vulnerabilities catalog

U.S. Cybersecurity and Infrastructure Security Agency (CISA) adds a Microsoft SharePoint vulnerability disclosed at the…

1 day ago

The DDR Advantage: Real-Time Data Defense

This is the advantage of Data Detection and Response (DDR) for organizations aiming to build…

1 day ago

This website uses cookies.