From 1c633b73511a9432a73681445e079fddd1061e64 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 7 Jun 2011 22:14:18 +0000 Subject: [PATCH] i am tired of pressing hundred times Ctrl+C in testing phase if --batch is specified --- lib/controller/checks.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index f91a41f7d..eaddbe791 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -481,16 +481,19 @@ def checkSqlInjection(place, parameter, value): warnMsg = "user aborted during detection phase" logger.warn(warnMsg) - 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") + 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") - if not choice or 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"): + 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: raise sqlmapUserQuitException finally: