def _resolver(self): domains = [] domain_cname_record = [] for x in self.brute_out: if utils.check_domain_black(x["domain"]): continue domains.append(x["domain"]) self.brute_domain_map[x["domain"]] = x["record"] if x["type"] == 'CNAME': item = x["domain"].lower() if utils.check_domain_black(item): continue if utils.domain_parsed(item): self.domain_cnames.append(item) domain_cname_record.append(x["record"]) for domain in domain_cname_record: if not domain.endswith(self.base_domain_scope): continue if domain not in domains: domains.append(domain) start_time = time.time() logger.info("start reslover {}".format(self.base_domain, len(domains))) self.resolver_map = services.resolver_domain(domains) elapse = time.time() - start_time logger.info("end reslover {} result {}, elapse {}".format( self.base_domain, len(self.resolver_map), elapse))
def resolver(): domains = [ "www.baidu.com", "api.baike.baidu.com", "apollo.baidu.com", "www.baidu.com" ] out = resolver_domain(domains) print(json.dumps(out))
def _resolver(self): domains = [] domain_cname_record = [] for x in self.brute_out: current_domain = x["domain"].lower() if not utils.domain_parsed(current_domain): continue # 删除掉过长的域名 if len(current_domain) >= Config.DOMAIN_MAX_LEN: continue if utils.check_domain_black(current_domain): continue if current_domain not in domains: domains.append(current_domain) self.brute_domain_map[current_domain] = x["record"] if x["type"] == 'CNAME': self.domain_cnames.append(current_domain) current_record_domain = x['record'] if not utils.domain_parsed(current_record_domain): continue if utils.check_domain_black(current_record_domain): continue if current_record_domain not in domain_cname_record: domain_cname_record.append(current_record_domain) for domain in domain_cname_record: if not domain.endswith(self.base_domain_scope): continue if domain not in domains: domains.append(domain) start_time = time.time() logger.info("start reslover {} {}".format(self.base_domain, len(domains))) self.resolver_map = services.resolver_domain(domains) elapse = time.time() - start_time logger.info("end reslover {} result {}, elapse {}".format( self.base_domain, len(self.resolver_map), elapse))