Server Software Component: SQL Stored Procedures T1505.001
Tactic: Persistence
Adversaries may abuse SQL stored procedures to establish persistent access to systems. SQL Stored Procedures are code that can be saved and reused so that database users do not waste time rewriting frequently used SQL queries. Stored procedures can be invoked via SQL statements to the database using the procedure name or via defined events (e.g. when a SQL server application is started/restarted).
Events covered
11 catalog events are tagged with this technique by at least one rule.
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 1 | Process creation |
| Sysmon | Event ID 11 | FileCreate |
| Security-Auditing | Event ID 4688 | A new process has been created. |
| Defender-DeviceProcessEvents | ProcessCreated | Process created |
| MSSQLSERVER | Event ID 8128 | Event ID 8128 |
| MSSQLSERVER | Event ID 15457 | Event ID 15457 |
| MSSQLSERVER | Event ID 17199 | Event ID 17199 |
| MSSQLSERVER | Event ID 17200 | Event ID 17200 |
| MSSQLSERVER | Event ID 17201 | Event ID 17201 |
| MSSQLSERVER | Event ID 17202 | Event ID 17202 |
| MSSQLSERVER | Event ID 17810 | Event ID 17810 |
Authoring guide
Patterns shared across the 18 rules above: which fields they filter on, what specific values they look for, and what they exclude. The catalog normalizes field names across vendors so Sigma's Image, Elastic's process.name, and Splunk's process_name collapse into one row. Each rule contributes at most once per row.
Fields filtered most (23 distinct)
The fields most rules look at when detecting this technique. The How column shows the operators authors use (eq, wildcard, regex_match, match) and how often each appears. Sample values are concrete examples to start from, not an exhaustive list.
Top indicator values (67 distinct)
Specific (field, operator, value) combinations the rules check for, ranked by how many rules under this technique use each one. The Corpus reach column counts how many rules across the entire catalog (any technique) check the same combination. High numbers point to widely-used indicators that are likely noisy on their own; combine them with another condition for useful signal. Blank means the combination is specific to rules under this technique. Click a value to expand the rules under this technique that use it.
Exclusions (29 distinct)
Field/operator/value combinations excluded by rules under this technique (top-level not() clauses), sorted by how many rules exclude each. These are the false-positive paths the community has learned to filter out. A new rule that ignores the high-count entries here will likely fire on the same noisy paths. Click a value to expand the rules under this technique that exclude it.
Rules under this technique
Every rule in the catalog tagged with this technique, grouped by vendor. Click a rule title for its full predicates, exclusions, and indicators.
Sigma 7 rules
- Potential CVE-2023-27363 Exploitation - HTA File Creation By FoxitPDFReader
- SQL Server Dedicated Admin Connection (DAC) mode activated (native)
- SQL Server Dedicated Admin Connection (DAC) suspicious activity
- SQL Server lateral movement with CLR activation
- SQL server sqlcmd utility abuse for privilege escalation
- SQL Server started in single mode (command)
- Suspicious SQL Query
Elastic 2 rules
Splunk 8 rules
- Microsoft SQL Server Suspicious Child Process - Windows (Sysmon)
- Microsoft SQL Server Suspicious Child Process - Windows (Windows Event Log)
- Windows SQL Server Configuration Option Hunt
- Windows SQL Server Critical Procedures Enabled
- Windows SQL Server Extended Procedure DLL Loading Hunt
- Windows SQL Server Startup Procedure
- Windows SQL Server xp_cmdshell Config Change
- Windows Sqlservr Spawning Shell