mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-26 11:33:47 +03:00
Merge branch 'master' of github.com:sqlmapproject/sqlmap
This commit is contained in:
commit
b231e52980
|
@ -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
|
||||||
|
|
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user