From 4ce74764b789b34ae2cf913b551a2466192ddb5a Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 23 Apr 2009 20:39:32 +0000 Subject: [PATCH] More verbose when reporting failure to create shellcode/payload stager (via Metasploit) --- lib/core/agent.py | 4 ---- lib/takeover/metasploit.py | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 67c1d4c56..6453fcfb7 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -284,10 +284,6 @@ class Agent: fieldsToCastList = fieldsToCastStr.replace(", ", ",") fieldsToCastList = fieldsToCastList.split(",") - # TODO: really needed?! - #if query.startswith("SELECT ") and "(SELECT " in query: - # fieldsSelectFrom = None - return fieldsSelectFrom, fieldsSelect, fieldsNoSelect, fieldsSelectTop, fieldsSelectCase, fieldsToCastList, fieldsToCastStr diff --git a/lib/takeover/metasploit.py b/lib/takeover/metasploit.py index 2afbf47ea..9039081f9 100644 --- a/lib/takeover/metasploit.py +++ b/lib/takeover/metasploit.py @@ -539,7 +539,8 @@ class Metasploit: debugMsg = "the shellcode size is %s bytes" % payloadSize logger.debug(debugMsg) else: - raise sqlmapFilePathException, "failed to create the shellcode" + errMsg = "failed to create the shellcode (%s)" % payloadStderr + raise sqlmapFilePathException, errMsg self.__shellcodeFileP = open(self.__shellcodeFilePath, "rb") self.__shellcodeString = self.__shellcodeFileP.read() @@ -612,7 +613,8 @@ class Metasploit: logger.debug(debugMsg) else: - raise sqlmapFilePathException, "failed to create the payload stager" + errMsg = "failed to create the payload stager (%s)" % payloadStderr + raise sqlmapFilePathException, errMsg def uploadMsfPayloadStager(self):