From f5cff067c6285986e3840fd67ebc53438769afac Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 18 Apr 2011 14:46:18 +0000 Subject: [PATCH] little hack for --time-sec --- lib/core/option.py | 6 +++++- lib/core/settings.py | 4 ++-- lib/parse/cmdline.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index d83b05eca..b0005901e 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1203,7 +1203,11 @@ def __cleanupOptions(): if conf.data: conf.data = urldecode(conf.data) - kb.adjustTimeDelay = (conf.timeSec == TIME_DEFAULT_DELAY) + if conf.timeSec == TIME_DEFAULT_DELAY: + conf.timeSec = int(conf.timeSec) + kb.adjustTimeDelay = True + else: + kb.adjustTimeDelay = False def __setConfAttributes(): """ diff --git a/lib/core/settings.py b/lib/core/settings.py index 409e5d11f..31001c716 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -75,8 +75,8 @@ UNION_STDEV_COEFF = 7 # length of queue for candidates for time delay adjustment TIME_DELAY_CANDIDATES = 3 -# default time delay in seconds -TIME_DEFAULT_DELAY = 5 +# default time delay in seconds (decimal places added to distinguish explicit usage of --time-sec) +TIME_DEFAULT_DELAY = 5.0001 # HTTP timeout in silent mode HTTP_SILENT_TIMEOUT = 3 diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 9582d75a9..28bb354f9 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -214,7 +214,7 @@ def cmdLineParser(): techniques.add_option("--time-sec", dest="timeSec", type="int", default=TIME_DEFAULT_DELAY, help="Seconds to delay the DBMS response " - "(default 5)") + "(default %s)" % int(TIME_DEFAULT_DELAY)) techniques.add_option("--union-cols", dest="uCols", help="Range of columns to test for UNION query SQL injection")