Detection rule
Suspicious Child Process Of SQL Server
Overview
Detects suspicious child processes of the SQLServer process. This could indicate potential RCE or SQL Injection.
- Rule id
869b9ca7-9ea2-4a5a-8325-e80e62f75445- ATT&CK techniques
- T1190 Exploit Public-Facing Application, T1505.003 Server Software Component: Web Shell
- Severity
- High
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- The Gentlemen, qilin, INC Ransom, Akira, safepay, Play, nightspire
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
1 of 1 positive test events matched; 1 of 1 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 869b9ca7-9ea2-4a5a-8325-e80e62f75445
title: Suspicious Child Process Of SQL Server
id: 869b9ca7-9ea2-4a5a-8325-e80e62f75445
related:
- id: 344482e4-a477-436c-aa70-7536d18a48c7
type: obsolete
status: test
description: Detects suspicious child processes of the SQLServer process. This could indicate potential RCE or SQL Injection.
references:
- Internal Research
author: FPT.EagleEye Team, wagga
date: 2020-12-11
modified: 2023-05-04
tags:
- attack.t1505.003
- attack.t1190
- attack.initial-access
- attack.persistence
- attack.privilege-escalation
logsource:
category: process_creation
product: windows
detection:
selection:
ParentImage|endswith: '\sqlservr.exe'
Image|endswith:
# You can add other uncommon or suspicious processes
- '\bash.exe'
- '\bitsadmin.exe'
- '\cmd.exe'
- '\netstat.exe'
- '\nltest.exe'
- '\ping.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\regsvr32.exe'
- '\rundll32.exe'
- '\sh.exe'
- '\systeminfo.exe'
- '\tasklist.exe'
- '\wsl.exe'
filter_optional_datev:
ParentImage|startswith: 'C:\Program Files\Microsoft SQL Server\'
ParentImage|endswith: 'DATEV_DBENGINE\MSSQL\Binn\sqlservr.exe'
Image: 'C:\Windows\System32\cmd.exe'
CommandLine|startswith: '"C:\Windows\system32\cmd.exe" '
condition: selection and not 1 of filter_optional_*
level: highQRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE devicetype=12 AND (LOWER("Parent Process Path") LIKE '%\sqlservr.exe' AND ((LOWER("Process Path") LIKE '%\bash.exe' OR LOWER("Process Path") LIKE '%\bitsadmin.exe' OR LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Path") LIKE '%\netstat.exe' OR LOWER("Process Path") LIKE '%\nltest.exe' OR LOWER("Process Path") LIKE '%\ping.exe' OR LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe' OR LOWER("Process Path") LIKE '%\regsvr32.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\sh.exe' OR LOWER("Process Path") LIKE '%\systeminfo.exe' OR LOWER("Process Path") LIKE '%\tasklist.exe' OR LOWER("Process Path") LIKE '%\wsl.exe') OR (LOWER("Process Name") LIKE '%\bash.exe' OR LOWER("Process Name") LIKE '%\bitsadmin.exe' OR LOWER("Process Name") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\netstat.exe' OR LOWER("Process Name") LIKE '%\nltest.exe' OR LOWER("Process Name") LIKE '%\ping.exe' OR LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe' OR LOWER("Process Name") LIKE '%\regsvr32.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\sh.exe' OR LOWER("Process Name") LIKE '%\systeminfo.exe' OR LOWER("Process Name") LIKE '%\tasklist.exe' OR LOWER("Process Name") LIKE '%\wsl.exe'))) AND (NOT((LOWER("Parent Process Path") LIKE 'c:\program files\microsoft sql server\%' AND LOWER("Parent Process Path") LIKE '%datev_dbengine\mssql\binn\sqlservr.exe' AND ("Process Path"='C:\Windows\System32\cmd.exe' OR "Process Name"='C:\Windows\System32\cmd.exe') AND LOWER(Command) LIKE '"c:\windows\system32\cmd.exe" %')))QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Suspicious Child Process Of SQL Server- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
Building blocks
BB:OffSet7:Suspicious Child Process Of SQL Server:selection(match)All test lines must match (AND).Parent Process Pathends with:\sqlservr.exeProcess Path / Process Nameends with:\bash.exe,\bitsadmin.exe,\cmd.exe,\netstat.exe,\nltest.exe,\ping.exe,\powershell.exe,\pwsh.exe,\regsvr32.exe,\rundll32.exe,\sh.exe,\systeminfo.exe,\tasklist.exe,\wsl.exe
BB:OffSet7:Suspicious Child Process Of SQL Server:filter_optional_datev(exclusion)All test lines must match (AND).Parent Process Pathstarts with:C:\Program Files\Microsoft SQL Server\Parent Process Pathends with:DATEV_DBENGINE\MSSQL\Binn\sqlservr.exeProcess Path / Process Nameis equal to (case-insensitive):C:\Windows\System32\cmd.exeCommandstarts with:"C:\Windows\system32\cmd.exe"
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1 - when an event matches the condition built from these building blocks:
BB:OffSet7:Suspicious Child Process Of SQL Server:selection AND NOT (ANY of [BB:OffSet7:Suspicious Child Process Of SQL Server:filter_optional_datev])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND (LOWER("Parent Process Path") LIKE '%\sqlservr.exe' AND ((LOWER("Process Path") LIKE '%\bash.exe' OR LOWER("Process Path") LIKE '%\bitsadmin.exe' OR LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Path") LIKE '%\netstat.exe' OR LOWER("Process Path") LIKE '%\nltest.exe' OR LOWER("Process Path") LIKE '%\ping.exe' OR LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe' OR LOWER("Process Path") LIKE '%\regsvr32.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\sh.exe' OR LOWER("Process Path") LIKE '%\systeminfo.exe' OR LOWER("Process Path") LIKE '%\tasklist.exe' OR LOWER("Process Path") LIKE '%\wsl.exe') OR (LOWER("Process Name") LIKE '%\bash.exe' OR LOWER("Process Name") LIKE '%\bitsadmin.exe' OR LOWER("Process Name") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\netstat.exe' OR LOWER("Process Name") LIKE '%\nltest.exe' OR LOWER("Process Name") LIKE '%\ping.exe' OR LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe' OR LOWER("Process Name") LIKE '%\regsvr32.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\sh.exe' OR LOWER("Process Name") LIKE '%\systeminfo.exe' OR LOWER("Process Name") LIKE '%\tasklist.exe' OR LOWER("Process Name") LIKE '%\wsl.exe'))) AND (NOT((LOWER("Parent Process Path") LIKE 'c:\program files\microsoft sql server\%' AND LOWER("Parent Process Path") LIKE '%datev_dbengine\mssql\binn\sqlservr.exe' AND ("Process Path"='C:\Windows\System32\cmd.exe' OR "Process Name"='C:\Windows\System32\cmd.exe') AND LOWER(Command) LIKE '"c:\windows\system32\cmd.exe" %')))
Rule response
- Severity 7, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
ParentImage="*\\sqlservr.exe" (Image IN ("*\\bash.exe", "*\\bitsadmin.exe", "*\\cmd.exe", "*\\netstat.exe", "*\\nltest.exe", "*\\ping.exe", "*\\powershell.exe", "*\\pwsh.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\sh.exe", "*\\systeminfo.exe", "*\\tasklist.exe", "*\\wsl.exe")) NOT (ParentImage="C:\\Program Files\\Microsoft SQL Server\\*" ParentImage="*DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe" Image="C:\\Windows\\System32\\cmd.exe" CommandLine="\"C:\\Windows\\system32\\cmd.exe\" *")Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[Suspicious Child Process Of SQL Server]
description = Detects suspicious child processes of the SQLServer process. This could indicate potential RCE or SQL Injection.
search = ParentImage="*\\sqlservr.exe" (Image IN ("*\\bash.exe", "*\\bitsadmin.exe", "*\\cmd.exe", "*\\netstat.exe", "*\\nltest.exe", "*\\ping.exe", "*\\powershell.exe", "*\\pwsh.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\sh.exe", "*\\systeminfo.exe", "*\\tasklist.exe", "*\\wsl.exe")) NOT (ParentImage="C:\\Program Files\\Microsoft SQL Server\\*" ParentImage="*DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe" Image="C:\\Windows\\System32\\cmd.exe" CommandLine="\"C:\\Windows\\system32\\cmd.exe\" *")Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imProcessCreate
| where ((ParentProcessName endswith "\\sqlservr.exe" or ActingProcessName endswith "\\sqlservr.exe") and (TargetProcessName endswith "\\bash.exe" or TargetProcessName endswith "\\bitsadmin.exe" or TargetProcessName endswith "\\cmd.exe" or TargetProcessName endswith "\\netstat.exe" or TargetProcessName endswith "\\nltest.exe" or TargetProcessName endswith "\\ping.exe" or TargetProcessName endswith "\\powershell.exe" or TargetProcessName endswith "\\pwsh.exe" or TargetProcessName endswith "\\regsvr32.exe" or TargetProcessName endswith "\\rundll32.exe" or TargetProcessName endswith "\\sh.exe" or TargetProcessName endswith "\\systeminfo.exe" or TargetProcessName endswith "\\tasklist.exe" or TargetProcessName endswith "\\wsl.exe")) and (not(((ParentProcessName startswith "C:\\Program Files\\Microsoft SQL Server\\" or ActingProcessName startswith "C:\\Program Files\\Microsoft SQL Server\\") and (ParentProcessName endswith "DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe" or ActingProcessName endswith "DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe") and TargetProcessName =~ "C:\\Windows\\System32\\cmd.exe" and TargetProcessCommandLine startswith "\"C:\\Windows\\system32\\cmd.exe\" ")))Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where (InitiatingProcessFolderPath endswith "\\sqlservr.exe" and (FolderPath endswith "\\bash.exe" or FolderPath endswith "\\bitsadmin.exe" or FolderPath endswith "\\cmd.exe" or FolderPath endswith "\\netstat.exe" or FolderPath endswith "\\nltest.exe" or FolderPath endswith "\\ping.exe" or FolderPath endswith "\\powershell.exe" or FolderPath endswith "\\pwsh.exe" or FolderPath endswith "\\regsvr32.exe" or FolderPath endswith "\\rundll32.exe" or FolderPath endswith "\\sh.exe" or FolderPath endswith "\\systeminfo.exe" or FolderPath endswith "\\tasklist.exe" or FolderPath endswith "\\wsl.exe")) and (not((InitiatingProcessFolderPath startswith "C:\\Program Files\\Microsoft SQL Server\\" and InitiatingProcessFolderPath endswith "DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe" and FolderPath =~ "C:\\Windows\\System32\\cmd.exe" and ProcessCommandLine startswith "\"C:\\Windows\\system32\\cmd.exe\" ")))Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
(process.parent.executable:*\\sqlservr.exe AND (process.executable:(*\\bash.exe OR *\\bitsadmin.exe OR *\\cmd.exe OR *\\netstat.exe OR *\\nltest.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 *\\wsl.exe))) AND (NOT (process.parent.executable:C\:\\Program\ Files\\Microsoft\ SQL\ Server\\* AND process.parent.executable:*DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe AND process.executable:C\:\\Windows\\System32\\cmd.exe AND process.command_line:\"C\:\\Windows\\system32\\cmd.exe\"\ *))Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where (process.parent.executable:"*\\sqlservr.exe" and (process.executable like~ ("*\\bash.exe", "*\\bitsadmin.exe", "*\\cmd.exe", "*\\netstat.exe", "*\\nltest.exe", "*\\ping.exe", "*\\powershell.exe", "*\\pwsh.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\sh.exe", "*\\systeminfo.exe", "*\\tasklist.exe", "*\\wsl.exe"))) and (not (process.parent.executable:"C:\\Program Files\\Microsoft SQL Server\\*" and process.parent.executable:"*DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe" and process.executable:"C:\\Windows\\System32\\cmd.exe" and process.command_line:"\"C:\\Windows\\system32\\cmd.exe\" *"))Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where ends_with(process.parent.executable, "\\sqlservr.exe") and (ends_with(process.executable, "\\bash.exe") or ends_with(process.executable, "\\bitsadmin.exe") or ends_with(process.executable, "\\cmd.exe") or ends_with(process.executable, "\\netstat.exe") or ends_with(process.executable, "\\nltest.exe") or ends_with(process.executable, "\\ping.exe") or ends_with(process.executable, "\\powershell.exe") or ends_with(process.executable, "\\pwsh.exe") or ends_with(process.executable, "\\regsvr32.exe") or ends_with(process.executable, "\\rundll32.exe") or ends_with(process.executable, "\\sh.exe") or ends_with(process.executable, "\\systeminfo.exe") or ends_with(process.executable, "\\tasklist.exe") or ends_with(process.executable, "\\wsl.exe")) and not (starts_with(process.parent.executable, "C:\\Program Files\\Microsoft SQL Server\\") and ends_with(process.parent.executable, "DATEV_DBENGINE\\MSSQL\\Binn\\sqlservr.exe") and process.executable=="C:\\Windows\\System32\\cmd.exe" and starts_with(process.command_line, "\"C:\\Windows\\system32\\cmd.exe\" "))Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageParentImage
False positives
- Database administrators using xp_cmdshell for maintenance jobs; allow-list known job command lines
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
Author and attribution
- Author
- FPT.EagleEye Team, wagga
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_mssql_susp_child_process.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2