Retrieving MS SQL server information
System administrators and penetration testers often need to gather as much host information as possible. MS SQL databases are common in infrastructures based on Microsoft technologies, and Nmap can help us gather information from them.
This recipe shows how to retrieve information from an MS SQL server.
How to do it...
To retrieve information from an MS SQL server by using Nmap, run the following command:
$ nmap -p1433 --script ms-sql-info <target>
MS SQL server information, such as instance name, version number, and port, will be included in the script output:
PORT STATE SERVICE 1433/tcp open ms-sql-s Host script results: | ms-sql-info: | Windows server name: CLDRN-PC | [192.168.1.102\MSSQLSERVER] | Instance name: MSSQLSERVER | Version: Microsoft SQL Server 2011 | Version number: 11.00.1750.00 | Product: Microsoft SQL Server 2011 | TCP port: 1433 |_ Clustered: No
How it works...
MS SQL servers usually...