File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747from lib .core .convert import urlencode
4848from lib .core .exception import sqlmapFilePathException
4949from lib .core .exception import sqlmapNoneDataException
50+ from lib .core .exception import sqlmapSyntaxException
5051from lib .core .settings import IS_WIN
5152from lib .core .settings import SQL_STATEMENTS
5253from 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 :
Original file line number Diff line number Diff 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'"
You can’t perform that action at this time.
0 commit comments