@@ -475,7 +475,7 @@ class _(dict):
475475 return conn , None , None
476476
477477 # Get HTTP response
478- if hasattr (conn , ' redurl' ):
478+ if hasattr (conn , " redurl" ):
479479 page = (threadData .lastRedirectMsg [1 ] if kb .redirectChoice == REDIRECTION .NO \
480480 else Connect ._connReadProxy (conn )) if not skipRead else None
481481 skipLogTraffic = kb .redirectChoice == REDIRECTION .NO
@@ -491,37 +491,41 @@ class _(dict):
491491
492492 kb .connErrorCounter = 0
493493
494- if extractRegexResult ( META_REFRESH_REGEX , page ) and not refreshing :
495- refresh = extractRegexResult ( META_REFRESH_REGEX , page )
494+ if not refreshing :
495+ refresh = headers . get ( HTTP_HEADER . REFRESH )
496496
497- debugMsg = "got HTML meta refresh header"
498- logger .debug (debugMsg )
499-
500- if kb .alwaysRefresh is None :
501- msg = "sqlmap got a refresh request "
502- msg += "(redirect like response common to login pages). "
503- msg += "Do you want to apply the refresh "
504- msg += "from now on (or stay on the original page)? [Y/n]"
505- choice = readInput (msg , default = "Y" )
497+ if extractRegexResult (META_REFRESH_REGEX , page ):
498+ refresh = extractRegexResult (META_REFRESH_REGEX , page )
506499
507- kb .alwaysRefresh = choice not in ("n" , "N" )
500+ debugMsg = "got HTML meta refresh header"
501+ logger .debug (debugMsg )
508502
509- if kb .alwaysRefresh :
510- if re .search (r"\Ahttps?://" , refresh , re .I ):
511- url = refresh
512- else :
513- url = urlparse .urljoin (url , refresh )
503+ if refresh :
504+ if kb .alwaysRefresh is None :
505+ msg = "sqlmap got a refresh request "
506+ msg += "(redirect like response common to login pages). "
507+ msg += "Do you want to apply the refresh "
508+ msg += "from now on (or stay on the original page)? [Y/n]"
509+ choice = readInput (msg , default = "Y" )
514510
515- threadData .lastRedirectMsg = (threadData .lastRequestUID , page )
516- kwargs ['refreshing' ] = True
517- kwargs ['url' ] = url
518- kwargs ['get' ] = None
519- kwargs ['post' ] = None
511+ kb .alwaysRefresh = choice not in ("n" , "N" )
520512
521- try :
522- return Connect ._getPageProxy (** kwargs )
523- except SqlmapSyntaxException :
524- pass
513+ if kb .alwaysRefresh :
514+ if re .search (r"\Ahttps?://" , refresh , re .I ):
515+ url = refresh
516+ else :
517+ url = urlparse .urljoin (url , refresh )
518+
519+ threadData .lastRedirectMsg = (threadData .lastRequestUID , page )
520+ kwargs ["refreshing" ] = True
521+ kwargs ["url" ] = url
522+ kwargs ["get" ] = None
523+ kwargs ["post" ] = None
524+
525+ try :
526+ return Connect ._getPageProxy (** kwargs )
527+ except SqlmapSyntaxException :
528+ pass
525529
526530 # Explicit closing of connection object
527531 if conn and not conf .keepAlive :
0 commit comments