From a0df231aa478f3ea1c5e458decde0ad816478771 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 29 Oct 2010 13:09:53 +0000 Subject: [PATCH] Avoid waiting 30 seconds when cleaning up the dbms and file system from sqlmap data --- lib/takeover/abstraction.py | 2 +- plugins/generic/misc.py | 10 +++++----- plugins/generic/takeover.py | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/takeover/abstraction.py b/lib/takeover/abstraction.py index 47ccaebcd..f432b6e3f 100644 --- a/lib/takeover/abstraction.py +++ b/lib/takeover/abstraction.py @@ -40,7 +40,7 @@ class Abstraction(Web, UDF, xp_cmdshell): self.udfExecCmd(cmd, silent=silent) elif kb.dbms == "Microsoft SQL Server": - self.xpCmdshellExecCmd(cmd, silent) + self.xpCmdshellExecCmd(cmd, silent=silent) else: errMsg = "Feature not yet implemented for the back-end DBMS" diff --git a/plugins/generic/misc.py b/plugins/generic/misc.py index 629930b30..893abd4f9 100644 --- a/plugins/generic/misc.py +++ b/plugins/generic/misc.py @@ -84,10 +84,10 @@ class Miscellaneous: else: cmd = "rm -f %s" % tempFile - self.execCmd(cmd) + self.execCmd(cmd, silent=True) def createSupportTbl(self, tblName, tblField, tblType): - inject.goStacked("DROP TABLE %s" % tblName) + inject.goStacked("DROP TABLE %s" % tblName, silent=True) inject.goStacked("CREATE TABLE %s(%s %s)" % (tblName, tblField, tblType)) def cleanup(self, onlyFileTbl=False, udfDict=None): @@ -115,10 +115,10 @@ class Miscellaneous: logger.info("cleaning up the database management system") logger.debug("removing support tables") - inject.goStacked("DROP TABLE %s" % self.fileTblName) + inject.goStacked("DROP TABLE %s" % self.fileTblName, silent=True) if not onlyFileTbl: - inject.goStacked("DROP TABLE %s" % self.cmdTblName) + inject.goStacked("DROP TABLE %s" % self.cmdTblName, silent=True) if kb.dbms == "Microsoft SQL Server": return @@ -138,7 +138,7 @@ class Miscellaneous: dropStr += "(%s)" % inp logger.debug("removing UDF '%s'" % udf) - inject.goStacked(dropStr) + inject.goStacked(dropStr, silent=True) logger.info("database management system cleanup finished") diff --git a/plugins/generic/takeover.py b/plugins/generic/takeover.py index 15c78b925..f7c6bcedf 100644 --- a/plugins/generic/takeover.py +++ b/plugins/generic/takeover.py @@ -153,7 +153,8 @@ class Takeover(Abstraction, Metasploit, ICMPsh, Registry, Miscellaneous): errMsg += "is unlikely to receive commands send from you" logger.error(errMsg) - self.sysUdfs.pop("sys_bineval") + if kb.dbms in ( "MySQL", "PostgreSQL" ): + self.sysUdfs.pop("sys_bineval") if kb.stackedTest or conf.direct: web = False