T-SQL Malware Brute-Forces MS SQL Servers to Drop Gh0st RAT, XMRig

FortiGuard Labs details a campaign that brute-forces exposed Microsoft SQL Servers on port 1433 and installs the Gh0st RAT remote access trojan and XMRig miner.
Table of Contents
    Add a header to begin generating the table of contents

    FortiGuard Labs has described an active campaign that brute-forces internet-facing Microsoft SQL Server instances on TCP port 1433 and then installs a Gh0st RAT variant and the XMRig cryptocurrency miner. The operator is suspected to be a Chinese-speaking, financially motivated actor, and FortiGuard has not attributed the campaign to a named group.

    The Scanner and Brute-Forcer That Find Weak SQL Servers

    The attack begins with a UPX-packed Go scanner, dllhost.exe, that embeds the Naabu port scanner and sweeps /16 subnets for port 1433. A .NET brute-forcer named CSQL.exe, disguised as dwm.exe, then attacks accounts such as sa and admin using up to 500 threads and more than 2,700 passwords.

    T-SQL Batches Enable xp_cmdshell and Stage Payloads Over FTP

    When a login succeeds, the malware runs T-SQL batches that enable xp_cmdshell and Ole Automation. It then stages payloads over FTP and registers scheduled tasks disguised as Microsoft Edge updates.

    XMRig Monero Miner Configured for Kryptex and Nanopool

    One payload is an XMRig Monero miner configured for Kryptex and Nanopool. It uses the compromised server’s processor to mine cryptocurrency for the operator.

    A Gh0st RAT Variant With Anti-Security Checks

    The second payload is a Gh0st RAT variant with keylogging, screen capture and a remote shell. It supports more than 30 commands, wipes logs, and checks for 78 security-tool processes. It also steals Tencent QQ files.

    Scope and Victim Count Remain Unclear

    FortiGuard’s telemetry confirmed one US server, and the victim count has not been disclosed. The campaign is described as active at the time of the report.

    What Defenders Are Told to Restrict

    FortiGuard’s guidance is to restrict port 1433 at the perimeter, enforce strong sa passwords, and keep xp_cmdshell and Ole Automation disabled. Each recommendation corresponds to a step in the attack chain: the scanner needs reachable port 1433, the brute-forcer needs weak passwords, and the T-SQL batches need the two features turned on.

    Why dllhost.exe, dwm.exe and Edge Update Names Appear in the Attack

    The campaign disguises its tools with the names of ordinary Windows components. The Go scanner runs as dllhost.exe and the brute-forcer CSQL.exe presents itself as dwm.exe. The scheduled tasks that keep the payloads running are labeled as Microsoft Edge updates. These names are meant to blend into process lists and task schedulers on servers where administrators expect Windows system activity.

    The scanner works through /16 subnets, so each sweep covers a wide range of potential SQL Server hosts. The brute-forcer’s 500 threads and 2,700-plus passwords allow rapid guessing against sa and admin accounts.

    FortiGuard Labs Describes a Suspected Chinese-Speaking Operator

    FortiGuard describes the operator as suspected Chinese-speaking and financially motivated but does not name a group. One feature of the Gh0st RAT variant points in that direction: it steals Tencent QQ files. The XMRig configuration for Kryptex and Nanopool shows the operator wants Monero mining income alongside remote access.

    Why Exposed Database Servers Remain an Attractive Target

    The impact is CPU hijacking and full remote control of compromised database hosts. Pairing a miner with a remote access trojan gives the operator two revenue paths from one intrusion: immediate mining income and a persistent foothold that includes keylogging and screen capture. The log wiping and the 78-process security-tool check show the RAT is built to survive on hosts that run endpoint protection.

    An Attack Chain Built Only on Weak Credentials

    Nothing in the described chain relies on a software vulnerability. The entry point is a password guess against an exposed service, and every later step uses features that SQL Server ships with. That makes the campaign a measure of how many database servers remain reachable from the internet with weak credentials, a number the report does not quantify.

    Related Posts