Posts

Windows PHP Servers in CGI Mode Vulnerable to Exploitation (CVE-2024-4577)

Overview 

The SonicWall Capture Labs threat research team became aware of an exploited-in-the-wild information disclosure vulnerability affecting the Windows-based PHP servers used in CGI mode. Identified as CVE-2024-4577 and given a CVSSv3 score of 9.8, the vulnerability is more severe than it initially appears. Labeled as an argument injection vulnerability and categorized as CWE-78 – Improper Neutralization of Special Elements used in an OS Command – this vulnerability allows an attacker to read/modify/execute any file on the system, take control and compromise affected servers. 

A proof of concept is publicly available on GitHub. The Windows machines running affected versions (PHP 8.3 < 8.3.8, PHP 8.2 < 8.2.20, PHP 8.1 < 8.1.29 or end-of-life) of PHP with specific locales in PHP-CGI mode on XAMPP installations are vulnerable. Although XAMPP is popular mainly for dev environments, up to 250k exposed Apache servers are running PHP on Windows, according to Shodan. PHP has released a patch, and it is advisable to update it immediately.  

Technical Overview  

This vulnerability allows threat actors to circumvent the PHP CGI mode by sending a crafted POST query to the vulnerable PHP server running Japanese and Chinese locales. 

PHP is a server scripting language, and a powerful tool for making dynamic and interactive web pages. It is extremely popular and is used in over 75% of all websites where the server-side programming language is known.  

The vulnerability is due to the misuse of the Best-Fit feature of encoding conversion in the Windows operating system which converts 0xAD to 0x2D. That means the trick lies in that %AD will be decoded to a “soft hyphen,” which PHP will turn into a real hyphen. While implementing PHP, the team overlooked this feature, allowing unauthenticated actors to bypass the security features of CVE-2012-1823, using specific characters or queries that allow them to execute arbitrary code. The PHP CGI module may misinterpret hyphen characters as PHP options, which may allow a malicious user to pass options to the PHP binary and thus run arbitrary PHP code on the server and compromise PHP sites. 

XAMPP users can be exploited directly when the Action directive is mapped to corresponding HTTP requests to a PHP-CGI executable binary in the Apache HTTP Server, as shown in Figure 1. 

Figure 1: PHP-CGI Function 

Figure 2: httpd-xampp.conf 

In another methodology, default XAMPP servers are vulnerable, because the PHP directory is exposed via ScriptAlias directive. 

ScriptAlias /php-cgi/ “C:/xampp/php/” 

Triggering the Vulnerability 

Before execution, there are a few basic vulnerability checks.  

  • Primarily, the operating system should be Windows. 
  • To ensure that CVE-2024-4577 would exploit a vulnerable PHP server, some lines related to the PHP-CGI function in httpd-xampp.conf should be enabled, as shown in Figures 1 and 2.  
  • The vulnerable PHP servers should be set to either Japanese or Chinese (Simplified or Traditional) locales. This setting can be performed as shown in Figure 3.

An example POST request to trigger the vulnerability would look like: 

http[:]//target-ip:port/?%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input 

This allows an attacker to inject command-line options into PHP when it is running in a CGI-based or default XAMPP setup. Malicious code can be passed through “php://input” and executed using the “auto_prepend_file” option to call “include_path.”. Additionally, the “auto_append_file” option is also accepted by vulnerable PHP servers. 

Exploiting the Vulnerability 

The necessary and sufficient condition to exploit the issue is a crafted POST request to vulnerable Apache servers with an enabled PHP-CGI function. An attacker only needs to be able to access the instance remotely which could be over the internet or a local network.  A working PoC with a crafted POST query aids in exploiting this vulnerability.  

Leveraging the publicly available PoC, a demonstration of exploitation can be seen in Figure 4. 

Figure 3: Control Panel 

Figure 4: CVE-2024-4577 Exploitation 

Out of the 250k exposed Apache servers running PHP on Windows, according to Shodan, multiple events were observed wherein attackers leveraged this vulnerability to upload malware in the second week of June 2024. According to Imperva analysis, it was peculiarly observed that the malware activity was a part of “TellYouThePass” ransomware. The ransomware appears to alter the service to an open directory, encrypt files and add ransom notes (with filenames including READ_ME9.html, READ_ME10.html, READ_ME11.html).  

There are around 1,000 compromised hosts online as of June 13, primarily in China, likely because Windows systems with Chinese or Japanese locales are inherently vulnerable due to their default XAMPP configuration. 

SonicWall Protections 

To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signatures have been released: 

  • IPS: 4451 – PHP CGI Argument Injection. 

Remediation Recommendations 

Considering the severe consequences of this vulnerability and the trend of nefarious activists trying to leverage the exploit in the wild, users are strongly encouraged to upgrade their instances to PHP’s new releases, 8.3.8, 8.2.20 and 8.1.29, to address the vulnerability.  

Relevant Links 

 

Microsoft Security Bulletin Coverage for June 2024

Overview

Microsoft’s June 2024 Patch Tuesday has 49 vulnerabilities, 24 of which are Elevation of Privilege. The SonicWall Capture Labs threat research team has analyzed and addressed Microsoft’s security advisories for the month of June 2024 and has produced coverage for seven of the reported vulnerabilities.

Vulnerabilities with Detections

CVE CVE Title Signature
CVE-2024-30080 Microsoft Message Queuing (MSMQ) Remote Code Execution Vulnerability IPS 4452 Microsoft Message Queuing RCE (CVE-2024-30080)
CVE-2024-30084 Windows Kernel-Mode Driver Elevation of Privilege Vulnerability ASPY 6802 Exploit-exe exe.MP_391
CVE-2024-30087 Win32k Elevation of Privilege Vulnerability ASPY 6805 Exploit-exe exe.MP_392
CVE-2024-30088 Windows Kernel Elevation of Privilege Vulnerability ASPY 6806  Exploit-exe exe.MP_393
CVE-2024-30089 Microsoft Streaming Service Elevation of Privilege Vulnerability ASPY 581 Exploit-exe exe.MP_390
CVE-2024-30091 Win32k Elevation of Privilege Vulnerability ASPY 580 Exploit-exe exe.MP_389
CVE-2024-35250 Windows Kernel-Mode Driver Elevation of Privilege Vulnerability ASPY 579 Exploit-exe exe.MP_388

 

Release Breakdown

The vulnerabilities can be classified into the following categories:

For June there is one Critical, 48 Important and zero Moderate vulnerabilities.

2024 Patch Tuesday Monthly Comparison

Microsoft tracks vulnerabilities that are being actively exploited at the time of discovery and those that have been disclosed publicly before the Patch Tuesday release for each month. The above chart displays these metrics as seen each month.

Release Detailed Breakdown

Denial of Service Vulnerabilities

CVE-2024-30065 Windows Themes Denial of Service Vulnerability
CVE-2024-30070 DHCP Server Service Denial of Service Vulnerability
CVE-2024-30083 Windows Standards-Based Storage Management Service Denial of Service Vulnerability
CVE-2024-35252 Azure Storage Movement Client Library Denial of Service Vulnerability

 

Elevation of Privilege Vulnerabilities

CVE-2024-29060 Visual Studio Elevation of Privilege Vulnerability
CVE-2024-30064 Windows Kernel Elevation of Privilege Vulnerability
CVE-2024-30066 Winlogon Elevation of Privilege Vulnerability
CVE-2024-30067 WinLogon Elevation of Privilege Vulnerability
CVE-2024-30068 Windows Kernel Elevation of Privilege Vulnerability
CVE-2024-30076 Windows Container Manager Service Elevation of Privilege Vulnerability
CVE-2024-30082 Win32k Elevation of Privilege Vulnerability
CVE-2024-30084 Windows Kernel-Mode Driver Elevation of Privilege Vulnerability
CVE-2024-30085 Windows Cloud Files Mini Filter Driver Elevation of Privilege Vulnerability
CVE-2024-30086 Windows Win32 Kernel Subsystem Elevation of Privilege Vulnerability
CVE-2024-30087 Win32k Elevation of Privilege Vulnerability
CVE-2024-30088 Windows Kernel Elevation of Privilege Vulnerability
CVE-2024-30089 Microsoft Streaming Service Elevation of Privilege Vulnerability
CVE-2024-30090 Microsoft Streaming Service Elevation of Privilege Vulnerability
CVE-2024-30091 Win32k Elevation of Privilege Vulnerability
CVE-2024-30093 Windows Storage Elevation of Privilege Vulnerability
CVE-2024-30099 Windows Kernel Elevation of Privilege Vulnerability
CVE-2024-35248 Microsoft Dynamics 365 Business Central Elevation of Privilege Vulnerability
CVE-2024-35250 Windows Kernel-Mode Driver Elevation of Privilege Vulnerability
CVE-2024-35253 Microsoft Azure File Sync Elevation of Privilege Vulnerability
CVE-2024-35254 Azure Monitor Agent Elevation of Privilege Vulnerability
CVE-2024-35255 Azure Identity Libraries and Microsoft Authentication Library Elevation of Privilege Vulnerability
CVE-2024-35265 Windows Perception Service Elevation of Privilege Vulnerability
CVE-2024-37325 Azure Science Virtual Machine (DSVM) Elevation of Privilege Vulnerability

 

Information Disclosure Vulnerabilities

CVE-2024-30069 Windows Remote Access Connection Manager Information Disclosure Vulnerability
CVE-2024-30096 Windows Cryptographic Services Information Disclosure Vulnerability
CVE-2024-35263 Microsoft Dynamics 365 (On-Premises) Information Disclosure Vulnerability

 

Remote Code Execution Vulnerabilities

CVE-2024-30052 Visual Studio Remote Code Execution Vulnerability
CVE-2024-30062 Windows Standards-Based Storage Management Service Remote Code Execution Vulnerability
CVE-2024-30063 Windows Distributed File System (DFS) Remote Code Execution Vulnerability
CVE-2024-30072 Microsoft Event Trace Log File Parsing Remote Code Execution Vulnerability
CVE-2024-30074 Windows Link Layer Topology Discovery Protocol Remote Code Execution Vulnerability
CVE-2024-30075 Windows Link Layer Topology Discovery Protocol Remote Code Execution Vulnerability
CVE-2024-30077 Windows OLE Remote Code Execution Vulnerability
CVE-2024-30078 Windows Wi-Fi Driver Remote Code Execution Vulnerability
CVE-2024-30080 Microsoft Message Queuing (MSMQ) Remote Code Execution Vulnerability
CVE-2024-30094 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30095 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30097 Microsoft Speech Application Programming Interface (SAPI) Remote Code Execution Vulnerability
CVE-2024-30100 Microsoft SharePoint Server Remote Code Execution Vulnerability
CVE-2024-30101 Microsoft Office Remote Code Execution Vulnerability
CVE-2024-30102 Microsoft Office Remote Code Execution Vulnerability
CVE-2024-30103 Microsoft Outlook Remote Code Execution Vulnerability

Critical Path Traversal Vulnerability in Check Point Security Gateways (CVE-2024-24919)

Overview

The SonicWall Capture Labs threat research team became aware of an exploited-in-the-wild information disclosure vulnerability affecting the Check Point Security Gateways. Identified as CVE-2024-24919 and given a CVSSv3 score of 8.6, the vulnerability is more severe than it initially appears. While labeled as a sensitive information disclosure vulnerability, it is actually a path traversal attack leading to an arbitrary read, allowing an attacker to read any file on the system. A proof of concept is publicly available on GitHub. To be vulnerable, the gateway needs to have Remote Access VPN or Mobile Access Software Blades enabled. Check Point has made a patch available, and it is advisable to update immediately.

Technical Overview

The flaw is a path traversal bug in the “/clients/MyCRL” endpoint, which can be exploited via manipulated POST requests containing the string “CSHELL/” somewhere in the request. Due to the use of the “strstr” function without proper sanitizing and validation of user input, an attacker can leverage path traversal sequences like “../” within the POST request (Figure 1). This ultimately allows access to sensitive files like /etc/shadow, which contain the password hashes for the system. For our analysis, we used version R80.

 

Figure 1: Vulnerable Code

To trigger and exploit this vulnerability, an attacker must send a POST request containing the string “CSHELL/” and include a path traversal sequence like “../”. This can be done in Python, as shown in the publicly available PoC and Figure 2 below, where “path” is the file the attacker wants access to.

Figure 2: Creating a POST request to obtain sensitive information

Leveraging this code, we can demonstrate dumping the gateway’s “/etc/shadow” file to obtain the system’s hashed credentials, as seen in Figure 3. An attacker can then attempt to crack these hashes to obtain administrative access to the firewall. The attack allows access to any file on the system and is not limited. Note that this is being done against the WAN interface, showing that it is accessible over the Internet.

Figure 3: Dumping Hashed Credentials

SonicWall Protections

To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signatures have been released:

  • IPS: 4440 Check Point Security Gateway Path Traversal

Remediation Recommendations

Check Point’s gateway users are advised to apply the hotfix found in the advisory immediately.  Check Point has labeled this a mandatory patch to express the criticality of the fix.

Relevant Links

 

 

 

 

 

 

INC Ransomware Behind Linux Threat

Overview

This week, the SonicWall Capture Labs Research team analyzed a sample of Linux ransomware. The group behind this ransomware, called INC Ransomware, has been active since it was first reported a year ago.

Infection Cycle

The malware is a Linux executable in ELF file format. A quick inspection of its strings revealed command-line arguments that can be passed to this ELF file.

Figure 1: List of Command Line Arguments

Upon execution with the identified parameters, the malware appends “INC” to the names of encrypted files.

Figure 2: Debug Output Using the –debug Option

Figure 3: Encrypted files with “INC” appended file extension

The malware also creates a file named “kill,” a shell script using the esxcli utility available in VMWare ESXi to list and kill all virtual machine processes if running in an ESXi environment. Since our analysis was not conducted in such an environment, this command resulted in an error as the utility was not found.

Figure 4: Content of the “kill” and delete scripts

Another file created is “delete,” which is a shell script using the ESXi command-line utility vim-cmd to delete all available virtual machines.
Copies of ransom notes were dropped in directories where files were encrypted, consistent with other ransomware behavior.

Figure 5: Contents of “Inc_readme.html” Ransom note

The parameter ‘–motd’ also changed the message of the day (MOTD) on the infected machine to display the ransom note message upon successful login.

Figure 6: Message of the Day shows ransom note message

Visiting the URL in the ransom note led to a blog site listing all supposed victims.

Figure 7: INC Ransom blog site

SonicWall Protections

SonicWall Capture Labs provides protection against this threat via the following signature:

  • GAV: LinuxINC.RSM(Trojan)

This threat is also detected by SonicWall Capture ATP w/RTDMI and the Capture Client endpoint solutions.

For further details, visit the official man page for MOTD.

 

Confluence Data Center and Server Remote Code Execution Vulnerability

Overview

The SonicWall Capture Labs threat research team became aware of a remote code execution vulnerability in the Atlassian Confluence Data Center and Server, assessed its impact and developed mitigation measures. Confluence Server is a software to manage documentation and knowledge bases with an ubiquitous presence across the globe. Identified as CVE-2024-21683, Confluence Data Center and Server before version 8.9.1(data center only), 8.5.9 LTS and 7.19.22 LTS allows an authenticated threat actor with the privilege of adding new macro languages to execute arbitrary code, earning a high CVSS score of 8.3. Confluence users are encouraged to upgrade their instances to the latest fixed version, as mentioned by the vendor in the advisory.

Technical Overview

This vulnerability arises due to a flaw in the input validation mechanism in the ‘Add a new language’ function of the ‘Configure Code Macro’ section. This function allows users to upload a new code block macro language definition to customize the formatting and syntax highlighting. It expects the Javascript file to be formatted according to the custom brush syntax. Insufficient validation allows the authenticated attacker to inject malicious Java code embedded in a file, such as java.lang.Runtime.getRuntime().exec(”touch /tmp/poc”) , which will be executed on the server.

Triggering the Vulnerability

Leveraging the vulnerability mentioned above requires the attacker to meet the below prerequisites.

  1. The attacker must have network access to the target vulnerable system.
  2. The attacker must have the privilege to add new macro languages.
  3. The forged JavaScript language file containing malicious Java code needs to be uploaded to the Configure Code Macro > Add a new language

The following steps will walk through the process of exploitation and the measures taken to address the vulnerability in the updated version. We used Confluence versions 8.5.0 and 8.5.9 in our tests.

To begin with, the attacker uploads the language file containing malicious Java code (similar to the one mentioned above) on the page seen in Figure 1.

Figure 1: Add a new language page

The payload will be sent for evaluation to the ‘parseLanguage’ method of the ‘RhinoLanguageParser’ class, which can be found at the below location:

WEB-INF/atlassian-bundled-plugins/com.atlassian.confluence.ext.newcode-macro-plugin-5.0.1.jar!/com/atlassian/confluence/ext/code/languages/impl/RhinoLanguageParser.class

The ‘script’ variable will be formed and the ‘evaluateString’ method will process the payload, as illustrated in Figure 2.

Figure 2: Payload evaluation by RhinoLanguageParser

If we step-into the function, the ‘evaluateString’ method will further pass the control to the ‘doTopCall’ method of the ‘ScriptRuntime’ class as seen in Figure 3. So far, the behavior of both the vulnerable and fixed versions is identical.

Figure 3: Execution of the payload by ScriptRuntime class

The result of executing the ‘doTopCall’ method (shown in Figure 3) behaves differently in the vulnerable and fixed versions. The fixed version (8.5.9) throws a ‘RhinoException’ while executing ‘doTopCall’ jumps directly to line#92 and abruptly terminates the execution of the ‘evaluateString’ method of the ‘RhinoLanguageParser’ class, as seen in Figure 4. Thanks to enhanced checks, it prevents using Java references in the uploaded file and displays ‘java is not defined’ in an exception message.

Figure 4: Abruptly terminated execution in fixed version

On the other hand, the vulnerable version (8.5.0) allows the execution of the ‘doTopCall’ and hence enables the execution of the ‘evaluateString’ method of the ‘RhinoLanguageParser’ class. It also throws the ‘InvalidLanguageException’ later on, but only after executing the injected malicious Java code as seen in Figure 5.

Figure 5: Malicious code execution in a vulnerable version

Although both the vulnerable and fixed versions of the Confluence server display similar errors on the GUI, as seen in Figure 6, the damage has already been done in the vulnerable version.

Figure 6: Common error on GUI

Exploitation

The exploitation of this vulnerability yields the remote threat actor the ability to execute arbitrary code on the server. It has a high impact on the confidentiality, integrity and availability of the system and does not require user interaction.

To achieve the remote code execution, the forged JavaScript language file with crafted payload needs to be uploaded, which will form a request as seen in the top portion of Figure 7. This request will generate a file ‘/tmp/poc’ as mentioned in the payload, as seen in the bottom portion of Figure 7.

Figure 7: Malformed request(above) and RCE in vulnerable instance(below)

Additionally, the payload can be modified to yield a reverse shell as seen in Figure 8.

Figure 8: Achieving reverse shell

SonicWall Protections

To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signatures have been released:

  • IPS: 4437 Atlassian Confluence Data Center and Server RCE
  • IPS: 4438 Atlassian Confluence Data Center and Server RCE 2

Remediation Recommendations

Considering Confluence Server’s pivotal role in maintaining an organization’s knowledge base, users are strongly encouraged to upgrade their instances to the latest versions, as mentioned in the vendor advisory.

Relevant Links

WordPress Unauthenticated Arbitrary SQL Execution Vulnerability

Overview

The SonicWall Capture Labs threat research team became aware of a noteworthy vulnerability –an SQL injection in the WordPress plugin Automatic by ValvePress – assessed its impact and developed mitigation measures for it. Around ~38k active users have installed this premium plugin. The issue allows trivial SQL injection attacks against the plugin user’s authentication process, which could allow WordPress website takeovers. The SQL vulnerability is identified as CVE-2024-27956 and was assigned a critical CVSSv3 score of 9.9.  Considering the sizeable user base, low attack complexity, and publicly available exploit code, including a simple SQL query, WordPress users are strongly encouraged to upgrade their instances to the latest or automatic plugin version above 3.92.1 with utmost priority.

Technical Overview

This vulnerability allows threat actors to circumvent the authentication mechanism by sending a crafted SQL query to the web server.

The WordPress Automatic plugin, developed by Valvepress, is popularly known for automatically posting content from any website. It can import content from popular sites like YouTube, Flickr, Vimeo, Twitter and other social media platforms utilizing the APIs from almost any website. It can also generate content using OpenAI’s ChatGPT.

CVE-2024-27956 arose due to improper neutralization of special elements used in an SQL Command. This allows unauthenticated actors to bypass the normal authentication process and inject SQL code that grants them elevated system privileges. This further allows nefarious activists to create admin‑level user accounts, upload malicious files and take full control of affected sites. Out of the 5.5 million attacks observed, as reported by HackerNews in the last week of March 2024, it was observed that attackers changed the name of the vulnerable file “inc/csv.php” and renamed sensitive files to prevent the site owner or fellow hackers from controlling the hijacked site. Once a WordPress site is under their control, attackers ensure the longevity of their access by creating backdoors and modifying the code.

Triggering the Vulnerability

The flaw exists in “inc/csv.php”, which generally resides under the plugin installation directory. A typical path to the vulnerable file is “/wp‑content/plugins/wp‑automatic/inc/csv.php”. It is also shown in our PoC demonstration in Figure 2.

WP users can supply any random SQL query to the $q variable, as shown in Figure 1. This variable will be further executed on line 32 of  Figure 1, with $wpdb->get_results( $q).

Figure 1: inc/csv.php

Prior to execution, there are basic authentication and integrity checks.

  • The first check involves the $current_user->user_pass This value would be an empty string if an unauthenticated user accessed the file.
  • The second check needs only the MD5 value of the supplied SQL query to the $integ since $current_user->user_pass is an empty string.
  • Additionally, before the two checks, there is a check of if(wp_automatic_trim($auth == ”)), which means one can’t just input an empty string to the $auth.
  • To bypass this, an attacker can supply a single whitespace (” “) to the $auth as &auth=%00 and achieve an arbitrary SQL query execution.

An example POST request to trigger the vulnerability would look like:

http[:]//target-ip:port/wp-content/plugins/wp-automatic/inc/csv.php

q={{query}}&auth=%00&integ={{md5query}}

With the authentication parameter containing whitespace, as shown in Figure 2.

Exploiting the Vulnerability

To exploit the issue, a WordPress setup with ValvePress’ vulnerable WordPress automatic plugin (< 3.92.1 version) is needed. An attacker only needs to be able to access the instance remotely which could be over the internet or a local network.  A working PoC with a crafted SQL query aids in exploiting this vulnerability.

A demonstration of exploitation based on the publicly available PoC can be seen in Figure 2 (below).

Figure 2: CVE-2024-27956 Exploitation

SonicWall Protections

To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signatures have been released:

IPS: 19918 – WordPress Automatic Plugin SQL Injection

Remediation Recommendations

Considering the severe consequences of this vulnerability and the trending of nefarious activists trying to  leverage the exploit in the wild, users are strongly encouraged to update their instances to WP automatic plugin version 3.92.1 or later to remove the vulnerability.

Relevant Links

Politically Charged Ransomware Weaponized as a File Destroyer

The SonicWall Capture Labs threat research team has been observing a growth of malware built using the Chaos ransomware builder. The sample we have analyzed here is built using this kit, however, it is not intended to work as traditional ransomware, but rather, as a file destroyer. The intent appears to be the destruction of files in response to Italy’s stance on the Israel-Palestine conflict. It purports to be created on behalf of the Italian Socialist Party and is likely aimed at infecting machines within the Italian government’s infrastructure.

Infection Cycle

The malware uses the following icon:

Upon infection, files on the system are encrypted. Each file is given a file extension consisting of four random alphanumeric characters. As this malware is intended to destroy files, the decryption key is probably not stored by the attackers for file retrieval later on in exchange for money. A file named “Leggimi.txt” (“Read me” in Italian) is dropped into directories containing encrypted files. It contains the following message in Italian:

A rough translation of that message is as follows:

—————————- -Ransomware route

Italy must be punished for its alliance with the fascist state
By Israel, this malware was scheduled by Marxisti-Leninisti-Maoisti
To spread the anti -medical thought. Of the Palestinians are dying for Your actions, I will kill your files. There is no way to recover them.

Palestine Libera
Italy Red Unit and Socialists

The message makes no mention of file decryption for payment and no contact information is presented. Any encrypted files are therefore irretrievable.

Reverse engineering the malware reveals a list of targeted file extensions:

We can also see a list of directories that are targeted:

An image file is embedded in the malware executable file. It is base64 encoded:

After decoding the image, it is displayed as the desktop wallpaper:

SonicWall Capture Labs provides protection against this threat via the following signature:

  • GAV: Cambiare_Rotta.RSM (Trojan)

This threat is also detected by SonicWall Capture ATP w/RTDMI and the Capture Client endpoint solutions.

MICROSOFT SECURITY BULLETIN COVERAGE FOR MAY 2024

Overview

Microsoft’s May 2024 Patch Tuesday has 59 vulnerabilities, 25 of which are Remote Code Execution vulnerabilities. The SonicWall Capture Labs threat research team has analyzed and addressed Microsoft’s security advisories for the month of May 2024 and has produced coverage for 9 of the reported vulnerabilities.

Vulnerabilities with Detections

CVE CVE Title Signature
CVE-2024-29996 Windows Common Log File System Driver Elevation of Privilege Vulnerability ASPY 568 Exploit-exe exe.MP_383
CVE-2024-30025 Windows Common Log File System Driver Elevation of Privilege Vulnerability ASPY 569 Exploit-exe exe.MP_384
CVE-2024-30032 Windows DWM Core Library Elevation of Privilege Vulnerability ASPY 570 Exploit-exe exe.MP_385
CVE-2024-30034 Windows Cloud Files Mini Filter Driver Information Disclosure Vulnerability ASPY 571 Exploit-exe exe.MP_386
CVE-2024-30035 Windows DWM Core Library Elevation of Privilege Vulnerability ASPY 572 Exploit-exe exe.MP_387
CVE-2024-30037 Windows Common Log File System Driver Elevation of Privilege Vulnerability ASPY 567 Exploit-exe exe.MP_382
CVE-2024-30044 Microsoft SharePoint Server Remote Code Execution Vulnerability IPS 15674 Microsoft SharePoint Server Remote Code Execution (CVE-2024-30044)
CVE-2024-30050 Windows Mark of the Web Security Feature Bypass Vulnerability IPS 15666 Windows Mark of the Web Security Feature Bypass (CVE-2024-30050)
CVE-2024-30051 Windows DWM Core Library Elevation of Privilege Vulnerability ASPY 566 Malformed-docx docx.MP_11

Release Breakdown

The vulnerabilities can be classified into the following categories:

For May, there are 57 critical, 1 Important, and 1 moderate vulnerabilities.

2024 Patch Tuesday Monthly Comparison

Microsoft tracks vulnerabilities that are being actively exploited at the time of discovery and those that have been disclosed publicly before the patch Tuesday release for each month. The above chart displays these metrics as seen each month.

Release Detailed Breakdown

Denial of Service Vulnerabilities

CVE-2024-30011 Windows Hyper-V Denial of Service Vulnerability
CVE-2024-30019 DHCP Server Service Denial of Service Vulnerability
CVE-2024-30046 ASP.NET Core Denial of Service Vulnerability

Elevation of Privilege Vulnerabilities

CVE-2024-26238 Microsoft PLUGScheduler Scheduled Task Elevation of Privilege Vulnerability
CVE-2024-29994 Microsoft Windows SCSI Class System File Elevation of Privilege Vulnerability
CVE-2024-29996 Windows Common Log File System Driver Elevation of Privilege Vulnerability
CVE-2024-30007 Microsoft Brokering File System Elevation of Privilege Vulnerability
CVE-2024-30018 Windows Kernel Elevation of Privilege Vulnerability
CVE-2024-30025 Windows Common Log File System Driver Elevation of Privilege Vulnerability
CVE-2024-30027 NTFS Elevation of Privilege Vulnerability
CVE-2024-30028 Win32k Elevation of Privilege Vulnerability
CVE-2024-30030 Win32k Elevation of Privilege Vulnerability
CVE-2024-30031 Windows CNG Key Isolation Service Elevation of Privilege Vulnerability
CVE-2024-30032 Windows DWM Core Library Elevation of Privilege Vulnerability
CVE-2024-30033 Windows Search Service Elevation of Privilege Vulnerability
CVE-2024-30035 Windows DWM Core Library Elevation of Privilege Vulnerability
CVE-2024-30037 Windows Common Log File System Driver Elevation of Privilege Vulnerability
CVE-2024-30038 Win32k Elevation of Privilege Vulnerability
CVE-2024-30049 Windows Win32 Kernel Subsystem Elevation of Privilege Vulnerability
CVE-2024-30051 Windows DWM Core Library Elevation of Privilege Vulnerability

Information Disclosure Vulnerabilities

CVE-2024-30008 Windows DWM Core Library Information Disclosure  Vulnerability
CVE-2024-30016 Windows Cryptographic Services Information Disclosure Vulnerability
CVE-2024-30034 Windows Cloud Files Mini Filter Driver Information Disclosure Vulnerability
CVE-2024-30036 Windows Deployment Services Information Disclosure Vulnerability
CVE-2024-30039 Windows Remote Access Connection Manager Information Disclosure Vulnerability
CVE-2024-30043 Microsoft SharePoint Server Information Disclosure Vulnerability
CVE-2024-30054 Microsoft Power BI Client JavaScript SDK Information Disclosure Vulnerability

Remote Code Execution Vulnerabilities

CVE-2024-29997 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-29998 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-29999 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30000 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30001 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30002 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30003 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30004 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30005 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30006 Microsoft WDAC OLE DB provider for SQL Server Remote Code Execution Vulnerability
CVE-2024-30009 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30010 Windows Hyper-V Remote Code Execution Vulnerability
CVE-2024-30012 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30014 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30015 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30017 Windows Hyper-V Remote Code Execution Vulnerability
CVE-2024-30020 Windows Cryptographic Services Remote Code Execution Vulnerability
CVE-2024-30021 Windows Mobile Broadband Driver Remote Code Execution Vulnerability
CVE-2024-30022 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30023 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30024 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30029 Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
CVE-2024-30042 Microsoft Excel Remote Code Execution Vulnerability
CVE-2024-30044 Microsoft SharePoint Server Remote Code Execution Vulnerability
CVE-2024-30045 .NET and Visual Studio Remote Code Execution Vulnerability

Security Feature Bypass Vulnerabilities

CVE-2024-30040 Windows MSHTML Platform Security Feature Bypass Vulnerability
CVE-2024-30050 Windows Mark of the Web Security Feature Bypass Vulnerability

Spoofing Vulnerabilities

CVE-2024-30041 Microsoft Bing Search Spoofing Vulnerability
CVE-2024-30047 Dynamics 365 Customer Insights Spoofing Vulnerability
CVE-2024-30048 Dynamics 365 Customer Insights Spoofing Vulnerability
CVE-2024-30053 Azure Migrate Cross-Site Scripting Vulnerability

Tampering Vulnerabilities

CVE-2024-30059 Microsoft Intune for Android Mobile Application Management Tampering Vulnerability

Remcos Is Pairing with PrivateLoader to Extend Its Capabilities

Overview

This week, the SonicWall Capture Labs threat research team investigated a sample of the RemcosRAT that uses a PrivateLoader module to provide additional data and persistence on the victim’s machine. By installing VB scripts, altering the registry and setting up services to restart the malware at variable times or by control, this malware is able to infiltrate a system completely and remain undetected.

Infection Cycle

The sample is detected as a 32-bit PE file with no packer or protector.

Figure 1: Initial detection

When looking into the sections and API calls of the file, different tools give different reports. Detect It Easy shows API calls that have been cleared (to obfuscate what they’re doing), and TLS (Thread Local Storage) functionality, meaning that malicious code can be prepared or run before the main file has started at its entry point. PEStudio, however, shows all available API calls but no TLS functionality.

Figure 2: Every call from ws2_32.dll has been obfuscated

Figure 3: A separate tool shows all hidden calls

Once functions are properly labeled, the file is shown to have the following capabilities:

  • Anti-analysis/ Anti-VM
    • GetSystemTimeAsFileTime
    • GetTickCount
    • IsDebuggerPresent
    • IsProcessorFeaturePresent
    • QueryPerformanceCounter
    • QueryPerformanceFrequency
  • System Enumeration
    • CreateToolhelp32Snapshot
    • EnumDisplaySettingsW
    • EnumServicesStatusW
    • EnumSystemLocalesW
    • EnumWindows
    • FindFirstFileA/Ex/W
    • FindNextFileA/Ex/W
    • GetClipboardData
    • GetCurrentProcessId
    • GetCurrentThreadId
    • GetEnvironmentStrings
    • GetLogicalDriveStringsA
    • GetLocalTime
    • GetLocaleInfoA/W
    • GetNativeSystemInfo
    • GetStartupInfo
    • GetTimeZoneInformation
    • GetUserDefaultLCID
    • GetWindowThreadProcessId
    • IsLocaleValid
    • OpenClipboard
    • RegEnumKeyA/W
    • RegEnumValueA/W
    • SystemParametersInfoW
  • Monitoring
    • GetCursorPos
    • GetForegroundWindow
    • GetKeyState
    • GetKeyboardLayout
    • GetKeyboardState
    • Mouse_event
    • ReadProcessMemory
    • SetWindowsHookExA
    • waveInAddBuffer
    • waveInStart
  • Process Injection
    • GetProcessId
    • GetModuleHandleA/Ex/W
    • CreateProcessA/W
    • Process32FirstW
    • ProcessNextW
    • VirtualAlloc
    • VirtualFree
    • VirtualProtect
    • WriteProcessMemory
  • Persistence
    • AdjustTokenPrivilege
    • ControlService
    • GetTempFileNameW
    • LookupPrivilegeValueA
    • OpenProcess
    • OpenProcessToken
    • RegCreateKeyA/Ex/W
    • RegDeleteKeyA/Ex/W
    • RegDeleteValueA/Ex/W
    • RegSetValueA/Ex/W
    • ShellExecuteExA/W
    • WriteFile
  • Communication
    • InternetOpenUrlW
    • InternetReadFile
    • URLDownloadToFileW
    • URLOpenBlockingStreamW
    • Inet_addr
    • Gethostbyaddr
    • Gethostbyvalue
    • getservbyvalue
    • Connect
    • Send
    • socket
    • Recv

Runtime shows that if security checks are not initially cleared by modules within ntdll.dll, the main portion of the executable will not be touched before it exits. No files are dropped, and nothing is injected into memory.

Figure 4: Beginning of the security check function

Once security has been passed, which consists of VM, locale, timezone and analysis tool enumeration, two files are dropped.

  • C:\Users\user\AppData\Local\Temp\install.vbs
  • C:\Users\user\AppData\Roaming\data\notepads.exe

Notepads.exe is a copy of the parent executable placed for persistence. The script contains the following four lines and is deleted once executed – there is no check on whether or not this action is successful. The script will simply delete itself if it is run before ‘notepads.exe’ is dropped.

Figure 5: Install.vbs contents

User security access is then checked. If applicable, Windows User Access Control is disabled with the following command to allow for privileged access:

/k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

Figure 6: UAC is disabled

At this point, the system is enumerated fully and hooks are implemented to track keystrokes, mouse actions, audio and screen grabs. Targeted software includes browsers by searching the following locations for logins and cookie data, as well as the clipboard data being pulled:

\AppData\Local\Google\Chrome\User Data\Default\Login Data

\AppData\Local\Google\Chrome\User Data\Default\Cookies

\AppData\Roaming\Mozilla\Firefox\Profiles\

\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

\AppData\Local\Microsoft\Edge\

\Opera Software\Opera Stable\

\User Data\Default\Network\Cookies

This information is stored in ‘logins.json’ and ‘key3.db’, also seen in the screenshot below.

Figure 7: Browser paths and storage files

Once complete, ‘notepads.exe’ will open a socket on the system and reach out to two URLs. The first is a GET request to geoplugin(dot)net/json.gp, which returns geographic information pertaining to the victim’s IP address. The second is to nuevosremcs.duckdns.org. Once a connection is made, a config file is created and sent to the server. Here is the configuration observed during runtime:

{

“Host:Port:Password”: “nuevosremcs.duckdns.org:9090:1”,

“Assigned name”: “Nuevos”,

“Connect interval”: “1”,

“Install flag”: “Enable”,

“Setup HKCU\Run”: “Enable”,

“Setup HKLM\Run”: “Enable”,

“Install path”: “AppData”,

“Copy file”: “notepads.exe”,

“Startup value”: “system32”,

“Hide file”: “Disable”,

“Mutex”: “Rmc-WRNU47”,

“Keylog flag”: “1”,

“Keylog path”: “Application path”,

“Keylog file”: “logs.dat”,

“Keylog crypt”: “Disable”,

“Hide keylog file”: “Disable”,

“Screenshot flag”: “Disable”,

“Screenshot time”: “10”,

“Take Screenshot option”: “Disable”,

“Take screenshot title”: “”,

“Take screenshot time”: “5”,

“Screenshot path”: “AppData”,

“Screenshot file”: “Screenshots”,

“Screenshot crypt”: “Disable”,

“Mouse option”: “Disable”,

“Delete file”: “Disable”,

“Audio record time”: “5”

}

At this point the C2 has assumed control and can remotely stop, start and engage further monitoring or file downloads for other functionality.

SonicWall Protections

To ensure SonicWall customers are prepared for any exploitation that may occur due to this malware, the following signatures have been released:

  • PrivateLoader

IOCs

Parent sample / Notepads.exe: 27bb3968cc18fb0df5b14e6d1b805552

Install.vbs: a7fe45cc57afb3dba91ab77483fffa0a

Mutex Created

  • \Sessions\1\BaseNamedObjects\Rmc-WRNU47

IP Addresses

  • 246.82.10
  • 237.33.50

URLs

  • http://geoplugin.net/json.gp
  • duckdns.org

XWiki Remote Code Execution Vulnerability

Overview

The SonicWall Capture Labs threat research team became aware of CVE-2024-31984, which is a code injection vulnerability in XWiki’s management of space titles and has a critical CVSS score of 9.9. After assessing the impact, we developed mitigation measures to address the vulnerability. This vulnerability, originating from insufficient input validation, allows remote, authenticated attackers to execute arbitrary code on the target server by creating documents with maliciously crafted titles. The team’s efforts have focused on understanding the severity of the risk and ensuring that users can securely manage and operate their XWiki platforms without compromise.

The versions of XWiki Platform impacted by the remote code execution vulnerability encompass a broad range of releases. Specifically, the vulnerability affects all versions starting from 7.2-rc-1 up to, but not including the patched versions 14.10.20, 15.5.4 and 15.10-rc-1. This wide span of versions includes any builds prior to 4.10.20, making it imperative for users operating on these versions to update their systems. The vulnerability has been effectively addressed in the newer versions 14.10.20, 15.5.4 and 15.10-rc-1. For those unable to immediately upgrade, a manual patch is available for the Main.SolrSpaceFacet page (Figure 1) to mitigate the risk temporarily until an upgrade can be implemented. This patch is crucial as it prevents the execution of arbitrary Groovy code, which could compromise the confidentiality, integrity and availability of the XWiki installation.

Figure 1: Patch

Technical Overview

XWiki’s scripting capabilities form a core component of its architecture, allowing users to craft both simple and complex web applications directly within the XWiki interface without the conventional requisites of compiling code or deploying software components. This functionality is facilitated through an advanced scripting feature set that is embedded in the content of an XWiki page, alongside traditional wiki markup. XWiki supports a variety of scripting languages such as Velocity, Groovy, and Python, which are enabled by default, thus offering versatility and power to developers. The platform utilizes the JSR-223 scripting framework to evaluate script code seamlessly. This is executed via the script macro, which follows the syntax {{script language=”<script engine name>”}}<some code>{{/script}}, allowing for direct embedding of code in pages. Specific languages can be declared directly, for example, Groovy code is written within {{groovy}}<some code>{{/groovy}} blocks, enabling immediate and accessible scripting without leaving the XWiki page environment.

Regarding its content organization, XWiki uses a hierarchical structure termed as “Wiki”, “Space”, and “Page”, or alternatively, “Page” and “Child Page”. Historically, spaces functioned similarly to folders in a file system, designed to house a collection of pages. However, in more recent updates, XWiki has eliminated the distinction between a page and a space, streamlining its structure. Despite these advancements, a significant vulnerability has been identified within this framework. The issue arises from inadequate input validation of the title fields in XWiki Spaces. Specifically, when a user attempts to create or update a page using actions like “save” or “saveandcontinue”, the user-supplied title is stored without neutralizing special characters, potentially leading to code injection risks. This vulnerability extends to the rendering process of the space’s title in the “Main.SolrSpaceFacet” on the “Main.SolrSearchConfig” page, where script elements within space titles are executed due to the lack of special character neutralization, posing a critical security risk to the integrity and security of the XWiki installation.

Triggering the Vulnerability

The four main triggers of the vulnerability in XWiki, allowing remote code execution via the Solr-based search mechanism, can be detailed as follows:

  • Crafted Document Titles: The vulnerability is triggered by creating a document with a specially crafted title. For instance, using the title structure {{/html}}{{async}}{{groovy}}println(“Hello from Groovy Title!”){{/groovy}}{{/async}} which contains embedded Groovy code allows arbitrary code execution when the document is processed or indexed by the Solr search engine.
  • User Rights and Permissions: Any user with the ability to edit titles of a space, which by default is every user, can exploit this vulnerability. This broad default permission setting significantly widens the potential for exploitation.
  • Search UI Interaction: The crafted code in the document title is executed when interacting with the XWiki search interface. Specifically, after the maliciously titled document is indexed, searching for this document and engaging with facets such as deploying the Location facet can lead to the execution of the embedded Groovy script.
  • Insufficient Input Sanitization: The underlying issue of inadequate input validation and neutralization of special characters in the XWiki Spaces’ title field is a critical trigger. This allows embedded scripts in document titles to be executed without any filtering, directly compromising the application’s security.

Exploitation

The exploitation process targets the XWiki system by leveraging the ability to execute arbitrary code remotely. This process involves an automated script that uses five specific HTTP requests to interact with the XWiki installation:

  • Login Page Request: Fetches the CSRF token necessary for session authenticity.
  • URL: loginPageURL = baseURL + ‘xwiki/bin/login/XWiki/XWikiLogin?loginLink=1’

Figure 2: Login Request

 

  • Login Submission Request: Submits login credentials and the CSRF token.
  • URL: loginURL = baseURL + ‘xwiki/bin/loginsubmit/XWiki/XWikiLogin’

Figure 3: CSRF Token Post Request

  • Document Edit Page Request: Accesses the document edit page to fetch another CSRF token and check document availability.
  • URL (Initial attempt):
    • baseDocURL = baseURL + “xwiki/bin/edit/”
    • newDocURL = baseDocURL + targetDoc
  • Document Save/Preview Request: Submits a malicious script embedded in the document’s title for preview and execution.
  • URL: saveDocURL = baseURL + “xwiki/bin/preview/” + targetDoc

Figure 4: Malicious Script, Document Upload

  • Document Search Request: Searches for the modified document to trigger attacker execution.
  • URL: searchURL = baseURL + “xwiki/bin/view/Main/Search?text=test”

The attacker configures a client with the server’s URL, username and password, and begins the exploitation by requesting the XWiki login page to obtain a CSRF token (Figure 5). This token is extracted from the HTML content and used alongside the login credentials to authenticate successfully.

Figure 5: CSRF Form Token

After authentication, the attacker searches for an editable document. If unavailable, the document name is modified iteratively until one is found. Another CSRF token is then retrieved from the document editing page. The attack vector is a script embedded in the document’s title, using XWiki’s syntax to embed Groovy code that executes shell commands. The payload — containing the CSRF token, malicious title, and shell command—is submitted to the document’s preview URL for processing (Figure 4).

Finally, the attacker initiates a search query to ensure the Solr search engine processes the modified document, confirming the execution of the embedded command. The script concludes by reporting the success of the exploit, demonstrating how the XWiki system can be compromised by using crafted document titles to execute code remotely.

SonicWall Protections

To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signatures have been released:

  • IPS: 4408 XWiki Platform SolrSpaceFacet Remote Code Execution

Remediation Recommendations

The risks posed by this vulnerability can be mitigated or eliminated by:

  • Applying the vendor-supplied patch to eliminate this vulnerability.
  • Utilizing up-to-date IPS signatures to filter network traffic.
  • Configure the vulnerable product to allow access to trusted clients only.

Relevant Links

JIRA Ticket

Security Advisory

Commit Macro Changes

Patch

NVD

CWE-95