Merge branch 'master' of github.com:sqlmapproject/sqlmap

This commit is contained in:
Bernardo Damele 2013-01-17 21:58:23 +00:00
commit b231e52980
2 changed files with 11 additions and 8 deletions

View File

@ -1597,6 +1597,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
kb.reflectiveMechanism = True kb.reflectiveMechanism = True
kb.reflectiveCounters = {REFLECTIVE_COUNTER.MISS: 0, REFLECTIVE_COUNTER.HIT: 0} kb.reflectiveCounters = {REFLECTIVE_COUNTER.MISS: 0, REFLECTIVE_COUNTER.HIT: 0}
kb.requestCounter = 0 kb.requestCounter = 0
kb.resendPostOnRedirect = None
kb.responseTimes = [] kb.responseTimes = []
kb.resumeValues = True kb.resumeValues = True
kb.safeCharEncode = False kb.safeCharEncode = False

View File

@ -47,15 +47,17 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
kb.redirectChoice = choice.upper() kb.redirectChoice = choice.upper()
if kb.redirectChoice == REDIRECTION.YES and method == HTTPMETHOD.POST: if kb.redirectChoice == REDIRECTION.YES and method == HTTPMETHOD.POST and kb.resendPostOnRedirect is None:
msg = "redirect is a result of a " msg = "redirect is a result of a "
msg += "POST request. Do you want to " msg += "POST request. Do you want to "
msg += "resend original POST data to a new " msg += "resend original POST data to a new "
msg += "location? [%s] " % ("Y/n" if not kb.originalPage else "y/N") msg += "location? [%s] " % ("Y/n" if not kb.originalPage else "y/N")
choice = readInput(msg, default=("Y" if not kb.originalPage else "N")) choice = readInput(msg, default=("Y" if not kb.originalPage else "N"))
if choice.upper() == 'Y': kb.resendPostOnRedirect = choice.upper() == 'Y'
self.redirect_request = self._redirect_request
if kb.resendPostOnRedirect:
self.redirect_request = self._redirect_request
def _redirect_request(self, req, fp, code, msg, headers, newurl): def _redirect_request(self, req, fp, code, msg, headers, newurl):
newurl = newurl.replace(' ', '%20') newurl = newurl.replace(' ', '%20')