(1433)MSSQL

Microsoft SQL (MSSQL) is Microsoft's SQL-based relational database management system.

About

SQL Server Management Studio (SSMS) is available as an optional feature during the MSSQL installation or can be downloaded and installed separately. It is typically installed on the server to facilitate initial setup and ongoing database management by administrators.

Clients

Many other clients can be used to access a database running on MSSQL such us:

Default system databases

MSSQL have a default system database that can help us navigate and understand the structure of all the databases that are hosted on your target. Here are few of them:

master

Tracks all system information for an SQL server instance

model

Template database that acts as a structure for every new database created. Any setting changed in the model database will be reflected in any new database created after changes to the model database

msdb

The SQL Server Agent uses this database to schedule jobs & alerts

tempdb

Stores temporary objects

resource

Read-only database containing system objects included with SQL server

Dangerous Settings

This is not an extensive list because there are countless ways MSSQL databases can be configured by admins based on the needs of their respective organizations. We may benefit from looking into the following:

  • MSSQL clients not using encryption to connect to the MSSQL server

  • The use of self-signed certificates when encryption is being used. It is possible to spoof self-signed certificates

  • Weak & default sa credentials. Admins may forget to disable this account

Footprinting

Nmap

Metasploit

Connecting to the server

Upon connecting to the server, we will need a bit of knowledge with T-SQL. The following command will list the databases available present in our system:

Last updated