This hunt hypothesis targets adversary behavior where threat actors deploy the specific Chinese hacktool sqlr.exe to establish persistence or conduct reconnaissance within Azure environments. Proactive hunting for this artifact is critical because its presence often signals an active campaign utilizing a known toolset, allowing the SOC team to rapidly identify and contain potential compromises before they escalate into broader data exfiltration events.
rule CN_Toolset_sig_1433_135_sqlr {
meta:
description = "Detects a Chinese hacktool from a disclosed toolset - file sqlr.exe"
author = "Florian Roth"
reference = "http://qiannao.com/ls/905300366/33834c0c/"
reference2 = "https://raw.githubusercontent.com/Neo23x0/Loki/master/signatures/thor-hacktools.yar"
date = "2015/03/30"
score = 70
hash = "8542c7fb8291b02db54d2dc58cd608e612bfdc57"
strings:
$s0 = "Connect to %s MSSQL server success. Type Command at Prompt." fullword ascii
$s11 = ";DATABASE=master" fullword ascii
$s12 = "xp_cmdshell '" fullword ascii
$s14 = "SELECT * FROM OPENROWSET('SQLOLEDB','Trusted_Connection=Yes;Data Source=myserver" ascii
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 4 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the detection rule targeting sqlr.exe, along with recommended filters and exclusions:
Scenario: Legitimate SQL Server Reporting Services Execution
sqlr.exe is often a legitimate component of the SQL Server Reporting Services (SSRS) or a custom reporting utility installed by the database team. It runs periodically to generate and distribute executive dashboards.File.Path contains \Program Files\Microsoft SQL Server\MSSQL*\ReportingServices\ReportServer\sqlr.exe AND Process.Parent.Name is w3wp.exe (IIS Worker Process) or MsMgmt.exe.Scenario: Scheduled Database Maintenance and Backup Jobs
sqlr.exe as part of its nightly maintenance routine to archive transaction logs. This often runs via Windows Task Scheduler under the context of a dedicated service account.Process.User is NT SERVICE\SQLRService OR DOMAIN\BackupSvcAccount AND Process.CommandLine contains keywords like /backup, /archive, or /maintenance.Scenario: Deployment of Chinese Enterprise Resource Planning (ERP) Modules
sqlr.exe naming