Detection rules › Splunk

Microsoft SQL Server Suspicious Child Process - Windows (Sysmon)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

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

References

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process 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.

FieldKindValues
EventCodeeq
  • 1 corpus 237 (splunk 224, kusto 13)
parent_process_namematch
  • "(?i)sqlservr\.exe" corpus 2 (splunk 2)
process_pathmatch
  • "(?i)\x5c(bash|bitsadmin|cmd|net|netstat|nltest|mshta|ping|powershell|pwsh|regsvr32|rundll32|sh|systeminfo|tasklist|ps|at|schtasks|wsl)\.exe" corpus 2 (splunk 2)

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.

StageTerm
1TERM
1"<EventID>1<"
1TERM
1sqlservr
1"sqlservr.exe"
1TERM
1bash
1TERM
1bitsadmin
1TERM
1cmd
1TERM
1net
1TERM
1netstat
1TERM
1nltest
1TERM
1mshta
1TERM
1ping
1TERM
1powershell
1TERM
1pwsh
1TERM
1regsvr32
1TERM
1rundll32
1TERM
1sh
1TERM
1systeminfo
1TERM
1tasklist
1TERM
1ps
1TERM
1at
1TERM
1schtasks
1TERM
1wsl
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"