This commit is contained in:
Miroslav Stampar 2010-12-11 21:28:11 +00:00
parent 6a24048aa6
commit f7344a5fc3

View File

@ -36,6 +36,7 @@ from lib.core.enums import HTTPMETHOD
from lib.core.enums import NULLCONNECTION
from lib.core.enums import PLACE
from lib.core.exception import sqlmapConnectionException
from lib.core.exception import sqlmapSyntaxException
from lib.core.settings import MIN_TIME_RESPONSES
from lib.request.basic import decodePage
from lib.request.basic import forgeHeaders
@ -265,7 +266,10 @@ class Connect:
except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead), e:
tbMsg = traceback.format_exc()
if "URLError" in tbMsg or "error" in tbMsg:
if "no host given" in tbMsg:
warnMsg = "invalid url address used (%s)" % repr(url)
raise sqlmapSyntaxException, warnMsg
elif "URLError" in tbMsg or "error" in tbMsg:
warnMsg = "unable to connect to the target url"
elif "timeout" in tbMsg:
warnMsg = "connection timed out to the target url"