diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 4a5298e0f..688280a27 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -23,6 +23,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ import re +import socket import time from lib.core.agent import agent @@ -380,6 +381,14 @@ def checkRegexp(): return False def checkConnection(): + infoMsg = "testing if site exists" + logger.info(infoMsg) + try: + socket.gethostbyname(conf.hostname) + except socket.gaierror: + errMsg = "site '%s' does not exist" % conf.hostname + raise sqlmapConnectionException, errMsg + infoMsg = "testing connection to the target url" logger.info(infoMsg)