From c784deb9976cad000846c2c11e79dc03a87723b4 Mon Sep 17 00:00:00 2001 From: Benajmyn Love Date: Mon, 25 Sep 2017 08:33:28 +1000 Subject: [PATCH] Added MX record fix --- HTTPy.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/HTTPy.py b/HTTPy.py index 92bcbc5..456781b 100755 --- a/HTTPy.py +++ b/HTTPy.py @@ -141,6 +141,20 @@ def iterate(inArray, pre): else: print bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET count = count + 1 + + +def iterateMX(inArray, pre): + count = 0 + while count != len(inArray) - 1: + tmp = inArray[count].split(' ') + if checkIfIP(tmp.split('.')) == 0: + tmpVal = isCNAME(tmp[1]) + + print bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + " -> " + tmpVal[0] + bcolors.RESET + else: + print bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET + count = count + 1 + def parseWhois(whioisInfo): NS = re.compile("^[Nn]") D = re.compile("^[Dd]") @@ -257,6 +271,10 @@ while running == 1: iterate(subRec, subDomain) for rec in rec2check: if rec != "": - dnsRec, dnsType, blank = newdig(inInput, rec) - iterate(dnsRec, dnsType) + if rec == "MX": + dnsRec, dnsType, blank = newdig(inInput, rec) + iterateMX(dnsRec, dnsType) + else: + dnsRec, dnsType, blank = newdig(inInput, rec) + iterate(dnsRec, dnsType) print '\n' \ No newline at end of file