From 5b0d5970cc4578ae0eda5519d24a1e4ab37d0a3f Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 23 Mar 2016 10:33:32 +0100 Subject: [PATCH] Another patch related to the #1773 --- lib/core/option.py | 1 + lib/core/settings.py | 2 +- plugins/generic/entries.py | 3 +++ sqlmap.py | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index ad3b590ff..935bbee8d 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1821,6 +1821,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.dnsTest = None kb.docRoot = None kb.dumpTable = None + kb.dumpKeyboardInterrupt = False kb.dynamicMarkings = [] kb.dynamicParameter = False kb.endDetection = False diff --git a/lib/core/settings.py b/lib/core/settings.py index 36ee4ff0e..8aaaef5df 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.3.6" +VERSION = "1.0.3.7" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") diff --git a/plugins/generic/entries.py b/plugins/generic/entries.py index 51f793bf4..ddf9996a4 100644 --- a/plugins/generic/entries.py +++ b/plugins/generic/entries.py @@ -173,6 +173,7 @@ class Entries: retVal = pivotDumpTable(table, colList, blind=False) except KeyboardInterrupt: retVal = None + kb.dumpKeyboardInterrupt = True clearConsoleLine() warnMsg = "Ctrl+C detected in dumping phase" logger.warn(warnMsg) @@ -279,6 +280,7 @@ class Entries: retVal = pivotDumpTable(table, colList, count, blind=True) except KeyboardInterrupt: retVal = None + kb.dumpKeyboardInterrupt = True clearConsoleLine() warnMsg = "Ctrl+C detected in dumping phase" logger.warn(warnMsg) @@ -332,6 +334,7 @@ class Entries: entries[column].append(value) except KeyboardInterrupt: + kb.dumpKeyboardInterrupt = True clearConsoleLine() warnMsg = "Ctrl+C detected in dumping phase" logger.warn(warnMsg) diff --git a/sqlmap.py b/sqlmap.py index 82aa64dfe..ea3757c74 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -192,6 +192,9 @@ def main(): logger.error(errMsg) raise SystemExit + elif "valueStack.pop" in excMsg and kb.get("dumpKeyboardInterrupt"): + raise SystemExit + for match in re.finditer(r'File "(.+?)", line', excMsg): file_ = match.group(1) file_ = os.path.relpath(file_, os.path.dirname(__file__))