Detection logic
Original SigmaHQ detection and related fields from the pinned file. The source file includes its full metadata.
logsource:
product: windows
category: ps_script
definition: Script Block Logging must be enable
detection:
selection:
ScriptBlockText|contains: '[Reflection.Assembly]::load'
filter_optional_sqlserver:
Path|startswith:
- 'C:\Program Files (x86)\Microsoft SQL Server\'
- 'C:\Program Files\Microsoft SQL Server\'
Path|endswith: '\Tools\PowerShell\Modules\SQLPS\SqlPsPostScript.ps1'
ScriptBlockText|contains: 'SQLSERVER: { Set-Location'
condition: selection and not 1 of filter_optional_*
falsepositives:
- Legitimate use of the library