@@ -40,13 +40,10 @@ def _get_header_redirect(self, headers):
4040 def _ask_redirect_choice (self , redcode , redurl ):
4141 if kb .redirectChoice is None and kb .originalPage :
4242 msg = "sqlmap got a %d redirect to " % redcode
43- msg += "'%s'. What do you want to do? " % redurl
44- msg += "\n [1] Follow the redirection (default)"
45- msg += "\n [2] Stay on the original page"
46- msg += "\n [3] Ignore"
47- choice = readInput (msg , default = "1" )
43+ msg += "'%s'. Do you want to follow? [Y/n] " % redurl
44+ choice = readInput (msg , default = "Y" )
4845
49- kb .redirectChoice = choice
46+ kb .redirectChoice = choice . upper ()
5047
5148 def _process_http_redirect (self , result , headers , code , content , msg , redurl ):
5249 content = decodePage (content , headers .get (HTTPHEADER .CONTENT_ENCODING ), headers .get (HTTPHEADER .CONTENT_TYPE ))
@@ -93,7 +90,7 @@ def http_error_302(self, req, fp, code, msg, headers):
9390 dbgMsg += "redirect response content (%s)" % msg
9491 logger .debug (dbgMsg )
9592
96- if kb .redirectChoice == REDIRECTION .FOLLOW or kb .originalPage is None :
93+ if kb .redirectChoice == REDIRECTION .YES or kb .originalPage is None :
9794 req .headers [HTTPHEADER .HOST ] = getHostHeader (redurl )
9895 result = urllib2 .HTTPRedirectHandler .http_error_302 (self , req , fp , code , msg , headers )
9996 else :
0 commit comments