From b0bc3149f9ebe0a5c29c4e9d3bc750fd6915f023 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 26 Jul 2015 16:18:41 +0200 Subject: [PATCH] Fixes #1315 --- lib/core/option.py | 8 ++++++++ lib/request/connect.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index b73152469..01976e742 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1685,6 +1685,13 @@ def _cleanupOptions(): threadData = getCurrentThreadData() threadData.reset() +def _dirtyPatches(): + """ + Place for "dirty" Python related patches + """ + + httplib._MAXLINE = 1 * 1024 * 1024 # to accept overly long result lines (e.g. SQLi results in HTTP header responses) + def _purgeOutput(): """ Safely removes (purges) output directory. @@ -2469,6 +2476,7 @@ def init(): _saveCmdline() _setRequestFromFile() _cleanupOptions() + _dirtyPatches() _purgeOutput() _checkDependencies() _createTemporaryDirectory() diff --git a/lib/request/connect.py b/lib/request/connect.py index e1d4fc6b6..8914e6cb0 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -575,7 +575,7 @@ class Connect(object): debugMsg = "got HTTP error code: %d (%s)" % (code, status) logger.debug(debugMsg) - except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead, httplib.ResponseNotReady, httplib.UnknownProtocol, struct.error, ProxyError, SqlmapCompressionException, WebSocketException), e: + except (urllib2.URLError, socket.error, socket.timeout, httplib.HTTPException, struct.error, ProxyError, SqlmapCompressionException, WebSocketException), e: tbMsg = traceback.format_exc() if "no host given" in tbMsg: