From 4d48ac54dce5ca12b0d2326673b1f658f3ff64c4 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 19 Apr 2011 08:34:21 +0000 Subject: [PATCH] automatically increasing default --time-sec value when --tor/--proxy used (not touching anything if explicit --time-sec set) --- lib/core/option.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 9c5b4edf1..0c708e13a 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1203,10 +1203,19 @@ def __cleanupOptions(): if conf.data: conf.data = urldecode(conf.data) - # to distinguish explicit usafe of --time-sec + # to distinguish explicit usage of --time-sec if conf.timeSec is None: - conf.timeSec = TIME_DEFAULT_DELAY - kb.adjustTimeDelay = True + if conf.tor or conf.proxy: + conf.timeSec = 2 * TIME_DEFAULT_DELAY + kb.adjustTimeDelay = False + + warnMsg = "increasing default value for " + warnMsg += " --time-sec to %d because " % conf.timeSec + warnMsg += "%s switch used" % ("--tor" if conf.tor else "--proxy") + logger.warn(warnMsg) + else: + conf.timeSec = TIME_DEFAULT_DELAY + kb.adjustTimeDelay = True else: kb.adjustTimeDelay = False @@ -1543,6 +1552,10 @@ def __basicOptionValidation(): errMsg = "switch --forms requires usage of -u (--url) switch" raise sqlmapSyntaxException, errMsg + if conf.tor and conf.ignoreProxy: + errMsg = "switch --tor is incompatible with switch --ignore-proxy" + raise sqlmapSyntaxException, errMsg + if conf.proxy and conf.ignoreProxy: errMsg = "switch --proxy is incompatible with switch --ignore-proxy" raise sqlmapSyntaxException, errMsg