From 07129371bfbda57d3487220a61c8cde6df62ced9 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 3 Jan 2011 13:04:20 +0000 Subject: [PATCH] bug fix for time based injections with keepalive (keepalive module has timeout argument which screwed tbMsg); also, bug fix for cases when remote hosts forcefully disconnects the user on some tests (instead of retrying and critically going out, continue with further tests) --- lib/request/connect.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index 2a4fc1afc..12f9e2b9c 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -298,10 +298,12 @@ class Connect: if "no host given" in tbMsg: warnMsg = "invalid url address used (%s)" % repr(url) raise sqlmapSyntaxException, warnMsg + elif "forcibly closed" in tbMsg: + warnMsg = "connection was forcibly closed by the target url" + elif "timed out" in tbMsg: + warnMsg = "connection timed out to the target url" elif "URLError" in tbMsg or "error" in tbMsg: warnMsg = "unable to connect to the target url" - elif "timeout" in tbMsg: - warnMsg = "connection timed out to the target url" elif "BadStatusLine" in tbMsg: warnMsg = "the target url responded with an unknown HTTP " warnMsg += "status code, try to force the HTTP User-Agent " @@ -315,7 +317,10 @@ class Connect: if "BadStatusLine" not in tbMsg: warnMsg += " or proxy" - if silent or (ignoreTimeout and "timeout" in tbMsg): + if "forcibly closed" in tbMsg: + logger.critical(warnMsg) + return None, None + elif silent or (ignoreTimeout and "timed out" in tbMsg): return None, None elif kb.retriesCount < conf.retries and not kb.threadException and not conf.realTest: kb.retriesCount += 1