This module can be used to escalate SQL Server user privileges to sysadmin through a web SQL Injection. In order to escalate, the database user must to have the db_owner role in a trustworthy database owned by a sysadmin user. Once the database user has the sysadmin role, the mssql_payload_sqli module can be used to obtain a shell on the system. The syntax for injection URLs is: /testing.asp?id=1+and+1=[SQLi];--
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_escalate_dbowner_sqli
msf auxiliary(mssql_escalate_dbowner_sqli) > show actions
...actions...
msf auxiliary(mssql_escalate_dbowner_sqli) > set ACTION < action-name >
msf auxiliary(mssql_escalate_dbowner_sqli) > show options
...show and set options...
msf auxiliary(mssql_escalate_dbowner_sqli) > 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