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 | T1190 Exploit Public-Facing Application |
| Persistence | T1505.001 Server Software Component: SQL Stored Procedures |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 1 | Process creation |
Rule body yaml
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
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
EventCode | eq |
|
parent_process_name | match |
|
process_path | match |
|
Search terms
Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.
| Stage | Term |
|---|---|
| 1 | TERM |
| 1 | "<EventID>1<" |
| 1 | TERM |
| 1 | sqlservr |
| 1 | "sqlservr.exe" |
| 1 | TERM |
| 1 | bash |
| 1 | TERM |
| 1 | bitsadmin |
| 1 | TERM |
| 1 | cmd |
| 1 | TERM |
| 1 | net |
| 1 | TERM |
| 1 | netstat |
| 1 | TERM |
| 1 | nltest |
| 1 | TERM |
| 1 | mshta |
| 1 | TERM |
| 1 | ping |
| 1 | TERM |
| 1 | powershell |
| 1 | TERM |
| 1 | pwsh |
| 1 | TERM |
| 1 | regsvr32 |
| 1 | TERM |
| 1 | rundll32 |
| 1 | TERM |
| 1 | sh |
| 1 | TERM |
| 1 | systeminfo |
| 1 | TERM |
| 1 | tasklist |
| 1 | TERM |
| 1 | ps |
| 1 | TERM |
| 1 | at |
| 1 | TERM |
| 1 | schtasks |
| 1 | TERM |
| 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" |