update for that invalid target url Otavio Augusto reported

This commit is contained in:
Miroslav Stampar 2010-02-10 12:06:23 +00:00
parent 203cfd114f
commit cef248a5ea
2 changed files with 10 additions and 2 deletions

View File

@ -47,6 +47,7 @@ from lib.core.data import temp
from lib.core.convert import urlencode from lib.core.convert import urlencode
from lib.core.exception import sqlmapFilePathException from lib.core.exception import sqlmapFilePathException
from lib.core.exception import sqlmapNoneDataException from lib.core.exception import sqlmapNoneDataException
from lib.core.exception import sqlmapSyntaxException
from lib.core.settings import IS_WIN from lib.core.settings import IS_WIN
from lib.core.settings import SQL_STATEMENTS from lib.core.settings import SQL_STATEMENTS
from lib.core.settings import VERSION_STRING from lib.core.settings import VERSION_STRING
@ -595,7 +596,11 @@ def parseTargetUrl():
conf.hostname = __hostnamePort[0] conf.hostname = __hostnamePort[0]
if len(__hostnamePort) == 2: if len(__hostnamePort) == 2:
conf.port = int(__hostnamePort[1]) try:
conf.port = int(__hostnamePort[1])
except:
errMsg = "invalid target url"
raise sqlmapSyntaxException, errMsg
elif conf.scheme == "https": elif conf.scheme == "https":
conf.port = 443 conf.port = 443
else: else:

View File

@ -609,7 +609,10 @@ def __setHTTPProxy():
__port = None __port = None
if len(__hostnamePort) == 2: if len(__hostnamePort) == 2:
__port = int(__hostnamePort[1]) try:
__port = int(__hostnamePort[1])
except:
pass #drops into the next check block
if not __scheme or not __hostname or not __port: if not __scheme or not __hostname or not __port:
errMsg = "proxy value must be in format 'http://url:port'" errMsg = "proxy value must be in format 'http://url:port'"