Detection rules › Sigma

Metasploit reverse shell injection in SQL Server

Status
experimental
Severity
high
Log source
product windows, category process_creation
Author
mdecrevoisier
Source
github.com/mdecrevoisier/SIGMA-detection-rules

Detects scenarios where an attacker inject a payload into SQL Server in order to obtain a remote shell.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Metasploit reverse shell injection in SQL Server
description: Detects scenarios where an attacker inject a payload into SQL Server in order to obtain a remote shell.
references:
- https://www.offensive-security.com/metasploit-unleashed/payloads-mssql/#
tags:
- attack.execution
- attack.t1059.003
author: mdecrevoisier
status: experimental
logsource:
  product: windows
  category: process_creation
detection:
  selection:
    #Version: 2  # applies to ID 4688 where parent process name is available starting Windows 10 / Server 2016 and higher
    ParentProcessName|endswith: '\sqlservr.exe'
    NewProcessName|endswith:
      - \cmd.exe
      - \powershell.exe
      - \pwsh.exe # PowerShell v6
    CommandLine|contains|all:
      - cmd
      - echo
    CommandLine|contains:
      - /c
      - -c
  condition: selection
falsepositives:
- none
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
  ParentProcessName|endswith: '\sqlservr.exe'
  NewProcessName|endswith:
    - \cmd.exe
    - \powershell.exe
    - \pwsh.exe
  CommandLine|contains|all:
    - cmd
    - echo
  CommandLine|contains:
    - /c
    - -c

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
CommandLinematch
  • -c corpus 7 (sigma 6, splunk 1)
  • /c corpus 15 (sigma 13, splunk 2)
  • cmd corpus 8 (sigma 8)
  • echo corpus 8 (sigma 4, splunk 4)
NewProcessNameends_with
  • \cmd.exe corpus 130 (sigma 130)
  • \powershell.exe corpus 182 (sigma 182)
  • \pwsh.exe corpus 168 (sigma 168)
ParentProcessNameends_with
  • \sqlservr.exe