Detection rules › Splunk

Microsoft SQL Server Suspicious Child Process - Windows (Windows Event Log)

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

Telemetry coverage

Rule body

id: '26010.48255'
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_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) (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 event logs
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_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (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.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
parent_process_nameregex_match
  • "(?i)sqlservr.exe" corpus 2 (splunk 2)
field:"parent_process_name" kind:regex_match
process_pathregex_match
  • "(?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)
field:"process_name" kind:regex_match

Search terms

These SPL tokens match against raw event text.

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