mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
27 lines
663 B
Python
27 lines
663 B
Python
from common.module import Module
|
|
from common import utils
|
|
|
|
|
|
class Lookup(Module):
|
|
"""
|
|
DNS query base class
|
|
"""
|
|
|
|
def __init__(self):
|
|
Module.__init__(self)
|
|
|
|
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
|