mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-22 19:04:30 +03:00
few more fixes for proper redirecting mechanism
This commit is contained in:
parent
48e8c978fb
commit
7d313ac911
|
@ -665,6 +665,9 @@ def checkDynParam(place, parameter, value):
|
||||||
dynamicity might depend on another parameter.
|
dynamicity might depend on another parameter.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if kb.redirectChoice:
|
||||||
|
return None
|
||||||
|
|
||||||
kb.matchRatio = None
|
kb.matchRatio = None
|
||||||
dynResult = None
|
dynResult = None
|
||||||
randInt = randomInt()
|
randInt = randomInt()
|
||||||
|
@ -746,6 +749,9 @@ def checkStability():
|
||||||
like for instance string matching (--string).
|
like for instance string matching (--string).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if kb.redirectChoice:
|
||||||
|
return None
|
||||||
|
|
||||||
infoMsg = "testing if the url is stable, wait a few seconds"
|
infoMsg = "testing if the url is stable, wait a few seconds"
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
def _ask_redirect_choice(self, redcode, redurl):
|
def _ask_redirect_choice(self, redcode, redurl):
|
||||||
if kb.redirectChoice is None:
|
if kb.redirectChoice is None and kb.originalPage:
|
||||||
msg = "sqlmap got a %d redirect to " % redcode
|
msg = "sqlmap got a %d redirect to " % redcode
|
||||||
msg += "'%s'. What do you want to do? " % redurl
|
msg += "'%s'. What do you want to do? " % redurl
|
||||||
msg += "\n[1] Follow the redirection (default)"
|
msg += "\n[1] Follow the redirection (default)"
|
||||||
|
@ -93,7 +93,7 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
||||||
dbgMsg += "redirect response content (%s)" % msg
|
dbgMsg += "redirect response content (%s)" % msg
|
||||||
logger.debug(dbgMsg)
|
logger.debug(dbgMsg)
|
||||||
|
|
||||||
if kb.redirectChoice == REDIRECTION.FOLLOW:
|
if kb.redirectChoice == REDIRECTION.FOLLOW or kb.originalPage is None:
|
||||||
req.headers[HTTPHEADER.HOST] = getHostHeader(redurl)
|
req.headers[HTTPHEADER.HOST] = getHostHeader(redurl)
|
||||||
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user