adding redirect response to the traffic file

This commit is contained in:
Miroslav Stampar 2011-09-28 08:13:46 +00:00
parent 6d2536f217
commit dd0ed5f5da
3 changed files with 7 additions and 4 deletions

View File

@ -39,6 +39,7 @@ class _ThreadData(threading.local):
self.lastHTTPError = None self.lastHTTPError = None
self.lastRedirectMsg = None self.lastRedirectMsg = None
self.lastQueryDuration = 0 self.lastQueryDuration = 0
self.lastRequestMsg = None
self.lastRequestUID = 0 self.lastRequestUID = 0
self.retriesCount = 0 self.retriesCount = 0
self.seqMatcher = difflib.SequenceMatcher(None) self.seqMatcher = difflib.SequenceMatcher(None)

View File

@ -277,6 +277,8 @@ class Connect:
requestMsg += "\n" requestMsg += "\n"
threadData.lastRequestMsg = requestMsg
logger.log(8, requestMsg) logger.log(8, requestMsg)
conn = urllib2.urlopen(req) conn = urllib2.urlopen(req)

View File

@ -13,6 +13,7 @@ import urlparse
from lib.core.data import conf from lib.core.data import conf
from lib.core.data import logger from lib.core.data import logger
from lib.core.common import getUnicode from lib.core.common import getUnicode
from lib.core.common import logHTTPTraffic
from lib.core.enums import HTTPHEADER from lib.core.enums import HTTPHEADER
from lib.core.exception import sqlmapConnectionException from lib.core.exception import sqlmapConnectionException
from lib.core.threads import getCurrentThreadData from lib.core.threads import getCurrentThreadData
@ -41,10 +42,9 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
else: else:
logHeaders = "" logHeaders = ""
if conf.verbose <= 5: logHTTPTraffic(threadData.lastRequestMsg, "%s%s" % (responseMsg, logHeaders))
responseMsg += getUnicode(logHeaders)
elif conf.verbose > 5: responseMsg += getUnicode(logHeaders)
responseMsg += "%s\n\n%s\n" % (logHeaders, content)
logger.log(7, responseMsg) logger.log(7, responseMsg)