diff --git a/lib/core/option.py b/lib/core/option.py index a498c7ab1..4d12b49ec 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1555,7 +1555,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.lastParserStatus = None kb.locks = AttribDict() - for _ in ("cache", "count", "index", "io", "limit", "log", "request", "value"): + for _ in ("cache", "count", "index", "io", "limit", "log", "redirect", "request", "value"): kb.locks[_] = threading.Lock() kb.matchRatio = None diff --git a/lib/request/redirecthandler.py b/lib/request/redirecthandler.py index 8988e6588..b8e96d2d4 100644 --- a/lib/request/redirecthandler.py +++ b/lib/request/redirecthandler.py @@ -38,12 +38,13 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler): return retVal def _ask_redirect_choice(self, redcode, redurl): - if kb.redirectChoice is None: - msg = "sqlmap got a %d redirect to " % redcode - msg += "'%s'. Do you want to follow? [Y/n] " % redurl - choice = readInput(msg, default="Y") + with kb.locks.redirect: + if kb.redirectChoice is None: + msg = "sqlmap got a %d redirect to " % redcode + msg += "'%s'. Do you want to follow? [Y/n] " % redurl + choice = readInput(msg, default="Y") - kb.redirectChoice = choice.upper() + kb.redirectChoice = choice.upper() def http_error_302(self, req, fp, code, msg, headers): content = None