File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 70
70
from lib .core .enums import PLACE
71
71
from lib .core .enums import REDIRECTION
72
72
from lib .core .exception import SqlmapConnectionException
73
+ from lib .core .exception import SqlmapDataException
73
74
from lib .core .exception import SqlmapNoneDataException
74
75
from lib .core .exception import SqlmapSilentQuitException
75
76
from lib .core .exception import SqlmapSkipTargetException
@@ -1530,10 +1531,14 @@ def checkConnection(suppressOutput=False):
1530
1531
except socket .gaierror :
1531
1532
errMsg = "host '%s' does not exist" % conf .hostname
1532
1533
raise SqlmapConnectionException (errMsg )
1533
- except ( socket .error , UnicodeError ) , ex :
1534
+ except socket .error , ex :
1534
1535
errMsg = "problem occurred while "
1535
1536
errMsg += "resolving a host name '%s' ('%s')" % (conf .hostname , getSafeExString (ex ))
1536
1537
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 )
1537
1542
1538
1543
if not suppressOutput and not conf .dummy and not conf .offline :
1539
1544
infoMsg = "testing connection to the target URL"
Original file line number Diff line number Diff line change 82
82
from lib .core .enums import REFLECTIVE_COUNTER
83
83
from lib .core .enums import WIZARD
84
84
from lib .core .exception import SqlmapConnectionException
85
+ from lib .core .exception import SqlmapDataException
85
86
from lib .core .exception import SqlmapFilePathException
86
87
from lib .core .exception import SqlmapGenericException
87
88
from lib .core .exception import SqlmapInstallationException
@@ -1364,7 +1365,12 @@ def _setHostname():
1364
1365
"""
1365
1366
1366
1367
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 )
1368
1374
1369
1375
def _setHTTPTimeout ():
1370
1376
"""
You can’t perform that action at this time.
0 commit comments