Minor bug fix to properly delete sqlmap temporary files on the database server file system at shutdown.

Minor improvements at ICMPsh tunnel to cleanup properly the dbms at shutdown and avoid checking/writing sys_bineval() UDF as it's a PE and needs to be called by sys_exec() only.
Got rid of useless doubleslash param in delRemoteFile() method.
Major code refactoring to xp_cmdshell.py methods and parent calls.
This commit is contained in:
Bernardo Damele
2010-10-28 00:19:40 +00:00
parent 56c16cb471
commit 4f8e9da1b6
10 changed files with 47 additions and 89 deletions

View File

@@ -75,20 +75,16 @@ class Miscellaneous:
kb.bannerFp["dbmsVersion"] = inject.getValue(query, unpack=False)
kb.bannerFp["dbmsVersion"] = kb.bannerFp["dbmsVersion"].replace(",", "").replace("-", "").replace(" ", "")
def delRemoteFile(self, tempFile, doubleslash=False):
def delRemoteFile(self, tempFile):
self.checkDbmsOs()
if kb.os == "Windows":
if doubleslash:
tempFile = tempFile.replace("/", "\\\\")
else:
tempFile = posixToNtSlashes(tempFile)
tempFile = posixToNtSlashes(tempFile)
cmd = "del /F /Q %s" % tempFile
else:
cmd = "rm -f %s" % tempFile
self.execCmd(cmd, forgeCmd=True)
self.execCmd(cmd)
def createSupportTbl(self, tblName, tblField, tblType):
inject.goStacked("DROP TABLE %s" % tblName)