diff --git a/lib/core/threads.py b/lib/core/threads.py index 5e2c058d1..6c51f5daf 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -39,6 +39,7 @@ class _ThreadData(threading.local): self.lastHTTPError = None self.lastRedirectMsg = None self.lastQueryDuration = 0 + self.lastRequestMsg = None self.lastRequestUID = 0 self.retriesCount = 0 self.seqMatcher = difflib.SequenceMatcher(None) diff --git a/lib/request/connect.py b/lib/request/connect.py index bff3bef72..1773acd46 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -277,6 +277,8 @@ class Connect: requestMsg += "\n" + threadData.lastRequestMsg = requestMsg + logger.log(8, requestMsg) conn = urllib2.urlopen(req) diff --git a/lib/request/redirecthandler.py b/lib/request/redirecthandler.py index 458f598ad..3d95f8f96 100644 --- a/lib/request/redirecthandler.py +++ b/lib/request/redirecthandler.py @@ -13,6 +13,7 @@ import urlparse from lib.core.data import conf from lib.core.data import logger from lib.core.common import getUnicode +from lib.core.common import logHTTPTraffic from lib.core.enums import HTTPHEADER from lib.core.exception import sqlmapConnectionException from lib.core.threads import getCurrentThreadData @@ -41,10 +42,9 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler): else: logHeaders = "" - if conf.verbose <= 5: - responseMsg += getUnicode(logHeaders) - elif conf.verbose > 5: - responseMsg += "%s\n\n%s\n" % (logHeaders, content) + logHTTPTraffic(threadData.lastRequestMsg, "%s%s" % (responseMsg, logHeaders)) + + responseMsg += getUnicode(logHeaders) logger.log(7, responseMsg)