(self)
| 45 | self.xpCmdshellStr = "master..xp_cmdshell" |
| 46 | |
| 47 | def _xpCmdshellCreate(self): |
| 48 | cmd = "" |
| 49 | |
| 50 | if not Backend.isVersionWithin(("2000",)): |
| 51 | logger.debug("activating sp_OACreate") |
| 52 | |
| 53 | cmd = getSQLSnippet(DBMS.MSSQL, "activate_sp_oacreate") |
| 54 | inject.goStacked(agent.runAsDBMSUser(cmd)) |
| 55 | |
| 56 | self._randStr = randomStr(lowercase=True) |
| 57 | self.xpCmdshellStr = "master..new_xp_cmdshell" |
| 58 | |
| 59 | cmd = getSQLSnippet(DBMS.MSSQL, "create_new_xp_cmdshell", RANDSTR=self._randStr) |
| 60 | |
| 61 | if not Backend.isVersionWithin(("2000",)): |
| 62 | cmd += ";RECONFIGURE WITH OVERRIDE" |
| 63 | |
| 64 | inject.goStacked(agent.runAsDBMSUser(cmd)) |
| 65 | |
| 66 | def _xpCmdshellConfigure2005(self, mode): |
| 67 | debugMsg = "configuring xp_cmdshell using sp_configure " |
no test coverage detected