时间:2023-02-03 20:04:01 | 来源:建站知识
时间:2023-02-03 20:04:01 来源:建站知识
文章首发于:https://wolke.cn常规域名解析www.wolke.cn 10.10.10.10域名泛解析*.wolke.cn 10.10.10.10访问子域名a.wolke.cn,b.wolke.cn等均指向10.10.10.10
这为我们去做子域名爆破带来了极大的不便,以前子域名爆破常用的是layer子域名挖掘机。不过layer子域名挖掘机在跑具有泛解析的站的时候,就不是那么适用import asyncioimport aiodnsimport randomloop = asyncio.get_event_loop()resolver = aiodns.DNSResolver(loop=loop)async def query(name, query_type): return await resolver.query(name, query_type)def random_to_A(main_domain): total = [] # 随机循环五次 for i in range(5): sub_domain = "".join(random.sample('abcdefghijklmnopqrstuvwxyz', random.randint(8, 12))) res = query(sub_domain + "." + main_domain, 'A') result = loop.run_until_complete(res) total.append(result) return totalif __name__ == '__main__': main_domain = input("Please input the main_doamin: ") print(str(random_to_A(main_domain)).replace("],", "],/n"))
import asyncioimport aiodnsimport randomimport optparseloop = asyncio.get_event_loop()resolver = aiodns.DNSResolver(loop=loop)async def query(name, query_type): return await resolver.query(name, query_type)def random_to_A(main_domain): total = [] # 随机循环五次 for i in range(5): sub_domain = "".join(random.sample('abcdefghijklmnopqrstuvwxyz', random.randint(8, 12))) res = query(sub_domain + "." + main_domain, 'A') result = loop.run_until_complete(res) total.append(result) return totaldef random_to_cname(sub_domain): res = query(sub_domain, 'CNAME') result = loop.run_until_complete(res) return resultif __name__ == '__main__': parser = optparse.OptionParser("%prog " + "[options] [domain]") parser.add_option('-a', action="store", dest='main_domain', type='string', help='') parser.add_option('-c', action="store", dest='sub_domain', type='string', help='') (options, args) = parser.parse_args() main_domain = options.main_domain sub_domain = options.sub_domain if main_domain: print(str(random_to_A(main_domain)).replace("],", "],/n")) elif sub_domain: print(str(random_to_cname(sub_domain)).replace("<", "/n<"))
关键词:爆破