Example #1
0
 def query(self):
     """
     查询域名的TXT记录
     :return: 查询结果
     """
     answer = utils.dns_query(self.domain, self.type)
     if answer is None:
         return None
     for item in answer:
         record = item.to_text()
         subdomains = utils.match_subdomain(self.domain, record)
         self.subdomains = self.subdomains.union(subdomains)
         self.gen_record(subdomains, record)
     return self.subdomains
Example #2
0
 def query(self):
     """
     Query the TXT record of domain
     :return: query result
     """
     answer = utils.dns_query(self.domain, self.type)
     if answer is None:
         return None
     for item in answer:
         record = item.to_text()
         subdomains = self.match_subdomains(record)
         self.subdomains = self.subdomains.union(subdomains)
         self.gen_record(subdomains, record)
     return self.subdomains
Example #3
0
 def query(self):
     """
     Query the TXT record of domain
     :return: query result
     """
     answer = utils.dns_query(self.domain, self.qtype)
     if answer is None:
         return None
     for item in answer:
         record = item.to_text()
         subdomains = self.match_subdomains(record)
         self.subdomains.update(subdomains)
         logger.log('DEBUG', record)
     return self.subdomains
Example #4
0
 def walk(self):
     domain = self.domain
     while True:
         answer = utils.dns_query(domain, 'NSEC')
         if answer is None:
             break
         subdomain = str()
         for item in answer:
             record = item.to_text()
             subdomains = self.match_subdomains(record)
             subdomain = ''.join(
                 subdomains)  # 其实这里的subdomains的长度为1 也就是说只会有一个子域
             self.subdomains.update(subdomains)
         if subdomain == self.domain:  # 当查出子域为主域 说明完成了一个循环 不再继续查询
             break
         domain = subdomain
     return self.subdomains
Example #5
0
 def walk(self):
     domain = self.domain
     while True:
         answer = utils.dns_query(domain, 'NSEC')
         if answer is None:
             break
         subdomain = str()
         for item in answer:
             record = item.to_text()
             subdomains = self.match_subdomains(record)
             subdomain = ''.join(
                 subdomains
             )  # In fact, the length of subdomains here is 1, which means there will only be one subdomain
             self.subdomains.update(subdomains)
         if subdomain == self.domain:  # When the subdomain is found to be the main domain, it means that a cycle has been completed and the query will not continue
             break
         domain = subdomain
     return self.subdomains
Example #6
0
 def run(self):
     while True:
         name = self.names_que.get()
         answer = utils.dns_query(name, 'SRV')
         self.answers_que.put(answer)
         self.names_que.task_done()