mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-10 09:49:06 +00:00
refactoring for issue #51
This commit is contained in:
@@ -8,7 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
from extra.safe2bin.safe2bin import safechardecode
|
||||
from lib.core.common import dataToStdout
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import getSPQLSnippet
|
||||
from lib.core.common import getSQLSnippet
|
||||
from lib.core.common import isTechniqueAvailable
|
||||
from lib.core.common import readInput
|
||||
from lib.core.data import conf
|
||||
@@ -163,12 +163,12 @@ class Abstraction(Web, UDF, xp_cmdshell):
|
||||
choice = readInput(msg, default="Y")
|
||||
|
||||
if not choice or choice in ("y", "Y"):
|
||||
expression = getSPQLSnippet(DBMS.MSSQL, "configure_openrowset", ENABLE="1")
|
||||
expression = getSQLSnippet(DBMS.MSSQL, "configure_openrowset", ENABLE="1")
|
||||
inject.goStacked(expression)
|
||||
|
||||
# TODO: add support for PostgreSQL
|
||||
#elif Backend.isDbms(DBMS.PGSQL):
|
||||
# expression = getSPQLSnippet(DBMS.PGSQL, "configure_dblink", ENABLE="1")
|
||||
# expression = getSQLSnippet(DBMS.PGSQL, "configure_dblink", ENABLE="1")
|
||||
# inject.goStacked(expression)
|
||||
|
||||
def initEnv(self, mandatory=True, detailed=False, web=False):
|
||||
|
||||
@@ -8,7 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
from lib.core.agent import agent
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import getLimitRange
|
||||
from lib.core.common import getSPQLSnippet
|
||||
from lib.core.common import getSQLSnippet
|
||||
from lib.core.common import hashDBWrite
|
||||
from lib.core.common import isListLike
|
||||
from lib.core.common import isNoneValue
|
||||
@@ -48,14 +48,14 @@ class xp_cmdshell:
|
||||
if Backend.isVersionWithin(("2005", "2008")):
|
||||
logger.debug("activating sp_OACreate")
|
||||
|
||||
cmd = getSPQLSnippet(DBMS.MSSQL, "activate_sp_oacreate")
|
||||
cmd = getSQLSnippet(DBMS.MSSQL, "activate_sp_oacreate")
|
||||
inject.goStacked(agent.runAsDBMSUser(cmd))
|
||||
|
||||
self.__randStr = randomStr(lowercase=True)
|
||||
self.__xpCmdshellNew = "xp_%s" % randomStr(lowercase=True)
|
||||
self.xpCmdshellStr = "master..%s" % self.__xpCmdshellNew
|
||||
|
||||
cmd = getSPQLSnippet(DBMS.MSSQL, "create_new_xp_cmdshell", RANDSTR=self.__randStr, XP_CMDSHELL_NEW=self.__xpCmdshellNew)
|
||||
cmd = getSQLSnippet(DBMS.MSSQL, "create_new_xp_cmdshell", RANDSTR=self.__randStr, XP_CMDSHELL_NEW=self.__xpCmdshellNew)
|
||||
|
||||
if Backend.isVersionWithin(("2005", "2008")):
|
||||
cmd += ";RECONFIGURE WITH OVERRIDE"
|
||||
@@ -67,7 +67,7 @@ class xp_cmdshell:
|
||||
debugMsg += "stored procedure"
|
||||
logger.debug(debugMsg)
|
||||
|
||||
cmd = getSPQLSnippet(DBMS.MSSQL, "configure_xp_cmdshell", ENABLE=str(mode))
|
||||
cmd = getSQLSnippet(DBMS.MSSQL, "configure_xp_cmdshell", ENABLE=str(mode))
|
||||
|
||||
return cmd
|
||||
|
||||
@@ -77,9 +77,9 @@ class xp_cmdshell:
|
||||
logger.debug(debugMsg)
|
||||
|
||||
if mode == 1:
|
||||
cmd = getSPQLSnippet(DBMS.MSSQL, "enable_xp_cmdshell_2000", ENABLE=str(mode))
|
||||
cmd = getSQLSnippet(DBMS.MSSQL, "enable_xp_cmdshell_2000", ENABLE=str(mode))
|
||||
else:
|
||||
cmd = getSPQLSnippet(DBMS.MSSQL, "disable_xp_cmdshell_2000", ENABLE=str(mode))
|
||||
cmd = getSQLSnippet(DBMS.MSSQL, "disable_xp_cmdshell_2000", ENABLE=str(mode))
|
||||
|
||||
return cmd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user