From cc2053918c4867f07fb20b480975afe50f084d4d Mon Sep 17 00:00:00 2001 From: xiao Date: Wed, 1 Jul 2015 17:36:07 +0800 Subject: [PATCH] changed --- gather.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gather.py b/gather.py index 210ccbd..bea7b27 100755 --- a/gather.py +++ b/gather.py @@ -58,7 +58,7 @@ def querySubdomain(domain): for node in nodes: print node, getTitle(node) -def queryRDNS(domain): +def queryRDNS_old(domain): hostInfos = socket.gethostbyname_ex(domain) #r = (hostname, aliaslist, ipaddrlist) for ipaddr in hostInfos[2]: maxpage = 1 @@ -84,6 +84,20 @@ def queryRDNS(domain): print e #pass +def queryRDNS(domain): + hostInfos = socket.gethostbyname_ex(domain) #r = (hostname, aliaslist, ipaddrlist) + for ipaddr in hostInfos[2]: + try: + response = urllib2.urlopen('http://dns.aizhan.com/%s/' % (ipaddr)) + text = response.read() + tree = etree.HTML(text) + nodes = tree.xpath(r"//td[@class='dns-links']/a/@href") + for node in nodes: + print node + except Exception, e: + print e + + def toStr(l): #print type(l) if type(l) != types.ListType: