Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cef248a

Browse files
committed
update for that invalid target url Otavio Augusto reported
1 parent 203cfd1 commit cef248a

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from lib.core.convert import urlencode
4848
from lib.core.exception import sqlmapFilePathException
4949
from lib.core.exception import sqlmapNoneDataException
50+
from lib.core.exception import sqlmapSyntaxException
5051
from lib.core.settings import IS_WIN
5152
from lib.core.settings import SQL_STATEMENTS
5253
from lib.core.settings import VERSION_STRING
@@ -595,7 +596,11 @@ def parseTargetUrl():
595596
conf.hostname = __hostnamePort[0]
596597

597598
if len(__hostnamePort) == 2:
598-
conf.port = int(__hostnamePort[1])
599+
try:
600+
conf.port = int(__hostnamePort[1])
601+
except:
602+
errMsg = "invalid target url"
603+
raise sqlmapSyntaxException, errMsg
599604
elif conf.scheme == "https":
600605
conf.port = 443
601606
else:

lib/core/option.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,10 @@ def __setHTTPProxy():
609609
__port = None
610610

611611
if len(__hostnamePort) == 2:
612-
__port = int(__hostnamePort[1])
612+
try:
613+
__port = int(__hostnamePort[1])
614+
except:
615+
pass #drops into the next check block
613616

614617
if not __scheme or not __hostname or not __port:
615618
errMsg = "proxy value must be in format 'http://url:port'"

0 commit comments

Comments
 (0)