From b4fd71e8b9cdad500cf476b2e4469113c2dae76f Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Mon, 20 Jul 2009 14:36:33 +0000 Subject: [PATCH] Minor adjustment to reflect Metasploit r6849 (http://trac.metasploit.com/changeset/6849) and minor code refactoring. --- lib/core/common.py | 8 +++++--- lib/core/settings.py | 2 +- lib/takeover/upx.py | 18 ++++++++++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index d2838ff5a..ac96d2f40 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -781,11 +781,13 @@ def pollProcess(process): returncode = process.poll() - if returncode != None: + if returncode is not None: if returncode == 0: dataToStdout(" done\n") - else: - dataToStdout(" quit unexpectedly by signal %d\n" % returncode) + elif returncode < 0: + dataToStdout(" process terminated by signal %d\n" % returncode) + elif returncode > 0: + dataToStdout(" quit unexpectedly with return code %d\n" % returncode) break diff --git a/lib/core/settings.py b/lib/core/settings.py index 596982c94..8e42b1fe5 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -30,7 +30,7 @@ import sys # sqlmap version and site -VERSION = "0.7rc4" +VERSION = "0.7rc5" VERSION_STRING = "sqlmap/%s" % VERSION SITE = "http://sqlmap.sourceforge.net" diff --git a/lib/takeover/upx.py b/lib/takeover/upx.py index b2547179b..1320c3fee 100644 --- a/lib/takeover/upx.py +++ b/lib/takeover/upx.py @@ -78,15 +78,25 @@ class UPX: dataToStdout("\r[%s] [INFO] compression in progress " % time.strftime("%X")) pollProcess(process) - upxStderr = process.communicate()[1] + upxStdout, upxStderr = process.communicate() - if upxStderr: - logger.warn("failed to compress the file") + warnMsg = "failed to compress the file" + + if "NotCompressibleException" in upxStdout: + warnMsg += " because you provided a Metasploit version above " + warnMsg += "3.3-dev revision 6681. This will not inficiate " + warnMsg += "the correct execution of sqlmap. It might " + warnMsg += "only slow down a bit the execution of sqlmap" + logger.info(warnMsg) + + elif upxStderr: + logger.warn(warnMsg) - return None else: return os.path.getsize(srcFile) + return None + def unpack(self, srcFile, dstFile=None): pass