Detection rules › Sigma
Metasploit reverse shell injection in SQL Server
Detects scenarios where an attacker inject a payload into SQL Server in order to obtain a remote shell.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1059.003 Command and Scripting Interpreter: Windows Command Shell |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 1 | Process creation |
| Security-Auditing | Event ID 4688 | A new process has been created. |
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
selectionStage 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.
| Field | Kind | Values |
|---|---|---|
CommandLine | match |
|
NewProcessName | ends_with |
|
ParentProcessName | ends_with |
|