ZeroHour
Security Affairspublished ()ingested @securityaffairs

PurpleFox botnet uses WebSockets for more secure C2 communication

Vulnerabilities mentionedAll →

CVEVulnerabilityCVSSEPSSFlagsAffectedExposurePublished
CVE-2019-0808
Local Privilege Escalation in Microsoft Win32k on Windows 7 and Server 2008

CVE-2019-0808 is an elevation-of-privilege flaw in the Windows Win32k kernel component, which fails to properly handle objects in memory, allowing a local, low-privileged attacker to execute code in the kernel and take full control of the system (CVSS 3.1: 7.8, high impact on confidentiality, integrity and availability). It is triggered by a local attacker running crafted actions against vulnerable Win32k system calls; a public proof of concept based on the NtUserMNDragOver call path is available. Per the source data, affected products are Windows 7 and Windows Server 2008 (exact service-pack/version ranges are not specified in the data). The bug was one of two Win32k zero-days patched in the March 2019 Patch Tuesday, was being actively exploited in targeted attacks attributed to the FruityArmor and SandCat groups, and Microsoft followed with an out-of-band fix after Google disclosed the zero-day. It is listed in CISA KEV (added 2021-11-03, ransomware use unknown), and EPSS currently assigns roughly a 53% probability of exploitation within 30 days (99th percentile).

Do: Apply the March 2019 Microsoft security updates (or the out-of-band fix) for Windows 7 and Windows Server 2008, including Extended Security Updates for systems past the January 2020 end of support, per the CISA KEV required action. Prioritize shared/terminal and RDS hosts where low-privileged users log in, since successful exploitation grants kernel-level privileges, and review those systems for indicators of the FruityArmor/SandCat targeted intrusions. No reliable workaround is documented for this Win32k flaw, so patching is the primary mitigation.

7.853% KEV PoC
  • Microsoft Windows 7
  • Microsoft Windows Server 2008
massroughly 500 million+ Windows 7 / Windows Server 2008 installations (Windows 7 held ~40% desktop OS share in early 2019)
CVE-2019-1458
Win32k Object-Handling Flaw Enables Local Privilege Escalation in Microsoft Windows

An elevation of privilege vulnerability exists in the Windows kernel's Win32k component, which fails to properly handle objects in memory (an uninitialized-variable condition). A local attacker who can already execute limited code on a target machine can trigger the flaw to gain kernel-level execution and elevate to SYSTEM privileges, giving full control of the host. Affected platforms are Windows 7, Windows 8.1, Windows RT 8.1, Windows 10 1507 and 1607, and Windows Server 2008, 2012 and 2016. The bug was patched in Microsoft's December 2019 Patch Tuesday after being actively exploited as a zero-day, including in the WizardOpium campaign attributed to a North Korea-linked actor. It is listed in CISA's Known Exploited Vulnerabilities catalog (added 2022-01-10, with known ransomware use) and carries a high EPSS of 74.3%.

Do: Apply the December 2019 security updates (or later cumulative updates) from Microsoft per CISA's required action. Because Windows 7/8.1 and Server 2008/2012 are past end of support and Server 2016 support is winding down, prioritize migration to supported Windows versions. Hunt for signs of local privilege escalation and follow-on activity, since this bug was used as a zero-day and appears in ransomware attack chains.

7.874% KEV ransomware PoC ×2
  • microsoft windows 10 1507 all supported editions at time of patch (December 2019)
  • microsoft windows 10 1607 all supported editions at time of patch (December 2019)
  • microsoft windows 7 all supported editions
  • +5 more
masshundreds of millions of devices (Windows 7 alone held roughly a third of desktop market share at disclosure; millions of Server 2008/2012/2016 hosts remain…
CVE-2020-1054
Privilege Escalation in Microsoft Windows Win32k Kernel Driver (CVE-2020-1054)

CVE-2020-1054 is an elevation-of-privilege flaw (CWE-787, an out-of-bounds memory access) in the Windows kernel-mode driver (win32k), which fails to properly handle objects in memory. To exploit it, an attacker who can already log on to an affected Windows machine must run a specially crafted application, which triggers the memory-handling error and allows arbitrary code execution in kernel mode. Successful exploitation effectively yields full SYSTEM-level control of the host: the attacker can install programs, view, change or delete any data, and create new accounts with full user rights. Affected products per the CPE data are Windows 7, 8.1, RT 8.1, Windows 10 versions 1507 through 1909, and Windows Server 1803 and 1903. The flaw was fixed in Microsoft's May 2020 Patch Tuesday, a public DrawIconEx-based local privilege escalation PoC exists, EPSS is 54.2% (99th percentile), and CISA added it to the KEV catalog on 2021-11-03, confirming exploitation in the wild; related threat reporting around this CVE ties it to malware campaigns such as PurpleFox and Raspberry Robin, while ransomware use is listed as unknown.

Do: Apply Microsoft's May 2020 security updates (or any later cumulative update) to Windows 7, 8.1, RT 8.1, Windows 10 1507–1909, and Windows Server 1803/1903, per the CISA KEV required action; prioritize multi-user hosts such as RDS servers where low-privileged users can run code. For legacy systems that no longer receive updates (e.g., Windows 7/8.1 post-EOL), limit local logon and software-execution rights for untrusted users and monitor for local privilege escalation activity.

7.054% KEV PoC
  • microsoft Windows 10 1507, 1607, 1709, 1803, 1809, 1903, 1909
  • microsoft Windows 7
  • microsoft Windows 8.1
  • +3 more
mass≈1 billion Windows devices (global Windows 10 install base plus the legacy Windows 7/8.1 estate)
CVE-2021-1732
Out-of-Bounds Write Local Privilege Escalation in Microsoft Win32k (CVE-2021-1732)

CVE-2021-1732 is a local elevation-of-privilege vulnerability (CWE-787, out-of-bounds write) in Microsoft's Win32k kernel driver, publicly characterized as an "offset confusion" in the Win32k ConsoleControl routine. It is triggered locally: a process with only low privileges can invoke the vulnerable Win32k functionality without any user interaction, causing a user-supplied offset/pointer to be mishandled in kernel mode and memory to be written out of bounds. An attacker who successfully exploits the flaw can execute code in the kernel and elevate to SYSTEM, gaining full control of the host — which makes it a valuable second-stage link in malware and ransomware chains. Any system running the affected Windows 10 releases (1803, 1809, 1909, 2004, 20H2) or Windows Server 2019/1909/2004/20H2 is exposed, though exploitation requires the attacker to already run code locally on the target. The flaw was fixed in Microsoft's February 2021 Patch Tuesday updates, was added to CISA's KEV catalog on 2021-11-03 with known ransomware use, and carries a very high EPSS score (78.4%, 100th percentile), indicating sustained exploitation pressure.

Do: Apply Microsoft's February 2021 (or later) Windows cumulative security updates to all affected Windows 10 and Windows Server systems, per vendor instructions — CISA's KEV listing requires federal agencies to patch. Prioritize hosts exposed to untrusted local users or already compromised by malware (e.g., ransomware or Raspberry Robin activity, which has used chained Windows LPEs), and hunt on unpatched hosts for signs of post-exploitation privilege escalation to SYSTEM.

7.878% KEV ransomware PoC ×2
  • Microsoft Windows 10 1803
  • Microsoft Windows 10 1809
  • Microsoft Windows 10 1909
  • +6 more
mass≈1 billion+ Windows devices (the listed builds spanned the mainstream Windows 10/Server install base)
Full article730 words · extracted from securityaffairs.com · click to collapse

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″]



Text extracted automatically; images, tables and formatting may be missing. Original: https://securityaffairs.com/123623/malware/purplefox-botnet-websockets.html