diff --git a/lib/controller/checks.py b/lib/controller/checks.py index cd1aa6c7f..cc1695bb2 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -78,11 +78,6 @@ def checkSqlInjection(place, parameter, value): kb.testMode = True for test in conf.tests: - # Check if there were any premature detection cancellation request - # from the user (Ctrl+C) - if not kb.testMode: - break - try: title = test.title stype = test.stype @@ -416,7 +411,7 @@ def checkSqlInjection(place, parameter, value): elif test[0] in ("n", "N"): break elif test[0] in ("e", "E"): - kb.testMode = False + kb.endDetection = True break elif test[0] in ("q", "Q"): raise sqlmapUserQuitException diff --git a/lib/controller/controller.py b/lib/controller/controller.py index fff84487f..d2308f3f8 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -351,6 +351,12 @@ def start(): injection = checkSqlInjection(place, parameter, value) + proceed = not kb.endDetection + + # In case when user wants to end detection phase (Ctrl+C) + if not proceed: + break + if injection is not None and injection.place is not None: kb.injections.append(injection) diff --git a/lib/core/option.py b/lib/core/option.py index e4e19c72b..d6b33b6f2 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1158,6 +1158,7 @@ def __setKnowledgeBaseAttributes(flushAll=True): kb.dep = None kb.docRoot = None kb.dynamicMarkings = [] + kb.endDetection = False kb.formNames = [] kb.headersCount = 0 kb.headersFp = {}