mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 04:53:48 +03:00
adding some user input for "refreshing" cases (like redirect ones)
This commit is contained in:
parent
cf69809c3c
commit
c11ea35d53
|
@ -1317,6 +1317,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
|||
kb.absFilePaths = set()
|
||||
kb.adjustTimeDelay = False
|
||||
kb.alwaysRedirect = None
|
||||
kb.alwaysRefresh = None
|
||||
kb.arch = None
|
||||
kb.authHeader = None
|
||||
kb.bannerFp = advancedDict()
|
||||
|
|
|
@ -260,7 +260,7 @@ class Connect:
|
|||
msg += "from now on (or stay on the original page)? [Y/n]"
|
||||
choice = readInput(msg, default="Y")
|
||||
|
||||
kb.alwaysRedirect = choice in ("n", "N")
|
||||
kb.alwaysRedirect = choice not in ("n", "N")
|
||||
|
||||
kwargs['url'] = conn.redurl if kb.alwaysRedirect else conf.url
|
||||
kwargs['redirecting'] = True
|
||||
|
@ -281,6 +281,19 @@ class Connect:
|
|||
if extractRegexResult(META_REFRESH_REGEX, page, re.DOTALL | re.IGNORECASE) and not refreshing:
|
||||
url = extractRegexResult(META_REFRESH_REGEX, page, re.DOTALL | re.IGNORECASE)
|
||||
|
||||
debugMsg = "got HTML meta refresh header"
|
||||
logger.debug(debugMsg)
|
||||
|
||||
if kb.alwaysRefresh is None:
|
||||
msg = "sqlmap got a refresh request "
|
||||
msg += "(redirect like response common to login pages). "
|
||||
msg += "do you want to apply the refresh "
|
||||
msg += "from now on (or stay on the original page)? [Y/n]"
|
||||
choice = readInput(msg, default="Y")
|
||||
|
||||
kb.alwaysRefresh = choice not in ("n", "N")
|
||||
|
||||
if kb.alwaysRefresh:
|
||||
if url.lower().startswith('http://'):
|
||||
kwargs['url'] = url
|
||||
else:
|
||||
|
@ -291,9 +304,6 @@ class Connect:
|
|||
kwargs['get'] = None
|
||||
kwargs['post'] = None
|
||||
|
||||
debugMsg = "got HTML meta refresh header"
|
||||
logger.debug(debugMsg)
|
||||
|
||||
try:
|
||||
return Connect.__getPageProxy(**kwargs)
|
||||
except sqlmapSyntaxException:
|
||||
|
|
Loading…
Reference in New Issue
Block a user