MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _xpCmdshellCreate

Method _xpCmdshellCreate

lib/takeover/xp_cmdshell.py:47–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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 "

Callers 1

xpCmdshellInitMethod · 0.95

Calls 5

getSQLSnippetFunction · 0.90
randomStrFunction · 0.90
isVersionWithinMethod · 0.80
debugMethod · 0.80
runAsDBMSUserMethod · 0.80

Tested by

no test coverage detected