Rapid7 Vulnerability & Exploit Database

Microsoft SQL Server xp_cmdshell Command Execution

Back to Search

Microsoft SQL Server xp_cmdshell Command Execution

Created
05/30/2018

Description

This module will execute a Windows command on a MSSQL/MSDE instance via the xp_cmdshell procedure. A valid username and password is required to use this module

Author(s)

  • tebo <tebo@attackresearch.com>

Development

References

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use auxiliary/admin/mssql/mssql_exec
msf auxiliary(mssql_exec) > show actions
    ...actions...
msf auxiliary(mssql_exec) > set ACTION < action-name >
msf auxiliary(mssql_exec) > show options
    ...show and set options...
msf auxiliary(mssql_exec) > run 

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;