From 4687383a4407ed585398283b89fa49f6e59a0b92 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 14 Oct 2020 12:22:56 +0200 Subject: [PATCH] Patch for multiple-Ctrl-C in multiple-target mode --- lib/controller/controller.py | 6 ++++++ lib/core/option.py | 2 +- lib/core/settings.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 4fe4e2d71..e89f941de 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -704,6 +704,12 @@ def start(): action() except KeyboardInterrupt: + if kb.lastCtrlCTime and (time.time() - kb.lastCtrlCTime < 1): + kb.multipleCtrlC = True + raise SqlmapUserQuitException("user aborted (Ctrl+C was pressed multiple times)") + + kb.lastCtrlCTime = time.time() + if conf.multipleTargets: warnMsg = "user aborted in multiple target mode" logger.warn(warnMsg) diff --git a/lib/core/option.py b/lib/core/option.py index 147c5138d..cb479027d 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -2040,7 +2040,6 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.injections = [] kb.laggingChecked = False kb.lastParserStatus = None - kb.lastCtrlCTime = None kb.locks = AttribDict() for _ in ("cache", "connError", "count", "handlers", "hint", "index", "io", "limit", "log", "socket", "redirect", "request", "value"): @@ -2129,6 +2128,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.checkSitemap = None kb.headerPaths = {} kb.keywords = set(getFileItems(paths.SQL_KEYWORDS)) + kb.lastCtrlCTime = None kb.normalizeCrawlingChoice = None kb.passwordMgr = None kb.postprocessFunctions = [] diff --git a/lib/core/settings.py b/lib/core/settings.py index e3a055482..ff98ff7ed 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.4.10.7" +VERSION = "1.4.10.8" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)