mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +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 PLACE
|
||||||
from lib.core.enums import REDIRECTION
|
from lib.core.enums import REDIRECTION
|
||||||
from lib.core.exception import SqlmapConnectionException
|
from lib.core.exception import SqlmapConnectionException
|
||||||
|
from lib.core.exception import SqlmapDataException
|
||||||
from lib.core.exception import SqlmapNoneDataException
|
from lib.core.exception import SqlmapNoneDataException
|
||||||
from lib.core.exception import SqlmapSilentQuitException
|
from lib.core.exception import SqlmapSilentQuitException
|
||||||
from lib.core.exception import SqlmapSkipTargetException
|
from lib.core.exception import SqlmapSkipTargetException
|
||||||
|
@ -1530,10 +1531,14 @@ def checkConnection(suppressOutput=False):
|
||||||
except socket.gaierror:
|
except socket.gaierror:
|
||||||
errMsg = "host '%s' does not exist" % conf.hostname
|
errMsg = "host '%s' does not exist" % conf.hostname
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
except (socket.error, UnicodeError), ex:
|
except socket.error, ex:
|
||||||
errMsg = "problem occurred while "
|
errMsg = "problem occurred while "
|
||||||
errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
|
errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
|
||||||
raise SqlmapConnectionException(errMsg)
|
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:
|
if not suppressOutput and not conf.dummy and not conf.offline:
|
||||||
infoMsg = "testing connection to the target URL"
|
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 REFLECTIVE_COUNTER
|
||||||
from lib.core.enums import WIZARD
|
from lib.core.enums import WIZARD
|
||||||
from lib.core.exception import SqlmapConnectionException
|
from lib.core.exception import SqlmapConnectionException
|
||||||
|
from lib.core.exception import SqlmapDataException
|
||||||
from lib.core.exception import SqlmapFilePathException
|
from lib.core.exception import SqlmapFilePathException
|
||||||
from lib.core.exception import SqlmapGenericException
|
from lib.core.exception import SqlmapGenericException
|
||||||
from lib.core.exception import SqlmapInstallationException
|
from lib.core.exception import SqlmapInstallationException
|
||||||
|
@ -1364,7 +1365,12 @@ def _setHostname():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if conf.url:
|
if conf.url:
|
||||||
|
try:
|
||||||
conf.hostname = urlparse.urlsplit(conf.url).netloc.split(':')[0]
|
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():
|
def _setHTTPTimeout():
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user