Created
June 30, 2010 23:30
Revisions
-
kaizoku revised this gist
Jun 30, 2010 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ #!/usr/bin/env python ## Attempts to get a domain transfer from the nameservers for the given domain ## Requires dnspython http://www.dnspython.org/ import sys, socket from dns import resolver, rdatatype, query -
kaizoku revised this gist
Jun 30, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ## Attempts to get a domain transfer from the nameservers for the given domain import sys, socket from dns import resolver, rdatatype, query import dns.exception def do_axfr(nameserver, domain): -
kaizoku created this gist
Jun 30, 2010 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/usr/bin/env python ## Attempts to get a domain transfer from the nameservers for the given domain import sys, socket from dns import resolver, rdatatype, query, zone import dns.exception def do_axfr(nameserver, domain): print "Querying %s" % (nameserver,) print "-" * 50 ns = socket.gethostbyname(nameserver) try: q = query.xfr(ns, domain) for m in q: print str(m) print "%s\n" % ("-" * 50,) except dns.exception.FormError: print "AXFR failed\n" return if len(sys.argv) < 2: print "Usage %s <domain>" % (sys.argv[0],) sys.exit() domain = sys.argv[1] r = resolver.Resolver() ans = r.query(domain, rdatatype.NS) for ns in ans: do_axfr(str(ns), domain)