ms-sql-query
脚本使用类型:
hostrule, portrule
脚本所属分类:
discovery, safe
脚本下载地址: http://nmap.org/svn/scripts/ms-sql-query.nse
Runs a query against Microsoft SQL Server (ms-sql).
SQL Server credentials required: Yes (use ms-sql-brute
, ms-sql-empty-password
and/or mssql.username
& mssql.password
)
Run criteria:
mssql.instance-all
, mssql.instance-name
mssql.instance-port
script arguments are used (see mssql.lua).
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.
Database to connect to (default: tempdb)
The query to run against the server. (default: SELECT @@version version)
执行格式
nmap -p 1433 --script ms-sql-query --script-args mssql.username=sa,mssql.password=sa,ms-sql-query.query="SELECT * FROM master..syslogins" <host>
| ms-sql-query: | [192.168.100.25\MSSQLSERVER] | Query: SELECT @@version version | version | ======= | Microsoft SQL Server 2005 - 9.00.3068.00 (Intel X86) | Feb 26 2008 18:15:01 | Copyright (c) 1988-2005 Microsoft Corporation |_ Express Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
Author: Patrik Karlsson
License: VER007 整理 http://www.ver007.com