Suspicious Execution via SQL PowerShell


Description

Detects attempts to execute suspicious powershell commands using the Microsoft SQL Powershell Helper Tools.

Query · eql

process where event.action == "start" and 
 process.name : ("SQLToolsPS.exe", "sqlps.exe") and 
 process.args : ("-e", "-enc", "-ep", "-encoded", "*;iex", "*start-process*", "*WebClient*", 
                "*DownloadFile*", "*DownloadString*", "*BitsTransfer*", "*Reflection.Assembly*")
Raw source Suspicious Execution via SQL PowerShell · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = "Detects attempts to execute suspicious powershell commands using the Microsoft SQL Powershell Helper Tools."
id = "d111e88f-c5d2-41b4-b294-1f9cfea93b6c"
license = "Elastic License v2"
name = "Suspicious Execution via SQL PowerShell"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/OtherMSBinaries/Sqltoolsps/"]
version = "1.0.4"

query = '''
process where event.action == "start" and 
 process.name : ("SQLToolsPS.exe", "sqlps.exe") and 
 process.args : ("-e", "-enc", "-ep", "-encoded", "*;iex", "*start-process*", "*WebClient*", 
                "*DownloadFile*", "*DownloadString*", "*BitsTransfer*", "*Reflection.Assembly*")
'''

min_endpoint_version = "7.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "7.16.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.