MSSQL Injection Cheat Sheet
MSSQL Injection Cheat Sheet
Some useful syntax reminders for SQL Injection into MSSQL databases…
This post is part of a series of SQL Injection Cheat Sheets. In this series, I’ve endevoured to
tabulate the data to make it easier to read and to use the same table for for each database
backend. This helps to highlight any features which are lacking for each database, and
enumeration techniques that don’t apply and also areas that I haven’t got round to
researching yet.
Some of the queries in the table below can only be run by an admin. These are marked with
“– priv” at the end of the query.
Misc Tips
From Trip:
List DBAs (included in table above now):
Note also that in case of using this data with a UNION query a collation error could occur.
In this case a simple trick is to use the following syntax:
select permission_name collate database_default FROM fn_my_permissions (NULL,
‘DATABASE’)