From cef248a5ea76e43fdba3f260e8db6a5ff7e60186 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 10 Feb 2010 12:06:23 +0000 Subject: [PATCH] update for that invalid target url Otavio Augusto reported --- lib/core/common.py | 7 ++++++- lib/core/option.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index cd330001a..a69627722 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -47,6 +47,7 @@ from lib.core.data import temp from lib.core.convert import urlencode from lib.core.exception import sqlmapFilePathException from lib.core.exception import sqlmapNoneDataException +from lib.core.exception import sqlmapSyntaxException from lib.core.settings import IS_WIN from lib.core.settings import SQL_STATEMENTS from lib.core.settings import VERSION_STRING @@ -595,7 +596,11 @@ def parseTargetUrl(): conf.hostname = __hostnamePort[0] 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": conf.port = 443 else: diff --git a/lib/core/option.py b/lib/core/option.py index 1e7e0801f..1b7d0d2b9 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -609,7 +609,10 @@ def __setHTTPProxy(): __port = None 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: errMsg = "proxy value must be in format 'http://url:port'"