mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Fixes #3395
This commit is contained in:
parent
843126702d
commit
101d1f0d49
|
@ -70,6 +70,7 @@ from lib.core.enums import PAYLOAD
|
|||
from lib.core.enums import PLACE
|
||||
from lib.core.enums import REDIRECTION
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.exception import SqlmapDataException
|
||||
from lib.core.exception import SqlmapNoneDataException
|
||||
from lib.core.exception import SqlmapSilentQuitException
|
||||
from lib.core.exception import SqlmapSkipTargetException
|
||||
|
@ -1530,10 +1531,14 @@ def checkConnection(suppressOutput=False):
|
|||
except socket.gaierror:
|
||||
errMsg = "host '%s' does not exist" % conf.hostname
|
||||
raise SqlmapConnectionException(errMsg)
|
||||
except (socket.error, UnicodeError), ex:
|
||||
except socket.error, ex:
|
||||
errMsg = "problem occurred while "
|
||||
errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
|
||||
raise SqlmapConnectionException(errMsg)
|
||||
except UnicodeError, ex:
|
||||
errMsg = "problem occurred while "
|
||||
errMsg += "handling a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
|
||||
raise SqlmapDataException(errMsg)
|
||||
|
||||
if not suppressOutput and not conf.dummy and not conf.offline:
|
||||
infoMsg = "testing connection to the target URL"
|
||||
|
|
|
@ -82,6 +82,7 @@ from lib.core.enums import PROXY_TYPE
|
|||
from lib.core.enums import REFLECTIVE_COUNTER
|
||||
from lib.core.enums import WIZARD
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.exception import SqlmapDataException
|
||||
from lib.core.exception import SqlmapFilePathException
|
||||
from lib.core.exception import SqlmapGenericException
|
||||
from lib.core.exception import SqlmapInstallationException
|
||||
|
@ -1364,7 +1365,12 @@ def _setHostname():
|
|||
"""
|
||||
|
||||
if conf.url:
|
||||
try:
|
||||
conf.hostname = urlparse.urlsplit(conf.url).netloc.split(':')[0]
|
||||
except ValueError, ex:
|
||||
errMsg = "problem occurred while "
|
||||
errMsg += "parsing an URL '%s' ('%s')" % (conf.url, getSafeExString(ex))
|
||||
raise SqlmapDataException(errMsg)
|
||||
|
||||
def _setHTTPTimeout():
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user