mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
Patch for an Issue #930
This commit is contained in:
parent
d0afa7f325
commit
671facc6d9
|
@ -1225,7 +1225,14 @@ def parseTargetUrl():
|
||||||
if CUSTOM_INJECTION_MARK_CHAR in conf.url:
|
if CUSTOM_INJECTION_MARK_CHAR in conf.url:
|
||||||
conf.url = conf.url.replace('?', URI_QUESTION_MARKER)
|
conf.url = conf.url.replace('?', URI_QUESTION_MARKER)
|
||||||
|
|
||||||
|
try:
|
||||||
urlSplit = urlparse.urlsplit(conf.url)
|
urlSplit = urlparse.urlsplit(conf.url)
|
||||||
|
except ValueError, ex:
|
||||||
|
errMsg = "invalid URL '%s' has been given ('%s'). " % (conf.url, ex)
|
||||||
|
errMsg += "Please be sure that you don't have any leftover characters (e.g. '[' or ']') "
|
||||||
|
errMsg += "in the hostname part"
|
||||||
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
||||||
hostnamePort = urlSplit.netloc.split(":") if not re.search("\[.+\]", urlSplit.netloc) else filter(None, (re.search("\[.+\]", urlSplit.netloc).group(0), re.search("\](:(?P<port>\d+))?", urlSplit.netloc).group("port")))
|
hostnamePort = urlSplit.netloc.split(":") if not re.search("\[.+\]", urlSplit.netloc) else filter(None, (re.search("\[.+\]", urlSplit.netloc).group(0), re.search("\](:(?P<port>\d+))?", urlSplit.netloc).group("port")))
|
||||||
|
|
||||||
conf.scheme = urlSplit.scheme.strip().lower() if not conf.forceSSL else "https"
|
conf.scheme = urlSplit.scheme.strip().lower() if not conf.forceSSL else "https"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user