> ## Documentation Index
> Fetch the complete documentation index at: https://www.0101isnothacking.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# MSSQL enumeration

> Quick reference for enumerating Microsoft SQL Server on port 1433.

MSSQL (Microsoft SQL Server) is a closed-source SQL database. Its queries are similar to MySQL, but the syntax differs in places.

MS SQL Server supports two types of authentication:

1. **Windows Authentication:** SQL Server uses your Windows username and password.
2. **SQL Server Authentication:** SQL Server has its own usernames and passwords.

## Check open ports

```sh theme={null}
nmap -p1433 <ip>
```

## Nmap default scripts

```sh theme={null}
nmap -p1433 -sVC --script ms-sql-info,ms-sql-empty-password,ms-sql-config <ip>
nmap -p1433 -sVC --script ms-sql* <ip>
```

## Connect to MSSQL

```sh theme={null}
impacket-mssqlclient username@10.129.195.181 -windows-auth
```

## Dangerous settings

* 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.
* The use of [named pipes](https://docs.microsoft.com/en-us/sql/tools/configuration-manager/named-pipes-properties?view=sql-server-ver15).
* Weak and default `sa` credentials. Admins may forget to disable this account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.