@@ -1522,18 +1522,19 @@ def checkNullConnection():
15221522 return kb .nullConnection is not None
15231523
15241524def checkConnection (suppressOutput = False ):
1525- if not any ((conf .proxy , conf .tor , conf .dummy , conf .offline )):
1526- try :
1527- debugMsg = "resolving hostname '%s'" % conf .hostname
1528- logger .debug (debugMsg )
1529- socket .getaddrinfo (conf .hostname , None )
1530- except socket .gaierror :
1531- errMsg = "host '%s' does not exist" % conf .hostname
1532- raise SqlmapConnectionException (errMsg )
1533- except socket .error , ex :
1534- errMsg = "problem occurred while "
1535- errMsg += "resolving a host name '%s' ('%s')" % (conf .hostname , getSafeExString (ex ))
1536- raise SqlmapConnectionException (errMsg )
1525+ if not re .search (r"\A\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z" , conf .hostname ):
1526+ if not any ((conf .proxy , conf .tor , conf .dummy , conf .offline )):
1527+ try :
1528+ debugMsg = "resolving hostname '%s'" % conf .hostname
1529+ logger .debug (debugMsg )
1530+ socket .getaddrinfo (conf .hostname , None )
1531+ except socket .gaierror :
1532+ errMsg = "host '%s' does not exist" % conf .hostname
1533+ raise SqlmapConnectionException (errMsg )
1534+ except socket .error , ex :
1535+ errMsg = "problem occurred while "
1536+ errMsg += "resolving a host name '%s' ('%s')" % (conf .hostname , getSafeExString (ex ))
1537+ raise SqlmapConnectionException (errMsg )
15371538
15381539 if not suppressOutput and not conf .dummy and not conf .offline :
15391540 infoMsg = "testing connection to the target URL"
0 commit comments