From a0b67418c7e9e0831ea073d6bc79c51fbd6733ad Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 11 Jan 2016 00:34:03 +0100 Subject: [PATCH] Just in case update --- lib/core/option.py | 4 +++- lib/request/connect.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index aa2b7869d..a412f20d1 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1028,7 +1028,7 @@ def _setSocketPreConnect(): return def _(): - while kb.threadContinue: + while kb.threadContinue and not conf.disablePrecon: try: for key in socket._ready: if len(socket._ready[key]) < SOCKET_PRE_CONNECT_QUEUE_SIZE: @@ -1046,6 +1046,7 @@ def _setSocketPreConnect(): def connect(self, address): found = False + key = (self.family, self.type, self.proto, address) with kb.locks.socket: if key not in socket._ready: @@ -1053,6 +1054,7 @@ def _setSocketPreConnect(): if len(socket._ready[key]) > 0: self._sock = socket._ready[key].pop(0) found = True + if not found: self._connect(address) diff --git a/lib/request/connect.py b/lib/request/connect.py index d7305637b..a3862298b 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -614,6 +614,9 @@ class Connect(object): elif "forcibly closed" in tbMsg or "Connection is already closed" in tbMsg: warnMsg = "connection was forcibly closed by the target URL" elif "timed out" in tbMsg: + singleTimeWarnMessage("turning off pre-connect mechanism because of connection time out(s)") + conf.disablePrecon = True + if kb.testMode and kb.testType not in (None, PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED): singleTimeWarnMessage("there is a possibility that the target (or WAF) is dropping 'suspicious' requests") warnMsg = "connection timed out to the target URL"