Posts

Thanos Operator Targets Police Department in United Arab Emirates

Overview

The SonicWall Capture Labs threat research team has come across a variant of Thanos ransomware targeted at a police department in the United Arab Emirates (UAE).  Thanos ransomware is a customizable and highly adaptable ransomware-as-a-service (RaaS) tool that allows cybercriminals to create and deploy ransomware tailored to their needs. It is known for its data-stealing capabilities, the ability to spread through networks and the use of advanced evasion techniques to avoid detection.

Infection Cycle

Upon infection, the following notification appears on the desktop.

Figure 1: Notification

Files on the system are encrypted.  Each encrypted file has the text “.crypted” appended to its name

A ransom note asking for $20,000 in Bitcoin is displayed on the desktop:

Figure 2: Ransom message

A file named HOW_TO_DECYPHER_FILES.txt is dropped into all directories containing encrypted files.  It contains the following message:

Figure 3: Ransom message text file

If the system is rebooted, the following message is displayed during the login process:

Figure 4: Ransom message after reboot

The malware is written in .NET and is obfuscated.  However, after disassembly, this obfuscation is easily thwarted as it only uses base64 to encode all of its strings.  Using the following simple script, we were able to decode all base64 encoded strings and reveal the malware’s functionality:

Figure 5: Simple deobfuscation script

Figure 6: Deobfuscated code

The Thanos signature can be seen in the deobfuscated code:

Figure 7: Thanos marker

The “.crypted” file extension and a list of filetypes targeted for encryption is visible:

Figure 8: Targeted file types

The Windows Task Manager and various other backup and recovery services are disabled:

Figure 9: Disabling task manager

Figure 10: Disabling system recovery

The following base64 encoded text decodes to https://www.poweradmin.com/paexec/paexec.exe.  Power Admin is downloaded and executed on the system for remote administration:

Figure 11: Power Admin download

ProcessHide is also downloaded and is used to hide Power Admin from process monitoring applications such as Windows Task Manager:

Figure 12: ProcessHide download

The malware scans the internal network for online machines.  The username and password that was used leads us to believe that this variant of the malware is targeted toward the Sharjah Police Force in the UAE:

Figure 13: Network scanning

If those credentials do not work, there is a bigger list of usernames and passwords to try:

Figure 14: Additional credentials to try

We tried to reach out to the operator via email, but the email bounced.

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

  • GAV: Thanos.RSM_2(Trojan)

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

Microsoft Security Bulletin Coverage for November 2024

Overview

Microsoft’s November 2024 Patch Tuesday has 89 vulnerabilities, of which 51 are Remote Code Execution. SonicWall Capture Labs threat research team has analyzed and addressed Microsoft’s security advisories for the month of November2024 and has produced coverage for 6 of the reported vulnerabilities

Vulnerabilities with Detections

CVE CVE Title Signature
CVE-2024-43451 NTLM Hash Disclosure Spoofing Vulnerability ASPY 7021 Malformed-url url.MP_1
CVE-2024-43623 Windows NT OS Kernel Elevation of Privilege Vulnerability ASPY 7018 Exploit-exe exe.MP_417
CVE-2024-43629 Windows DWM Core Library Elevation of Privilege Vulnerability ASPY 7019 Exploit-exe exe.MP_418
CVE-2024-43630 Windows Kernel Elevation of Privilege Vulnerability ASPY 7020 Exploit-exe exe.MP_419
CVE-2024-49019 Active Directory Certificate Services Elevation of Privilege Vulnerability IPS 4339 Microsoft Active Directory Certificate Services EoP (CVE-2024-49019)
CVE-2024-49033 Microsoft Word Security Feature Bypass Vulnerability IPS 4338 Microsoft Word Security Feature Bypass (CVE-2024-49033)

Release Breakdown

The vulnerabilities can be classified into following categories:

For November there are 4 critical, 84 Important and 1 moderate vulnerability.

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

Defense in Depth Vulnerabilities

CVE CVE Title
CVE-2024-49049 Visual Studio Code Remote Extension Elevation of Privilege Vulnerability

Denial of Service Vulnerabilities

CVE CVE Title
CVE-2024-38264 Microsoft Virtual Hard Disk (VHDX) Denial of Service Vulnerability
CVE-2024-43499 .NET and Visual Studio Denial of Service Vulnerability
CVE-2024-43633 Windows Hyper-V Denial of Service Vulnerability
CVE-2024-43642 Windows SMB Denial of Service Vulnerability

Elevation of Privilege Vulnerabilities 

CVE CVE Title
CVE-2024-43449 Windows USB Video Class System Driver Elevation of Privilege Vulnerability
CVE-2024-43452 Windows Registry Elevation of Privilege Vulnerability
CVE-2024-43530 Windows Update Stack Elevation of Privilege Vulnerability
CVE-2024-43613 Azure Database for PostgreSQL Flexible Server Extension Elevation of Privilege Vulnerability
CVE-2024-43623 Windows NT OS Kernel Elevation of Privilege Vulnerability
CVE-2024-43624 Windows Hyper-V Shared Virtual Disk Elevation of Privilege Vulnerability
CVE-2024-43625 Microsoft Windows VMSwitch Elevation of Privilege Vulnerability
CVE-2024-43626 Windows Telephony Service Elevation of Privilege Vulnerability
CVE-2024-43629 Windows DWM Core Library Elevation of Privilege Vulnerability
CVE-2024-43630 Windows Kernel Elevation of Privilege Vulnerability
CVE-2024-43631 Windows Secure Kernel Mode Elevation of Privilege Vulnerability
CVE-2024-43634 Windows USB Video Class System Driver Elevation of Privilege Vulnerability
CVE-2024-43636 Win32k Elevation of Privilege Vulnerability
CVE-2024-43637 Windows USB Video Class System Driver Elevation of Privilege Vulnerability
CVE-2024-43638 Windows USB Video Class System Driver Elevation of Privilege Vulnerability
CVE-2024-43640 Windows Kernel-Mode Driver Elevation of Privilege Vulnerability
CVE-2024-43641 Windows Registry Elevation of Privilege Vulnerability
CVE-2024-43643 Windows USB Video Class System Driver Elevation of Privilege Vulnerability
CVE-2024-43644 Windows Client-Side Caching Elevation of Privilege Vulnerability
CVE-2024-43646 Windows Secure Kernel Mode Elevation of Privilege Vulnerability
CVE-2024-49019 Active Directory Certificate Services Elevation of Privilege Vulnerability
CVE-2024-49039 Windows Task Scheduler Elevation of Privilege Vulnerability
CVE-2024-49042 Azure Database for PostgreSQL Flexible Server Extension Elevation of Privilege Vulnerability
CVE-2024-49044 Visual Studio Elevation of Privilege Vulnerability
CVE-2024-49046 Windows Win32 Kernel Subsystem Elevation of Privilege Vulnerability
CVE-2024-49051 Microsoft PC Manager Elevation of Privilege Vulnerability
CVE-2024-49056 Airlift.microsoft.com Elevation of Privilege Vulnerability

Information Disclosure Vulnerabilities 

CVE CVE Title
CVE-2024-38203 Windows Package Library Manager Information Disclosure Vulnerability

Remote Code Execution Vulnerabilities 

CVE CVE Title
CVE-2024-38255 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-43447 Windows SMBv3 Server Remote Code Execution Vulnerability
CVE-2024-43459 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-43462 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-43498 .NET and Visual Studio Remote Code Execution Vulnerability
CVE-2024-43598 LightGBM Remote Code Execution Vulnerability
CVE-2024-43602 Azure CycleCloud Remote Code Execution Vulnerability
CVE-2024-43620 Windows Telephony Service Remote Code Execution Vulnerability
CVE-2024-43621 Windows Telephony Service Remote Code Execution Vulnerability
CVE-2024-43622 Windows Telephony Service Remote Code Execution Vulnerability
CVE-2024-43627 Windows Telephony Service Remote Code Execution Vulnerability
CVE-2024-43628 Windows Telephony Service Remote Code Execution Vulnerability
CVE-2024-43635 Windows Telephony Service Remote Code Execution Vulnerability
CVE-2024-43639 Windows Kerberos Remote Code Execution Vulnerability
CVE-2024-48993 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-48994 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-48995 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-48996 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-48997 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-48998 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-48999 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49000 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49001 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49002 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49003 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49004 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49005 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49006 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49007 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49008 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49009 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49010 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49011 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49012 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49013 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49014 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49015 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49016 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49017 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49018 SQL Server Native Client Remote Code Execution Vulnerability
CVE-2024-49021 Microsoft SQL Server Remote Code Execution Vulnerability
CVE-2024-49026 Microsoft Excel Remote Code Execution Vulnerability
CVE-2024-49027 Microsoft Excel Remote Code Execution Vulnerability
CVE-2024-49028 Microsoft Excel Remote Code Execution Vulnerability
CVE-2024-49029 Microsoft Excel Remote Code Execution Vulnerability
CVE-2024-49030 Microsoft Excel Remote Code Execution Vulnerability
CVE-2024-49031 Microsoft Office Graphics Remote Code Execution Vulnerability
CVE-2024-49032 Microsoft Office Graphics Remote Code Execution Vulnerability
CVE-2024-49043 Microsoft.SqlServer.XEvent.Configuration.dll Remote Code Execution Vulnerability
CVE-2024-49048 TorchGeo Remote Code Execution Vulnerability
CVE-2024-49050 Visual Studio Code Python Extension Remote Code Execution Vulnerability

Security Feature Bypass Vulnerabilities 

CVE CVE Title
CVE-2024-43645 Windows Defender Application Control (WDAC) Security Feature Bypass Vulnerability
CVE-2024-49033 Microsoft Word Security Feature Bypass Vulnerability

Spoofing Vulnerabilities 

CVE CVE Title
CVE-2024-43450 Windows DNS Spoofing Vulnerability
CVE-2024-43451 NTLM Hash Disclosure Spoofing Vulnerability
CVE-2024-49040 Microsoft Exchange Server Spoofing Vulnerability

Critical CyberPanel Vulnerability (CVE-2024-51378): How to Stay Protected

Overview

The SonicWall Capture Labs threat research team became aware of CVE-2024-51378, assessed its impact and developed mitigation measures for the vulnerability. CVE-2024-51378 is a critical vulnerability with a CVSS score of 9.8 in CyberPanel versions 2.3.6 and 2.3.7 that allows unauthenticated remote code execution (RCE). Threat actors, including the PSAUX ransomware group, have been reported exploiting this vulnerability to encrypt server files and deploy ransomware payloads. A public proof of concept is available.  The exploitation of CVE-2024-51378 has led to the compromise of numerous CyberPanel instances worldwide with a significant concentration in the United States. Successful attacks result in full server control, unauthorized access to sensitive domains and potential data breaches. Users of affected CyberPanel versions are strongly advised to update to the latest version to mitigate these risks.

Technical Overview

Attackers can exploit this flaw to gain root-level access by sending crafted OPTIONS HTTP requests to /dns/getresetstatus and /ftp/getresetstatus endpoints located in dns/views.py and ftp/views.py.  This is possible due to a lack of proper input validation. As a result, an attacker can break out of the intended code path by using a “;” and execute a command of their choosing without authenticating to the server.

Triggering the Vulnerability

  1. Make an initial GET request to the root (/) endpoint.
  2. Retrieve the CSRF token from the response of the get request.
  3. Construct an HTTP OPTIONS request with the headers X-CSRFToken, Content-Type, and Referer fields.
  4. Create a malicious payload that injects a command into the “status file” parameter using a semicolon within the parameter’s value followed by a Linux command. The semicolon allows arbitrary shell commands to be executed on the server.
  5. Send the payload via an OPTIONS request to either “/dns/getresetstatus” or “/ftp/getresetstatus” endpoint. The result of the command may be returned in the “requestStatus” field of the JSON response

Exploitation

Using the publicly available PoC, it is possible to see an example of the malicious request (Figure 1).

Figure 1: Malicious request

Exploitation occurs in the “status file” parameter sent within the JSON section of the request. In this instance, the “pwd” command will be executed, and the result will be returned to the attacker.  A more likely attack would be a command to allow the attacker to download malware such as the use of a “wget” command, followed by a second request to execute the downloaded malware.

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:18890 CyberPanel getresetstatus Remote Command Execution

Remediation Recommendations

It is highly recommended to update to a patched version of CyberPanel where input validation and endpoint authentication have been increased.  If unable to update immediately, it is suggested to monitor for unusual commands in the system logs for HTTP requests to /api/getresetstatus/ or/dns/getresetstatus.

Relevant Links

 

GoZone Ransomware Adopts Coercive Tactics to Extract Payment

This week, the SonicWall Capture Labs threat research team analyzed a ransomware that not only encrypts files but also accuses the victim of harboring explicit content on their computer and then threatens to turn it over to authorities if ransom is not paid. Extortion attacks often come as unsolicited emails, and GoZone has stooped to pretending to find explicit content on victims’ machines to extract payment.

Infection Cycle

This ransomware is written in Go. It is apparent that it uses Chacha20 and RSA encryption packages as evidenced by its strings.

Figure 1: References to Chacha20 package in the binary’s strings

Figure 2: References to RSA package in the binary’s strings

Upon execution, it encrypts files in the victim’s machine and appends “d3prU” to all encrypted files.

Figure 3: Encrypted files with d3prU file extension

A readme text file is created in every directory where files have been encrypted. This is one of the ransom notes that this malware creates.

Figure 4: Readme ransom note

It also creates another ransom note in the form of an html file which is then subsequently opened with the user’s default browser.

Figure 5: Ransom note in html formal

To ensure that the victim does not miss the ransom payment instructions, the desktop wallpaper is also changed to show instructions on how to pay.

Figure 6: Desktop wallpaper showing payment instructions

The QR code at the bottom of the desktop wallpaper only copies the Bitcoin address “bc1qwemkeh2vu5ftzgat3sk87gr4mlskw898xd6tk5” to a browser. Checking this Bitcoin address on the blockchain reveals only a couple of transactions.

Figure 7: Recent transactions on this ransomware’s Bitcoin address

The victim will be unable to change this wallpaper as the ability to update the background settings has now been disabled by the ransomware.

Figure 8: Background settings grayed out and unable to change

Upon further analysis, we found references to ransomware modules that show the different functionalities that this malware can employ:

  • Add a scheduled task
  • Disable UAC
  • UAC Bypass
  • Set wallpaper
  • Self delete
  • Overwrite MBR
  • Remove system restore

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

  • GAV: GoZone.RSM(Trojan)

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

 

 

Stealc Malware Checks Everything — Even the Screen Resolution

Summary

This week, the SonicWall Capture Labs threat research team reviewed a sample of Stealc malware. This is an infostealer that digs through a victim’s system to extract credentials from browsers, cryptocurrency wallets and fileshare servers. Processes are monitored, as well as keystrokes, active windows and mouse clicks. It will also disable security applications and change network settings to allow for proxy connections. Every part of the system hardware and Windows settings are enumerated, down to the resolution of the monitor.

Technical Overview

The file is detected as a standard executable without a packer or protector. However, the ‘.text’ section is, in fact, packed.

 

Figure 1: Initial file detection

Figure 2: Main section of the executable (.text) is packed

Much of the program is obfuscated before runtime, as shown below. Once loaded into a debugger, these strings will be decoded. While the ‘resources’ section of the file is identified as being in Turkish, these strings are simply encoded. Beyond obfuscation, Stealc has a number of evasive capabilities, including: extended sleep, processor feature check, debugger check, locale and system time checks. It also uses VirtualProtect to create guard pages during runtime.

Figure 3: Obfuscated section of code

System queries begin with Stealc performing a check on the locale using WMI, svchost and multiple API calls within the program itself. This is followed by a complete enumeration of system hardware, software, user accounts, network connections and configurations, and registry keys.

The following items are specifically targeted:

  • Browsers: Internet Explorer, Firefox, Chrome, Opera, Brave
  • Wallets: Monero
  • SaaS: Azure, AWS
  • Programs: Word, Outlook, FileZilla, OneDrive, Steam, Telegram, Pidgin, Discord
  • Archive types: zip, zoo, arc, lzh, arj, gz, tgz, tox

During execution, test keys will be written to the registry. If successful, the test keys will be deleted and “valid” keys are written. Stealc will enumerate the entire system via standard methods (QueryInformationVolume, QueryNameInformationFile, GetSystemInfo) as well as searching the registry for entries in the ‘\Microsoft\Windows\CurrentVersion\Uninstall\’ node.

Figures 4, 5: IP address, generated URL and malware agent name

While the malware has a hardcoded IP address within the file, it also has the capability of generating URLs. During testing, the generated URL address was ‘http://62.204.41.177/edd20096ecef326d.php’.

Figure 6: SQL command for URL selection

PowerShell commands were found to invoke a network connection, though this was not observed during testing.

Figure 7: PowerShell command string for downloading

The IP address contacted by the malware is still up as of the time of this alert, responding to a POST request that includes the following data:

boundary=—-BKJEGDGIJECGCBGCHDG,

name=”hwid”<systemID>,

name=”build”default9_cap

The response was ‘YmxvY2s=’, or simply, “block”.

SonicWall Protections

To ensure SonicWall customers are protected against this threat, the following signature has been released:

  • MalAgent.StealC

IOCs

  • 251e991954be6fe306415a868e7b5fce
  • http://62.204.41.177

CVE-2024-9379: Ivanti Cloud Service Appliance Authenticated SQL Injection  

Overview 

The SonicWall Capture Labs threat research team became aware of an authenticated SQL injection vulnerability affecting Ivanti Cloud Service Appliances (CSA). Identified as CVE-2024-9379 and with a moderate score of 6.5 CVSSv3, the vulnerability is more severe than it initially appears due to reported exploitation attempts. Recently, in its October security update, Ivanti announced, “We are aware of a limited number of customers running CSA 4.6 patch 518 and prior who have been exploited when CVE-2024-9379, CVE-2024-9380, or CVE-2024-9381 are chained with CVE-2024-8963,”. Labeled as a SQL Injection vulnerability and categorized as CWE-89, this vulnerability allows authenticated attackers to run arbitrary SQL statements and compromise Server Database. 

No PoC is available yet publicly, but according to CISA, out of three Ivanti CSA vulnerabilities that are exploited in the wild, CVE-2024-9379 is one of them. With Admin privileges, an attacker can compromise the Ivanti Server database by injecting crafted SQL queries into vulnerable versions of Ivanti CSA. Users are strongly encouraged to update CSA version to 5.0.2 

Technical Overview  

The Ivanti Cloud Services Appliance (CSA) provides secure communication and functionality over the Internet. It acts as a meeting platform where the console and managed devices are connected to the Internet—even if they are behind firewalls or use a proxy to access the Internet.  

CVE-2024-9379 is a critical SQL injection vulnerability found in Ivanti’s Cloud Services Appliance (CSA). This flaw enables an authenticated attacker to execute arbitrary SQL commands by injecting malicious inputs into specific fields of the administrative web interface. SQL injection occurs when an application inadequately sanitizes user inputs, allowing the attacker to manipulate the queries sent to the database. In this case, the attacker must possess administrative credentials to access the vulnerable fields.  This issue can be exploited remotely and could lead to unauthorized access to sensitive data.

Triggering the Vulnerability 

Given these prerequisites, the exploitation pathway for this vulnerability is more targeted and requires an attacker with access credentials and specific knowledge of the application structure. Here’s how these conditions impact the risk and vulnerability triggering strategies: 

  • Administrative Credentials: Since the attack requires administrative-level access, it limits the pool of potential attackers to those who can compromise credentials. According to CISA, CVE-2024-8963 may be facilitating credential compromise. 
  • Identification of Vulnerable Input Fields: The attacker must know the specific vulnerable input field, which typically requires access to the application’s source code, configurations, or significant reconnaissance efforts. 
  • POST Request with Malicious SQL: This step requires attackers to craft a valid POST request that includes necessary access tokens, making exploitation more complex and potentially easier to detect. 

Exploitation 

Successful exploitation could allow attackers to manipulate or delete critical data and escalate privileges. When combined with other vulnerabilities, the attack could lead to: 

  • Full Compromise of Database Integrity: Attackers could modify, delete, or exfiltrate database records, affecting data integrity and confidentiality. 
  • Privilege Escalation: By leveraging this vulnerability, attackers could gain higher-level permissions, granting broader access across the system. 
  • Remote Code Execution (RCE): Combined with other vulnerabilities, this vulnerability allows the attacker to execute arbitrary commands, compromising the host system and potentially leading to further infiltration. 
  • Service Disruption: Exploiting specific SQL commands could lead to system crashes or instability, interrupting services and affecting availability. 

Suppose the username field in the CSA admin panel is used to retrieve data from the database. An attacker could enter a malicious payload as shown in Figure 1, causing the database to pause execution for 10 seconds. Here an attacker is injecting into the username filled which is used in the “WHERE” clause of a “SELECT” statement.  Repeated requests using this kind of payload can lead to performance impacts, resulting in service disruption. 

Figure 1: Denial of Service using SQL query

Another possibility is an attack could use the “;” to terminate the intended query and insert a new SQL query which would modify the database.  As an example, in Figure 2 the injected “UPDATE” command may grant the attacker’s user account the admin role, giving unauthorized access to privileged features within Ivanti CSA. 

Figure 2: Privilege Escalation using SQL query

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:20455 – Ivanti Cloud Service Appliance SQL Injection  

Remediation Recommendations 

According to the advisory, 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 CSA instances to version 5.0.2 to address the vulnerability.  

Relevant Links 

New Iranian-based Ransomware Group Charges $2000 for File Retrieval

The SonicWall Capture Labs threat research team has encountered a recently released ransomware from an Iranian team of hackers. The group has named themselves hackersadism. The group does not appear to be targeting large corporations at this time as they only charge $2000 in BNB (Binance coin crypto) for file restoration.  The price for file retrieval is also negotiable.  During our analysis, we were able to converse directly with the malware operator and negotiate payment.

Infection Cycle

Upon executing the malware, files on the system are encrypted.  Each file is given a new file extension consisting of 4 alphanumeric characters.  When the encryption phase is complete, the following image is displayed on the desktop background:

Figure 1: Desktop image

A file named read_it.txt is dropped on to the desktop and contains the following message in Farsi:

Figure 2: Ransom message

A rough translation from Farsi to English is as follows:

Figure 3: Translation

The malware is easy to decompile and contains no obfuscation.  After decompiling the code, we can see its inner workings and intentions.

Before encryption, a region check is performed. If az-Latn-AZ (Latin, Azerbaijan), tr-TR (Turkish) locales are detected on the system, the program exits:

Figure 4: Region check

If the following system files and directories are encountered during the encryption process, they are ignored:

Figure 5: Ignored system files

The following file types are targeted for encryption:

Figure 6: Targeted file types

Anti-virus, system administration, databases and backup tools are disabled if found to be running:

Figure 7: Targeted services to shut down

System recovery features that are built into Windows are disabled:

Figure 8: Disabling system recovery

The ransom message tells the victim to communicate with the operator @hackerSadism using Telegram. The Operator uses the following user image:

Figure 9: Telegram user image

We had the following conversation with the operator to negotiate payment for file retrieval:

Figure 10: Chat with operator

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

  • GAV: Sadism.RSM(Trojan)

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

Command Injection and Local File Inclusion in Grafana: CVE-2024-9264

Overview

The SonicWall Capture Labs threat research team became aware of a critical vulnerability in Grafana, assessed its impact and developed mitigation measures. Grafana is a multi-platform open-source analytics and visualization solution that can produce charts, graphs and alerts according to the data.

Identified as CVE-2024-9264, Grafana versions 11.0.x, 11.1.x and 11.2.x allows an attacker with ‘viewer’ or higher permission to achieve command injection and local file inclusion (LFI) using the experimental SQL expressions feature, earning a critical CVSS score of 9.9. Considering a publicly available proof of concept (PoC) code exists for this vulnerability and the popularity of Grafana, exploitation is more likely in the upcoming days.  Hence, users are strongly encouraged to upgrade their instances to the latest applicable fixed version, as mentioned by the vendor in the advisory.

Technical Overview

This flaw was introduced in Grafana 11 through the implementation of an experimental feature called ‘SQL Expressions’, which allows the data source query output to be post-processed by SQL queries. It is accomplished by passing the query and data to the DuckDB CLI in the back end, which then executes the query against the formatted results, called DataFrames. The issue arises due to the SQL queries not being sanitized before execution, which can lead to LFI and command injection.

The affected feature, SQL Expressions, was enabled for the API by default, which is supposed to be disabled otherwise due to its experimental nature. This enables attackers to access the feature by default through the API. The DuckDB binary must be installed (which is not bundled with Grafana) and must be accessible through the Grafana’s PATH environment variable to exploit the vulnerability. This significantly reduces the probability of successful exploitation in default installations.

The patch indicates that the SQL Expressions feature is disabled by default and the references to the DuckDB are removed to address the vulnerability, as seen in Figure 1.

Figure 1: Patch to address vulnerability

Triggering the Vulnerability

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

  1. The system must have installed a DuckDB binary manually and its location must be added to the $PATH variable.
  2. The attacker must have network access to the target vulnerable system with ‘viewer’ permission or higher.
  3. The attacker must create a dashboard with Reduce or Math expression, as seen in Figure 2, and modify the expression type to ‘sql’ and inject the malformed SQL expression after intercepting the request.

Figure 2: Dashboard with Math expression

Exploitation

Exploiting this vulnerability allows the remote threat actor to execute arbitrary code or read sensitive files on the server. It has a high impact on the confidentiality, integrity and availability of the system and does not require user interaction.

We leveraged publicly available analysis to achieve an LFI on Grafana v11.2.1. As mentioned in step 2 of the above section, the malformed SQL Expression has been injected using the read_csv_auto() function, as seen in Figure 3. It will respond with the contents of the Linux password file.

Figure 3: Exploit request for LFI

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: 4522 Grafana SQL Expressions Local File Inclusion

Remediation Recommendations

The users of Grafana are strongly encouraged to upgrade their instances to the latest version, as mentioned in the vendor advisory.

Relevant Links

 

VMWare vCenter Server CVE-2024-38812 DCERPC Vulnerability

Overview

CVE-2024-38812 is a critical heap-overflow vulnerability identified in VMware vCenter Server’s implementation of the DCERPC (Distributed Computing Environment/Remote Procedure Call) protocol. This flaw allows a malicious actor with network access to the vCenter Server to send specially crafted packets, potentially leading to remote code execution (RCE). The vulnerability, classified under CWE-122 (Heap-based Buffer Overflow), arises when memory allocated in the heap is improperly overwritten, leading to unpredictable behavior that could be exploited. Published in September 2024, CVE-2024-38812 carries a CVSS score of 9.8, highlighting its severity and high risk of exploitation. VMware vCenter Server version 8.0U3a is vulnerable, while version 8.0U3b contains the necessary patches to mitigate this issue. This vulnerability affects not only vCenter Server but also VMware Cloud Foundation, as detailed in VMware’s security advisory VMSA-2024-0019.

To fully grasp the exploitation potential of CVE-2024-38812, it is crucial to understand key concepts that govern the DCERPC protocol and how it handles memory and communication within vCenter Server. Critical components of the protocol play a vital role in mapping operations and data types, facilitating client-server communication. These technical elements help explain how a heap overflow can be triggered. In the following sections, we will dive into the vulnerability details, illustrating how these components interact to enable potential remote code execution, while also highlighting the patches and updates available in VMware vCenter Server 8.0U3b.

Reaching The Vulnerable Function

Figure 1 – Operation #, Unmarshalling Param Count, and Type Index #

In the libdcerpc.so library, the rpc_ss_ndr_unmar_interp function plays a key role in the marshalling (serialization) and unmarshalling (deserialization) processes of the RPC framework, the parameters such as parameter count and type index are crucial in controlling the program flow during the marshalling (serialization) and unmarshalling (deserialization) processes of the RPC system. The parameter count (e.g., 1LL, 2LL, 10LL) specifies how many parameters or arguments the function expects for a specific remote operation. The type index (e.g., 0x1E8LL, 0xB8LL, 0x2F0LL) provides the starting position in the IDL_type_vec table, which holds information about the types of parameters for that particular operation. These elements work together to ensure that the appropriate data types are processed in the correct order. As rpc_ss_ndr_unmar_interp() proceeds, it uses the parameter count to loop through the parameters and the type index to retrieve information about each parameter’s type from the type vector table.

To exploit a vulnerability in the DCERPC operations (Figure 1), such as a heap-overflow vulnerability, an attacker must carefully select a function (Figure 2) with the appropriate parameter count and type index to trigger the vulnerable code. The specific function chosen controls which parameters are processed and how memory is allocated and accessed. For instance, if an operation with a higher parameter count and a particular type index leads to a vulnerable memory allocation, the attacker can craft an input that exploits that allocation process. To reach the vulnerable function, the attacker would need to understand which specific operation (identified by opX_ssr) calls rpc_ss_ndr_unmar_interp() with the right combination of parameter count and type index to navigate to the memory management code that contains the flaw. Only by selecting the correct function with the corresponding type index can the attacker reach the point in the code where the vulnerability can be exploited.

Figure 2- Operation # and Function Signatures

Root Cause Analysis

Figure 3 – rpc_ss_ndr_contiguous_elt()

The function rpc_ss_ndr_contiguous_elt() (Figure 3) is vulnerable due to its handling of the range_list->lower value, which is controlled by user input. Specifically, the vulnerability (Figure 4) resides in the following line:

Figure 4 – User Controlled, range_product and range_list->lower

This line modifies the base address of p_array_addr by adding an offset derived from several parameters: the range_list->lower value, element_size, and the multiplier range_product. Since the range_list->lower value is sourced from input provided to the function, an attacker can manipulate this value to control the offset, directly impacting the pointer arithmetic that recalculates the base address of p_array_addr. If the offset is large enough, it can push the array’s address into memory regions that the attacker can control. Once an attacker controls the range_list->lower value, they effectively control the memory address to which p_array_addr points. By carefully manipulating range_list->lower and influencing how much the base pointer is incremented, the attacker can shift the pointer into arbitrary memory locations. This control allows the attacker to potentially read or write to critical areas of memory, leading to severe consequences such as modifying control structures or executing arbitrary code.

The use of element_size and range_product as multipliers further amplifies the risk. Larger values for these parameters increase the effect of the manipulated range_list->lower, making it easier for an attacker to shift the pointer into dangerous memory regions.

In the function rpc_ss_ndr_contiguous_elt()shown in Figure 3, the pointers can be manipulated to reach beyond a 4GB memory boundary due to the calculation involving range_product, range_list->lower, and element_size. In this case, range_product is derived from potentially large values in range_list and range_difference. When these large values are multiplied together, the result is an offset added to p_array_addr. These calculations have been broken out in Figure 5 for reference.

Figure 5 – Output Operations on p_array_addr

If the resulting offset is large enough, it can push the address from the base into much higher memory regions, potentially reaching into the 500 GB range or higher. Since range_list->lower is attacker-controlled, this enables crafted inputs to manipulate the offset and effectively cause pointer arithmetic to exceed normal bounds (Figure 6), accessing unintended memory locations well beyond the 4GB range, leading to a potential heap overflow or arbitrary memory access.

Figure 6 – Calculations for Z_values Array

Triggering the Vulnerability

Figure 7 – Stub Data

With the root cause of the vulnerability understood, python can be used to create a proof-of-concept packet in order to trigger a crash. “stub_data,” as shown in Figure 7, represents the key portion of the network packet that is needed in order to trigger the vulnerability.  After four bytes of padding, the Z_values represent the conformance information for an array. Specifically, Z_values indicate the expected size or bounds of each dimension of the array being processed. These values allow the marshalling/unmarshalling functions to correctly allocate memory and process array elements dynamically. Figure 8 below shows “stub_data” expanded, as it would be seen in a malicious network packet sent over the network.

Figure 8 – Full Protocol Packet Sent to a vulnerable Server

The Z_values are fed into the function rpc_ss_ndr_contiguous_elt to help determine:

  • The total number of elements in the array.
  • Whether the array is contiguous in memory.
  • How to calculate the address of each element in memory.

When the code checks the range difference and compares it to the Z_values, it verifies whether the array conforms to the expected size for each dimension. If the difference matches the Z_values, the array is considered contiguous, meaning that the elements are stored sequentially in memory. This helps the unmarshalling process allocate the right amount of memory and correctly interpret the array’s structure.

Each byte in the Z_values array, as shown in (Figure 7), serves a distinct role in establishing conditions that could lead to exploitation of the vulnerability.

Z_values[0] = 0x63:

  • Z_values[0] represents the first dimension of the array. The range_product is 52067 (in decimal), which equals 0xCB63 in hex.
  • Since Z_values are only 1 byte each, we take the least significant byte (LSB) of 0xCB63, which is 0x63. This byte represents the conformance for the first dimension, fitting it into the byte-size constraint.

Z_values[1] = 0x66:

  • Z_values[1] corresponds to the second dimension. The second dimension has a range_difference of 52070 (in decimal), which is 0xCB66 in hex.
  • Again, since Z_values are 1 byte, we use the LSB of 0xCB66, which is 0x66, to represent the conformance information for the second dimension.

Z_values[2] = 0x03:

  • Z_values[2] represents the third dimension. Based on our research, it is assumed to be a smaller dimension, like the range_list->lower value, which is 3. This could represent a dimension with only a few elements.
  • Thus, Z_values[2] is set to 0x03, indicating the small size for the third dimension.

Z_values[3] = 0x02:

  • Z_values[3] is for the fourth dimension and is set to 0x02, which implies that the fourth dimension contains only a single element. This is a typical case for higher-dimensional arrays when certain dimensions may have fewer elements.

Leveraging the vulnerability

Figure 9 – unmar_by_copying function signature

In the function rpc_ss_ndr_unmar_by_copying(Figure 9), memory copying is performed using the memcpy function (Figure 10), where p_array_addr acts as the destination pointer and data_addr as the source. This memcpy can be leveraged to exploit the vulnerability.  The length of the data to be copied is controlled by IDL_left_in_buff, which is calculated based on the buffer’s remaining size and the value of copy_length, a variable influenced by attacker-controlled input. Since both p_array_addr and the length (IDL_left_in_buff) depend on external input, an attacker can control the memory destination and the amount of memory being copied.

Figure 10 – memcpy inside unmar_by_copying

By sending the packet outlined in (Figure 8) a segmentation fault will occur at this memcpy.  The video in (Figure 11) uses gdb to demonstrate the crash and the potential impact of this heap overflow.

Figure 11 – Proof of Concept

Patch Impact Analysis

Figure 12 – Vulnerable section of code patched

The patch (Figure 12) introduces a significant fix focusing on how the calculation involving the range list is handled, particularly in the verification of range_list->lower. The original code had less control over ensuring that the range_list->lower and range_difference values were within expected boundaries, allowing an attacker to manipulate them. The updated version 8.0U3b makes sure that checks are properly applied to the range_list->lower, and it eliminates vulnerabilities related to unbounded pointer arithmetic by using stronger conditions, this involves making sure that the difference between the two values (range_difference) matches the specific value found at a particular position in the Z_values array, which is determined by dividing the range_index by 4 and then moving one spot further in the array and controlling how the range_product is calculated across iterations. These changes reduce the risk of unintentional memory manipulation, effectively preventing the overflow condition that could lead to remote code execution by preventing memory from being moved to unintended regions.

Summary

The exploitation hinges on the ability to manipulate memory pointers using elements like range_list->lower, which can cause pointer arithmetic to push memory addresses into unintended regions, leading to arbitrary memory writes. Moreover, in functions such as rpc_ss_ndr_unmar_by_copying(), attacker-controlled variables like copy_length allow the attacker to control both the destination and the amount of data being copied, heightening the risk of memory corruption. VMware’s patch introduces additional checks on memory-boundary calculations, preventing unbounded pointer arithmetic and reducing the potential for remote exploitation.

Code Injection in Spring Cloud: CVE-2024-37084

Overview

The SonicWall Capture Labs threat research team became aware of the threat CVE-2024-37084, assessed its impact, and developed mitigation measures for this vulnerability.

CVE-2024-37084 is a critical vulnerability affecting Spring Cloud Data Flow versions 2.11.0 through 2.11.3. A malicious user with access to the Skipper server API can exploit a flaw in the upload request process, allowing them to write arbitrary files to any location on the server’s file system, potentially compromising the server. This vulnerability is assigned a CVSS score of 9.8 by VMware, indicating its critical nature. The flaw is associated with CWE-94, indicating improper control of code generation, which increases the risk of exploitation. Users of affected versions are strongly advised to upgrade to version 2.11.4 to mitigate this vulnerability. For more details, refer to the official advisory at Spring.io.

Technical Overview

Figure 1: Upload Method

The vulnerability is triggered when the Skipper server processes HTTP POST requests to its REST API on port 7577. The upload() method (Figure 1) handles package uploads by accepting a JSON object containing the packageFileAsBytes key, which holds a Base64-encoded ZIP file. Once uploaded, the ZIP file is unpacked, and the server deserializes a package.yaml file, which contains metadata about the package. The issue arises because the contents of the YAML file are processed without adequate validation. This allows attackers to embed harmful Java class constructors directly within the YAML structure, enabling arbitrary code execution by deserializing classes like javax.script.ScriptEngineManager which are commonly used for remote code execution.

A critical security flaw in Spring Cloud Skipper arises from the improper deserialization of YAML files using the standard YAML constructor. The root cause lies in the constructor’s failure to restrict the types of objects being created during the deserialization process, allowing attackers to provide malicious YAML data that could lead to remote code execution (RCE). This flaw is particularly dangerous because it enables attackers to craft specific YAML content that forces the application to instantiate arbitrary Java classes, bypassing security controls and executing harmful code.

The package.yaml file plays a central role in the exploitation, as it is deserialized using the SnakeYAML library’s yaml.load() method (Figure 2). The library allows special syntax like !!<java class constructor>, which permits the deserialization of any Java class constructor present in the YAML file. Without restrictions on what can be deserialized, attackers can execute untrusted code.

Figure 2: yaml.load

Triggering the Vulnerability

To trigger the CVE-2024-37084 vulnerability, an attacker crafts a malicious YAML file containing specific Java class constructors that enable the deserialization of arbitrary objects. This file is then embedded within a ZIP file and sent to the Spring Cloud Skipper server via an HTTP POST request targeting the REST API. The ZIP file must contain a package.yaml file, which is unpacked and processed by the vulnerable yaml.load() method (Figure 2). Once deserialized, the malicious code is executed, granting the attacker remote control over the system and enabling arbitrary code execution.

  1. Craft a Malicious YAML File: Create a YAML file with specific Java class constructors like !!javax.script.ScriptEngineManager to exploit deserialization.
  2. Send a Malicious HTTP POST Request: Upload the crafted YAML through an HTTP POST request to the Skipper server’s REST API.
  3. ZIP File Structure: Ensure the ZIP file contains a package.yaml file with the malicious content for deserialization.
  4. Execute Arbitrary Code: Upon processing the package.yaml, arbitrary code execution is triggered, allowing control over the system.

Exploitation

Exploitation of CVE-2024-37084 involves not only triggering the vulnerability but carefully executing a series of steps to manipulate the behavior of the Spring Cloud Skipper server. Once the attacker crafts a malicious YAML payload, they embed it within a package.yaml file and package it in a ZIP file. To evade detection by IPS/IDS systems and web application firewalls, the payload is often Base64-encoded or converted into a byte array before being sent. The attacker targets the vulnerable /api/package/upload endpoint using an HTTP POST request (Figure 3) with a carefully formatted UploadRequest JSON object to ensure the server processes the payload without raising validation errors.

Figure 3: Post Request

Once the server receives and unpacks the ZIP file, it deserializes the YAML using the insecure yaml.load() method. If the YAML contains malicious code, such as references to external resources or a remote JAR file, the server will execute this code, leading to remote code execution (RCE). For instance, the attacker may use classes like javax.script.ScriptEngineManager to execute arbitrary code or java.net.URLClassLoader to load external libraries from a controlled server. Instructions for creating a malicious JAR file, which can be used to execute arbitrary code on the target server, are available here. The attacker can compile their Java code and host the JAR file on a web server, allowing the Spring Cloud Skipper server to retrieve and execute it upon deserialization. Monitoring server behavior, such as HTTP GET requests to the malicious resource, confirms the presence and exploitation of the vulnerability.

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: 20414 Spring Cloud Data Flow Insecure Deserialization 1
  • IPS: 20415 Spring Cloud Data Flow Insecure Deserialization 2
  • IPS: 20416 Spring Cloud Data Flow Insecure Deserialization 3

Remediation Recommendations

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

  • Restricting API Access: Limit API access to only trusted users or systems.
  • Utilizing Up-to-Date IPS Signatures: Keep IPS signatures updated to block known threats.
  • Limiting Access to Critical Systems: Only allow trusted users access to key systems.
  • Regularly Updating and Patching Systems: Ensure all systems are regularly updated and patched.

Relevant Links

Spring Security Advisory

National Vulnerability Database (NVD)

Common Vulnerability Scoring System Calculation

CWE-94: Improper Control of Generation of Code (‘Code Injection’)

Spring Cloud Data Flow