Created
March 31, 2016 13:38
-
-
Save athoune/4c9e4c112fec4c908f32aecb329dbeae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from __future__ import print_function | |
from dns import resolver | |
from StringIO import StringIO | |
import sys | |
buff = StringIO() | |
answers = resolver.query(sys.argv[1], 'TXT') | |
for rdata in answers: | |
for txt in rdata.strings: | |
buff.write(txt) | |
buff.seek(0) | |
txt = buff.read() | |
if len(sys.argv) > 2: | |
target = sys.argv[2] | |
print("") | |
print("Same lenght", len(txt), len(target)) | |
print(txt) | |
print(target) | |
for idx, letter in enumerate(txt): | |
if target[idx] != letter: | |
print("^", end="") | |
else: | |
print(" ", end="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment