File ms-sql-config

脚本使用类型: hostrule, portrule
脚本所属分类: discovery, safe
脚本下载地址: http://nmap.org/svn/scripts/ms-sql-config.nse

User Summary

Queries Microsoft SQL Server (ms-sql) instances for a list of databases, linked servers, and configuration settings.

SQL Server credentials required: Yes (use ms-sql-brute, ms-sql-empty-password and/or mssql.username & mssql.password) Run criteria:

or mssql.instance-port script arguments are used (see mssql.lua). if the mssql.instance-all, mssql.instance-name and mssql.instance-port script arguments are NOT used.

NOTE: Communication with instances via named pipes depends on the smb library. To communicate with (and possibly to discover) instances via named pipes, the host must have at least one SMB port (e.g. TCP 445) that was scanned and found to be open. Additionally, named pipe connections may require Windows authentication to connect to the Windows host (via SMB) in addition to the authentication required to connect to the SQL Server instances itself. See the documentation and arguments for the smb library for more information.

NOTE: By default, the ms-sql-* scripts may attempt to connect to and communicate with ports that were not included in the port list for the Nmap scan. This can be disabled using the mssql.scanned-ports-only script argument.

Script Arguments


If set, shows all configuration options.

mssql.domain, mssql.instance-all, mssql.instance-name, mssql.instance-port, mssql.password, mssql.protocol, mssql.scanned-ports-only, mssql.timeout, mssql.username

See the documentation for the mssql library.

randomseed, smbbasic, smbport, smbsign

See the documentation for the smb library.

smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername

See the documentation for the smbauth library.

Example Usage


nmap -p 1433 --script ms-sql-config --script-args mssql.username=sa,mssql.password=sa <host>

Script Output

| ms-sql-config:
|     Databases
|       name      db_size owner
|       ====      ======= =====
|       nmap      2.74 MB MAC-MINI\david
|     Configuration
|       name      value   inuse   description
|       ====      =====   =====   ===========
|       SQL Mail XPs      0       0       Enable or disable SQL Mail XPs
|       Database Mail XPs 0       0       Enable or disable Database Mail XPs
|       SMO and DMO XPs   1       1       Enable or disable SMO and DMO XPs
|       Ole Automation Procedures 0       0       Enable or disable Ole Automation Procedures
|       xp_cmdshell       0       0       Enable or disable command shell
|       Ad Hoc Distributed Queries        0       0       Enable or disable Ad Hoc Distributed Queries
|       Replication XPs   0       0       Enable or disable Replication XPs
|     Linked Servers
|       srvname   srvproduct      providername
|       =======   ==========      ============
|_      MAC-MINI  SQL Server      SQLOLEDB


Author: Patrik Karlsson

License: VER007 整理 http://www.ver007.com