From a58b34eba885f8d50d6708b5a90f5f1df560bc34 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Mon, 30 Mar 2015 16:08:49 +0100 Subject: [PATCH] Updates request timeout values to realistic ones (and in seconds) --- example.conf.json | 4 ++-- lib/common/browser.rb | 6 ++---- spec/lib/common/browser_spec.rb | 2 +- spec/samples/conf/browser.conf.json | 4 ++-- spec/samples/conf/browser.conf_proxy.json | 4 ++-- spec/samples/conf/browser.conf_proxy_auth.json | 4 ++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/example.conf.json b/example.conf.json index 31d99dec..eafb977e 100644 --- a/example.conf.json +++ b/example.conf.json @@ -10,9 +10,9 @@ "cache_ttl": 600, // 10 minutes, at this time the cache is cleaned before each scan. If this value is set to 0, the cache will be disabled - "request_timeout": 2000, // 2s + "request_timeout": 4, // 4s - "connect_timeout": 1000, // 1s + "connect_timeout": 2, // 2s "max_threads": 20 } diff --git a/lib/common/browser.rb b/lib/common/browser.rb index f1cddb4f..1bdd2f6f 100644 --- a/lib/common/browser.rb +++ b/lib/common/browser.rb @@ -73,10 +73,8 @@ class Browser @max_threads = 20 # 10 minutes, at this time the cache is cleaned before each scan. If this value is set to 0, the cache will be disabled @cache_ttl = 600 - # 2s - @request_timeout = 2000 - # 1s - @connect_timeout = 1000 + @request_timeout = 4 # 4s + @connect_timeout = 2 # 2s @user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)" end diff --git a/spec/lib/common/browser_spec.rb b/spec/lib/common/browser_spec.rb index 8ae81d0d..beb0b019 100644 --- a/spec/lib/common/browser_spec.rb +++ b/spec/lib/common/browser_spec.rb @@ -130,7 +130,7 @@ describe Browser do headers: { 'User-Agent' => 'SomeUA' }, ssl_verifypeer: false, ssl_verifyhost: 0, cookiejar: cookie_jar, cookiefile: cookie_jar, - timeout: 2000, connecttimeout: 1000, + timeout: 4, connecttimeout: 2, maxredirs: 3, referer: nil } diff --git a/spec/samples/conf/browser.conf.json b/spec/samples/conf/browser.conf.json index 5b691431..3a7bd76c 100644 --- a/spec/samples/conf/browser.conf.json +++ b/spec/samples/conf/browser.conf.json @@ -1,7 +1,7 @@ { "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0", "cache_ttl": 600, - "request_timeout": 2000, - "connect_timeout": 1000, + "request_timeout": 4, + "connect_timeout": 2, "max_threads": 20 } diff --git a/spec/samples/conf/browser.conf_proxy.json b/spec/samples/conf/browser.conf_proxy.json index dfbe4898..6ebc0388 100644 --- a/spec/samples/conf/browser.conf_proxy.json +++ b/spec/samples/conf/browser.conf_proxy.json @@ -2,6 +2,6 @@ "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/11.0", "proxy": "127.0.0.1:3038", "cache_ttl": 300, - "request_timeout": 2000, - "connect_timeout": 1000 + "request_timeout": 4, + "connect_timeout": 2 } diff --git a/spec/samples/conf/browser.conf_proxy_auth.json b/spec/samples/conf/browser.conf_proxy_auth.json index 9282e256..4d9f52f5 100644 --- a/spec/samples/conf/browser.conf_proxy_auth.json +++ b/spec/samples/conf/browser.conf_proxy_auth.json @@ -3,6 +3,6 @@ "proxy": "127.0.0.1:3038", "proxy_auth": "user:pass", "cache_ttl": 300, - "request_timeout": 2000, - "connect_timeout": 1000 + "request_timeout": 4, + "connect_timeout": 2 }