MSSQL
MSSQL (Microsoft SQL)
Way to connect to MSSQL:
impacket-mssqlclient Administrator:[email protected] -windows-authAdministrator:[email protected]
{username} :{passwd}@{IP_addr}check the version:
SELECT @@version;list of schema in database:
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;list all available database:
To get a list of tables
To get table column names:
To get all the values from the table:
Connecting and Running Commands
Using sqlcmd Locally:
sqlcmd Locally:Using impacket-mssqlclient (Remote):
impacket-mssqlclient (Remote):Basic Information and System Details
Check the Server Version:
Check Current User / Login:
Check the Current Database:
List All Available Databases:
Switch to a Specific Database:
Enumerating Schemas, Tables, and Columns
List All Schemas in the Current Database:
List All Tables in the Current Database:
List All Tables in Another Database:
List All Columns for a Specific Table:
Select All Data From a Table:
Advanced Features
Enable xp_cmdshell (if you have the right permissions):
xp_cmdshell (if you have the right permissions):Use xp_cmdshell to Run OS Commands (If Enabled):
xp_cmdshell to Run OS Commands (If Enabled):Other Useful System Views
Notes on Authentication and Connections
Last updated