Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3110bb1

Browse files
committed
added test for site existance
1 parent 7ee2048 commit 3110bb1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/controller/checks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"""
2424

2525
import re
26+
import socket
2627
import time
2728

2829
from lib.core.agent import agent
@@ -380,6 +381,14 @@ def checkRegexp():
380381
return False
381382

382383
def checkConnection():
384+
infoMsg = "testing if site exists"
385+
logger.info(infoMsg)
386+
try:
387+
socket.gethostbyname(conf.hostname)
388+
except socket.gaierror:
389+
errMsg = "site '%s' does not exist" % conf.hostname
390+
raise sqlmapConnectionException, errMsg
391+
383392
infoMsg = "testing connection to the target url"
384393
logger.info(infoMsg)
385394

0 commit comments

Comments
 (0)