This should fix the logic for ip checking

This commit is contained in:
Benjamyn Love 2017-07-26 23:39:06 +10:00
parent 245e98d8b8
commit 274538991b

View File

@ -49,6 +49,8 @@ def compareSOA(inNameservers, inDomain, origSOA):
def checkIfIP(in1): def checkIfIP(in1):
count = 0 count = 0
if len(in1) != 4:
return 0
for dom in in1: for dom in in1:
if dom.isdigit(): if dom.isdigit():
count += 1 count += 1
@ -147,25 +149,24 @@ while running == 1:
if running == 0: if running == 0:
pass pass
else: else:
if len(partDomain) == 4: if checkIfIP(partDomain):
if checkIfIP(partDomain): print "========================================================"
ipLookup(inInput)
if pingOn == "P":
print "========================================================" print "========================================================"
ipLookup(inInput) ipPing(inInput)
if pingOn == "P":
print "========================================================"
ipPing(inInput)
else:
if whoOn == "W":
whois(inInput)
else: else:
if whoOn == "W":
whois(inInput)
else:
#Condense dig calls #Condense dig calls
dig(inInput, "A") dig(inInput, "A")
dig(inInput, "MX") dig(inInput, "MX")
dig(inInput, "TXT") dig(inInput, "TXT")
test = dig(inInput, "NS") test = dig(inInput, "NS")
dig(inInput, "SRV") dig(inInput, "SRV")
soaRec = dig(inInput, "SOA") soaRec = dig(inInput, "SOA")
print compareSOA(test, inInput, soaRec) print compareSOA(test, inInput, soaRec)
print '\n' print '\n'