def active_search(self): scanable_domain = set() for d in self.subdomains: scanable_domain.update(tools.scanable_subdomain(d)) self.subdomains = set( filter(lambda x: not x.startswith('*.'), self.subdomains)) for domain in scanable_domain: isext, ip = tools.check_extensive_domain(domain) if not os.path.exists( os.path.join(config.OUTPUT_DIR, '%s.txt' % domain)): if tools.get_domain(domain) == domain: d = subDomainsBrute.SubNameBrute( target=domain, options=subDomainsBruteOpt(domain)) else: d = subDomainsBrute.SubNameBrute( target=domain, options=subDomainsBruteOpt(domain, "next_sub.txt")) d.run() d.outfile.flush() d.outfile.close() r = helper.parse_domains_brute(domain, ip) self.subdomains.update(r.keys()) self.domain_ip.update(r)
def main(url): #要对变量赋值的时候,要先声明使用的全局变量,不然会新建一个局部变量! #真是坑 global web_domain web_domain=tools.get_domain(url) myout.log(web_domain) wait_url.append(url) pool=threadPoolManager.PoolManager(process,wait_url)
def __init__(self, domains): self.domains = set() self.subdomains = set() for domain in domains: if domain.startswith('*.'): domain = domain[2:] base_domain = tools.get_domain(domain) if domain == base_domain: self.domains.add(base_domain) else: self.subdomains.add(domain) self.cdn_domain = set() self.extensive_domain = set() self.ips = set() self.domain_ip = {} self.internal_domain = set() self.ip_all = {} self.takeover_domain = set() self.takeover_domain_check = set()
self.i = False self.full_scan = False domains = helper.load_domain_from_file() subdomains = set() domain_ip = {} # virustotal for d in domains: subdomains.update(virustotal.passive_domain(d)) # DuckDuckSearch for d in domains: #subdomains.update(DuckDuckSearch.subdomain(d)) main_domain = tools.get_domain(d) duck_path = os.path.join(config.INPUT_DIR, "%s_duck.json" % main_domain) if os.path.exists(duck_path): subdomains.update(json.load(open(duck_path, 'r'))) else: duck_domain = DuckDuckSearch.subdomain(duck_path) json.dump(duck_domain, open(duck_path, 'w')) subdomains.update(duck_domain) # dnsdb for d in domains: main_domain = tools.get_domain(d) dnsdb_path = os.path.join(config.INPUT_DIR, "%s.json" % main_domain) if os.path.exists(dnsdb_path): subdomains.update(dnsdb.parse_dnsdb_json(dnsdb_path))