Skip to content

Commit

Permalink
Patch for an Issue sqlmapproject#930
Browse files Browse the repository at this point in the history
  • Loading branch information
stamparm committed Nov 13, 2014
1 parent d0afa7f commit 671facc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,14 @@ def parseTargetUrl():
if CUSTOM_INJECTION_MARK_CHAR in conf.url:
conf.url = conf.url.replace('?', URI_QUESTION_MARKER)

urlSplit = urlparse.urlsplit(conf.url)
try:
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")))

conf.scheme = urlSplit.scheme.strip().lower() if not conf.forceSSL else "https"
Expand Down

0 comments on commit 671facc

Please sign in to comment.