SQL Server Brute-Force Attacks Deliver Monero Miners and Gh0st RAT

| 2 Min Read
A campaign scans for exposed SQL Server instances, brute-forces weak logins, and uses xp_cmdshell to install a Monero miner and a Gh0st RAT variant on Windows hosts.

This campaign doesn't need a zero-day or a clever exploit chain. It needs a SQL Server instance reachable from the internet and a guessable administrator password. Once an attacker gets in, the database becomes a route to command execution on the underlying Windows machine, and from there, a cryptominer and a remote access trojan.

From open port 1433 to a Windows shell

The chain starts with a Go-based payload named "dllhost.exe" that runs the open-source Naabu port scanner, according to FortiGuard researcher Xiaopeng Zhang, who shared a disclosure with CSO ahead of Thursday's publication. The payload pulls target IP ranges from an attacker-controlled server, converts them into CIDR ranges, and scans randomly generated addresses for TCP port 1433, the default port for Microsoft SQL Server.

Hosts that respond get logged, and their addresses go to a separate executable, "dwn.exe," which brute-forces logins. It tries usernames such as "sa" and "admin" against a predefined password list of more than 2,700 entries.

A successful login gets the attacker more than database access. The malware runs T-SQL commands from a file called 2018.sql, and those commands enable xp_cmdshell, a SQL Server feature that lets administrators run Windows command shell operations. The attackers use it to download or extract executables into the "C:\Users\Public" directory and run them.

Jason Soroko, senior fellow at Sectigo, put it plainly: the campaign turns a database login into a way to execute malware on the server. "Organizations should remove direct internet access to SQL Server, restrict connections to approved systems, and enforce strong, unique credentials," he said. "Administrative access should be limited to accounts that need it."

A cryptominer and a Gh0st RAT come along for the ride

The T-SQL commands deploy a loader that fetches more executables from the attackers' FTP infrastructure. Two payloads stand out.

The first, MicrosoftEdgeUpdate.exe, masquerades as a browser update but is an XMRig-based Monero miner. It burns the compromised server's CPU cycles to mine Monero and reports to mining pools using a wallet address embedded in its configuration.

The second is a Gh0st RAT variant delivered as "Winlogon.exe." FortiGuard's researchers found keylogging, file management, data theft, remote shell execution, and process management, along with more than 30 control commands. Plugins add screen capture and remote desktop access. That's the payload that turns a noisy miner into a long-term foothold.

Persistence built in layers

The attackers didn't rely on one mechanism to stay put. The initial payload creates a scheduled task that runs every 30 minutes, while the downloader sets up a separate task that runs daily at 1 AM. The Gh0st RAT adds itself to the Windows registry's Run key, installs a Windows service, and creates a scheduled task that launches it every 30 minutes.

Redundancy like this means that removing the miner alone won't clean the host. Defenders need to hunt for every task, service, and registry entry the chain leaves behind.

The miner also makes a convenient decoy. Shane Barney, chief information security officer at Keeper Security, said cryptominers can serve as a distraction from the more serious implications of an intrusion. Attackers can use mining activity as "a smokescreen for establishing long-term persistence through remote access tools." High CPU usage gets investigated; a quiet RAT doesn't.

The real problem is standing credentials

Barney's broader point is the one to take away. "While internet-facing databases are sometimes the unintended result of technical debt or misconfigurations, relying on static, standing credentials is what turns that exposure into a critical vulnerability," he said. "When administrative logins can be brute-forced, attackers gain immediate, unchecked control to deploy malware without needing a single complex exploit."

Soroko's advice adds a practical layer. Keep xp_cmdshell disabled unless a workload truly needs it, and alert on any attempt to re-enable it. That single setting cuts off the step that turns a database login into a Windows shell.

FortiGuard says its IPS, Web Filtering, and Antivirus services cover the campaign, and it published indicators of compromise for organizations outside its customer base. Microsoft had not responded to a request for comment at publication. Expect more of these chains: the scanning and brute-forcing tooling is cheap, and SQL Server instances with weak administrator credentials are easy to find.

Source: John Johnson · www.csoonline.com

Comments

Please sign in to comment.