From d59d826f01aad549a21af7c7ae22fde7681d591b Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Sun, 30 Aug 2020 11:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Anubis=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/datasets/anubis.py | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 modules/datasets/anubis.py diff --git a/modules/datasets/anubis.py b/modules/datasets/anubis.py new file mode 100644 index 0000000..3acc541 --- /dev/null +++ b/modules/datasets/anubis.py @@ -0,0 +1,45 @@ +from common.query import Query + + +class Anubis(Query): + def __init__(self, domain): + Query.__init__(self) + self.domain = domain + self.module = 'Dataset' + self.source = 'AnubisQuery' + self.addr = 'https://jldc.me/anubis/subdomains/' + + def query(self): + """ + 向接口查询子域并做子域匹配 + """ + self.header = self.get_header() + self.proxy = self.get_proxy(self.source) + self.addr = self.addr + self.domain + resp = self.get(self.addr) + self.subdomains = self.collect_subdomains(resp) + + def run(self): + """ + 类执行入口 + """ + self.begin() + self.query() + self.finish() + self.save_json() + self.gen_result() + self.save_db() + + +def run(domain): + """ + 类统一调用入口 + + :param str domain: 域名 + """ + query = Anubis(domain) + query.run() + + +if __name__ == '__main__': + run('hackerone.com')