From 3110bb10fc8ef13210bdcb92d23d93684c4ee5d3 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 21 May 2010 13:36:49 +0000 Subject: [PATCH] added test for site existance --- lib/controller/checks.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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)