File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070from lib .core .enums import PLACE
7171from lib .core .enums import REDIRECTION
7272from lib .core .exception import SqlmapConnectionException
73+ from lib .core .exception import SqlmapDataException
7374from lib .core .exception import SqlmapNoneDataException
7475from lib .core .exception import SqlmapSilentQuitException
7576from lib .core .exception import SqlmapSkipTargetException
@@ -1530,10 +1531,14 @@ def checkConnection(suppressOutput=False):
15301531 except socket .gaierror :
15311532 errMsg = "host '%s' does not exist" % conf .hostname
15321533 raise SqlmapConnectionException (errMsg )
1533- except ( socket .error , UnicodeError ) , ex :
1534+ except socket .error , ex :
15341535 errMsg = "problem occurred while "
15351536 errMsg += "resolving a host name '%s' ('%s')" % (conf .hostname , getSafeExString (ex ))
15361537 raise SqlmapConnectionException (errMsg )
1538+ except UnicodeError , ex :
1539+ errMsg = "problem occurred while "
1540+ errMsg += "handling a host name '%s' ('%s')" % (conf .hostname , getSafeExString (ex ))
1541+ raise SqlmapDataException (errMsg )
15371542
15381543 if not suppressOutput and not conf .dummy and not conf .offline :
15391544 infoMsg = "testing connection to the target URL"
Original file line number Diff line number Diff line change 8282from lib .core .enums import REFLECTIVE_COUNTER
8383from lib .core .enums import WIZARD
8484from lib .core .exception import SqlmapConnectionException
85+ from lib .core .exception import SqlmapDataException
8586from lib .core .exception import SqlmapFilePathException
8687from lib .core .exception import SqlmapGenericException
8788from lib .core .exception import SqlmapInstallationException
@@ -1364,7 +1365,12 @@ def _setHostname():
13641365 """
13651366
13661367 if conf .url :
1367- conf .hostname = urlparse .urlsplit (conf .url ).netloc .split (':' )[0 ]
1368+ try :
1369+ conf .hostname = urlparse .urlsplit (conf .url ).netloc .split (':' )[0 ]
1370+ except ValueError , ex :
1371+ errMsg = "problem occurred while "
1372+ errMsg += "parsing an URL '%s' ('%s')" % (conf .url , getSafeExString (ex ))
1373+ raise SqlmapDataException (errMsg )
13681374
13691375def _setHTTPTimeout ():
13701376 """
You can’t perform that action at this time.
0 commit comments