Skip to content

Commit 3e9c57d

Browse files
committed
minor fix
1 parent be76928 commit 3e9c57d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/core/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,11 @@ def parseTargetUrl():
10671067
if not conf.url:
10681068
return
10691069

1070+
if re.search("\[.+\]", conf.url) and not socket.has_ipv6:
1071+
errMsg = "IPv6 addressing is not supported "
1072+
errMsg += "on this platform"
1073+
raise sqlmapGenericException, errMsg
1074+
10701075
if not re.search("^http[s]*://", conf.url):
10711076
if ":443/" in conf.url:
10721077
conf.url = "https://" + conf.url
@@ -1077,7 +1082,7 @@ def parseTargetUrl():
10771082
conf.url = conf.url.replace('?', URI_QUESTION_MARKER)
10781083

10791084
__urlSplit = urlparse.urlsplit(conf.url)
1080-
__hostnamePort = __urlSplit[1].split(":")
1085+
__hostnamePort = __urlSplit[1].split(":") if not re.search("\[.+\]", __urlSplit[1]) else filter(None, (re.search("\[.+\]", __urlSplit[1]).group(0), re.search("\](:(?P<port>\d+))?", __urlSplit[1]).group("port")))
10811086

10821087
conf.scheme = __urlSplit[0].strip() if not conf.forceSSL else "https"
10831088
conf.path = __urlSplit[2].strip()

0 commit comments

Comments
 (0)