Detection rules › Splunk
Microsoft SQL Server Suspicious Child Process - Windows (Sysmon)
sqlservr.exe is the primary executable for Microsoft SQL Server. Compromised SQL databases may be leveraged to gain footholds for further network exploitation. This use case detects executions of commonly abused binaries with parent process sqlservr.exe. Unexpected executions can indicate SQL injection or RCE
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Persistence |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
Rule body
id: '26010.48109'
title: Microsoft SQL Server Suspicious Child Process - Windows
description: 'sqlservr.exe is the primary executable for Microsoft SQL Server. Compromised
SQL databases may be leveraged to gain footholds for further network exploitation.
This use case detects executions of commonly abused binaries with parent process
sqlservr.exe. Unexpected executions can indicate SQL injection or RCE. -- Threat
Actor Association: FIN7'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<")
(TERM(sqlservr) OR "sqlservr.exe") (TERM(bash) OR TERM(bitsadmin) OR TERM(cmd) OR
TERM(net) OR TERM(netstat) OR TERM(nltest) OR TERM(mshta) OR TERM(ping) OR TERM(powershell)
OR TERM(pwsh) OR TERM(regsvr32) OR TERM(rundll32) OR TERM(sh) OR TERM(systeminfo)
OR TERM(tasklist) OR TERM(ps) OR TERM(at) OR TERM(schtasks) OR TERM(wsl) OR "bash.exe"
OR "bitsadmin.exe" OR "cmd.exe" OR "net.exe" OR "netstat.exe" OR "nltest.exe" OR
"mshta.exe" OR "ping.exe" OR "powershell.exe" OR "pwsh.exe" OR "regsvr32.exe" OR
"rundll32.exe" OR "sh.exe" OR "systeminfo.exe" OR "tasklist.exe" OR "ps.exe" OR
"at.exe" OR "schtasks.exe" OR "wsl.exe") | where match(parent_process_name, "(?i)sqlservr\.exe")
and match(process_path, "(?i)\x5c(bash|bitsadmin|cmd|net|netstat|nltest|mshta|ping|powershell|pwsh|regsvr32|rundll32|sh|systeminfo|tasklist|ps|at|schtasks|wsl)\.exe")
| table _time, host, user, process, process_*, parent_process_* | bin span=1s |
stats values(*) as * by _time, host '
techniques:
- persistence:server software component:sql stored procedures
- initial-access:exploit public-facing application
technique_id:
- T1505.001
- T1190
data_category:
- Windows Sysmon
references:
- https://www.securonix.com/blog/securonix-threat-research-security-advisory-new-returgence-attack-campaign-turkish-hackers-target-mssql-servers-to-deliver-domain-wide-mimic-ransomware/
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<") (TERM(sqlservr) OR "sqlservr.exe") (TERM(bash) OR TERM(bitsadmin) OR TERM(cmd) OR TERM(net) OR TERM(netstat) OR TERM(nltest) OR TERM(mshta) OR TERM(ping) OR TERM(powershell) OR TERM(pwsh) OR TERM(regsvr32) OR TERM(rundll32) OR TERM(sh) OR TERM(systeminfo) OR TERM(tasklist) OR TERM(ps) OR TERM(at) OR TERM(schtasks) OR TERM(wsl) OR "bash.exe" OR "bitsadmin.exe" OR "cmd.exe" OR "net.exe" OR "netstat.exe" OR "nltest.exe" OR "mshta.exe" OR "ping.exe" OR "powershell.exe" OR "pwsh.exe" OR "regsvr32.exe" OR "rundll32.exe" OR "sh.exe" OR "systeminfo.exe" OR "tasklist.exe" OR "ps.exe" OR "at.exe" OR "schtasks.exe" OR "wsl.exe")
Stage 2: where
| where match(parent_process_name, "(?i)sqlservr\.exe") and match(process_path, "(?i)\x5c(bash|bitsadmin|cmd|net|netstat|nltest|mshta|ping|powershell|pwsh|regsvr32|rundll32|sh|systeminfo|tasklist|ps|at|schtasks|wsl)\.exe")
Stage 3: table
| table _time, host, user, process, process_*, parent_process_*
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"1" |
parent_process_name | regex_match |
| field:"parent_process_name" kind:regex_match |
process_path | regex_match |
| field:"process_name" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>1<" |
| 1 | sqlservr |
| 1 | "sqlservr.exe" |
| 1 | bash |
| 1 | bitsadmin |
| 1 | cmd |
| 1 | net |
| 1 | netstat |
| 1 | nltest |
| 1 | mshta |
| 1 | ping |
| 1 | powershell |
| 1 | pwsh |
| 1 | regsvr32 |
| 1 | rundll32 |
| 1 | sh |
| 1 | systeminfo |
| 1 | tasklist |
| 1 | ps |
| 1 | at |
| 1 | schtasks |
| 1 | wsl |
| 1 | "bash.exe" |
| 1 | "bitsadmin.exe" |
| 1 | "cmd.exe" |
| 1 | "net.exe" |
| 1 | "netstat.exe" |
| 1 | "nltest.exe" |
| 1 | "mshta.exe" |
| 1 | "ping.exe" |
| 1 | "powershell.exe" |
| 1 | "pwsh.exe" |
| 1 | "regsvr32.exe" |
| 1 | "rundll32.exe" |
| 1 | "sh.exe" |
| 1 | "systeminfo.exe" |
| 1 | "tasklist.exe" |
| 1 | "ps.exe" |
| 1 | "at.exe" |
| 1 | "schtasks.exe" |
| 1 | "wsl.exe" |