From 8a8b94883b810439f8a8b4dfe329fdb747fe4955 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 27 Jun 2011 14:14:49 +0000 Subject: [PATCH] minor update (that default quit in --batch was bothering me - my original idea and it was bad :) --- lib/controller/checks.py | 21 +++++++++------------ lib/core/common.py | 4 ++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 363b91523..9ba31eb2f 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -484,20 +484,17 @@ def checkSqlInjection(place, parameter, value): warnMsg = "user aborted during detection phase" logger.warn(warnMsg) - if not conf.batch: - message = "How do you want to proceed? [(S)kip current test/(e)nd detection phase/(n)ext parameter/(q)uit]" - choice = readInput(message, default="S") + message = "How do you want to proceed? [(S)kip current test/(e)nd detection phase/(n)ext parameter/(q)uit]" + choice = readInput(message, default="S", checkBatch=False) - if choice[0] in ("s", "S"): - pass - elif choice[0] in ("n", "N"): - return None - elif choice[0] in ("e", "E"): - kb.endDetection = True - elif choice[0] in ("q", "Q"): - raise sqlmapUserQuitException - else: + if choice[0] in ("s", "S"): + pass + elif choice[0] in ("n", "N"): + return None + elif choice[0] in ("e", "E"): kb.endDetection = True + elif choice[0] in ("q", "Q"): + raise sqlmapUserQuitException finally: # Reset forced back-end DBMS value diff --git a/lib/core/common.py b/lib/core/common.py index ee61bc9a8..c47739a72 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -742,7 +742,7 @@ def strToHex(inpStr): return hexStr -def readInput(message, default=None): +def readInput(message, default=None, checkBatch=True): """ @param message: message to display on terminal. @type message: C{str} @@ -758,7 +758,7 @@ def readInput(message, default=None): message = "\r%s" % message - if conf.batch: + if checkBatch and conf.batch: if isinstance(default, (list, tuple, set)): options = ",".join([getUnicode(opt, UNICODE_ENCODING) for opt in default]) elif default: