def crt_update(main_domains: Set[str]): found = set() lookup_domains = hosts_tools.reduce_domains(main_domains) for index, domain in enumerate(lookup_domains): if QUIT_GRACEFULLY: break print('Searching: %s' % domain) found_domains = hosts_tools.find_subdomains(domain) found.update(found_domains) print(' Found: %s' % (len(found_domains) - 1)) print_progress(index, len(lookup_domains)) return found
def virustotal_update(main_domains: Set[str], api_key: str, verbose: bool): found = set() lookup_domains = hosts_tools.reduce_domains(main_domains) for index, domain in enumerate(lookup_domains): if QUIT_GRACEFULLY: break print('Searching: %s' % domain) found_domains = hosts_tools.virustotal_find_subdomain(domain, api_key, verbose) found.update(found_domains) print(' Found: %s' % (len(found_domains) - 1)) print_progress(index, len(lookup_domains)) return found
def test_reduce_domains(self): reduced = hosts_tools.reduce_domains(self.TEST_DOMAINS) assert reduced assert not {'a.com', 'b.com'}.difference(reduced)