mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-27 04:05:58 +00:00
Implementation for an Issue #118
This commit is contained in:
parent
42f518b2d6
commit
f8c9868cb6
11 changed files with 39 additions and 29 deletions
|
|
@ -142,7 +142,7 @@ class Abstraction(Web, UDF, xp_cmdshell):
|
|||
self.runCmd(command)
|
||||
|
||||
def __initRunAs(self):
|
||||
if not conf.dCred:
|
||||
if not conf.dbmsCred:
|
||||
return
|
||||
|
||||
if not conf.direct and not isTechniqueAvailable(PAYLOAD.TECHNIQUE.STACKED):
|
||||
|
|
@ -186,7 +186,7 @@ class Abstraction(Web, UDF, xp_cmdshell):
|
|||
warnMsg = "functionality requested probably does not work because "
|
||||
warnMsg += "the curent session user is not a database administrator"
|
||||
|
||||
if not conf.dCred and Backend.getIdentifiedDbms() in ( DBMS.MSSQL, DBMS.PGSQL ):
|
||||
if not conf.dbmsCred and Backend.getIdentifiedDbms() in ( DBMS.MSSQL, DBMS.PGSQL ):
|
||||
warnMsg += ". You can try to use option '--dbms-cred' "
|
||||
warnMsg += "to execute statements as a DBA user if you "
|
||||
warnMsg += "were able to extract and crack a DBA "
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class xp_cmdshell:
|
|||
# to retrieve it afterwards
|
||||
# NOTE: this does not need to be done when the command is 'del' to
|
||||
# delete the temporary file
|
||||
if conf.dCred and insertIntoTable:
|
||||
if conf.dbmsCred and insertIntoTable:
|
||||
self.tmpFile = "%s/tmpc%s.txt" % (conf.tmpPath, randomStr(lowercase=True))
|
||||
cmd = "%s > \"%s\"" % (cmd, self.tmpFile)
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ class xp_cmdshell:
|
|||
# it does not work unfortunately, BULK INSERT needs to be used to
|
||||
# retrieve the output when OPENROWSET is used hence the redirection
|
||||
# to a temporary file from above
|
||||
if insertIntoTable and not conf.dCred:
|
||||
if insertIntoTable and not conf.dbmsCred:
|
||||
self.__forgedCmd += "INSERT INTO %s " % insertIntoTable
|
||||
|
||||
self.__forgedCmd += "EXEC %s @%s" % (self.xpCmdshellStr, self.__randStr)
|
||||
|
|
@ -203,7 +203,7 @@ class xp_cmdshell:
|
|||
# command standard output is redirected to a temporary file
|
||||
# The file needs to be copied to the support table,
|
||||
# 'sqlmapoutput'
|
||||
if conf.dCred:
|
||||
if conf.dbmsCred:
|
||||
inject.goStacked("BULK INSERT %s FROM '%s' WITH (CODEPAGE='RAW', FIELDTERMINATOR='%s', ROWTERMINATOR='%s')" % (self.cmdTblName, self.tmpFile, randomStr(10), randomStr(10)))
|
||||
self.delRemoteFile(self.tmpFile)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue