SQL Stored Procedures
Parent: T1505
Description
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). Adversaries may craft malicious stored procedures that can provide a persistence mechanism in SQL database servers.(Citation: NetSPI Startup Stored Procedures)(Citation: Kaspersky MSSQL Aug 2019) To execute operating system commands through SQL syntax the adversary may have to enable additional functionality, such as xp_cmdshell for MSSQL Server.(Citation: NetSPI Startup Stored Procedures)(Citation: Kaspersky MSSQL Aug 2019)(Citation: Microsoft xp_cmdshell 2017) Microsoft SQL Server can enable common language runtime (CLR) integration. With CLR integration enabled, application developers can write stored procedures using any .NET framework language (e.g. VB .NET, C#, etc.).(Citation: Microsoft CLR Integration 2017) Adversaries may craft or modify CLR assemblies that are linked to stored procedures since these CLR assemblies can be made to execute arbitrary commands.(Citation: NetSPI SQL Server CLR)
Mapped SPARTA techniques
No techniques mapped to this control.
Cross-framework references
Relationships published by the source frameworks themselves, reproduced here with attribution. They are not SafeMode Space mappings and carry no confidence rating of ours.
Countered by 15 in MITRE D3FEND (Defensive Techniques)
- D3-ABPIApplication-based Process Isolation
- D3-AVEAsset Vulnerability Enumeration
- D3-CSCredential Scrubbing
- D3-DLVDomain Logic Validation
- D3-EALExecutable Allowlisting
- D3-EDLExecutable Denylisting
- D3-HBPIHardware-based Process Isolation
- D3-PSAProcess Spawn Analysis
- D3-RSRestore Software
- D3-SCASystem Call Analysis
- D3-SCFSystem Call Filtering
- D3-SUSoftware Update
- D3-SWISoftware Inventory
- D3-TLTrusted Library
- D3-VIVariable Initialization
Cite as SafeMode Space, mitre-attack-enterprise T1505.001.