minor check added for invalid urls (e.g. deliberately too long)

This commit is contained in:
Miroslav Stampar 2012-01-07 16:06:18 +00:00
parent 164c8a4020
commit a675c88894

View File

@ -1248,7 +1248,12 @@ def parseTargetUrl():
conf.path = __urlSplit[2].strip() conf.path = __urlSplit[2].strip()
conf.hostname = __hostnamePort[0].strip() conf.hostname = __hostnamePort[0].strip()
if any((re.search(r'\s', conf.hostname), '..' in conf.hostname, conf.hostname.startswith('.'))): try:
_ = conf.hostname.encode("idna")
except UnicodeError:
_ = None
if any((_ is None, re.search(r'\s', conf.hostname), '..' in conf.hostname, conf.hostname.startswith('.'))):
errMsg = "invalid target url" errMsg = "invalid target url"
raise sqlmapSyntaxException, errMsg raise sqlmapSyntaxException, errMsg