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.
Known false positives
- none
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
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
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
CommandLine | match |
| field:"CommandLine" kind:match |
NewProcessName | ends_with |
| field:"Image" kind:ends_with |
ParentProcessName | ends_with |
| field:"parent_process_name" kind:ends_with value:"\sqlservr.exe" |