From a7c2b95ac126187e54790ac537715c3134b2a9db Mon Sep 17 00:00:00 2001 From: pwnhxl <718701810@qq.com> Date: Sat, 26 Nov 2022 08:58:35 +0800 Subject: [PATCH] add. --- config/api.py | 3 ++ modules/certificates/racent.py | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 modules/certificates/racent.py diff --git a/config/api.py b/config/api.py index a932bab..0d2b20c 100644 --- a/config/api.py +++ b/config/api.py @@ -86,3 +86,6 @@ fullhunt_api_key = '' # 登录quake之后可在个人中心获取key https://quake.360.net/quake/#/personal?tab=message quake_api_key = '' + +#https://www.racent.com/ctlog F2>Network抓包获取Token +racent_api_token = '' \ No newline at end of file diff --git a/modules/certificates/racent.py b/modules/certificates/racent.py new file mode 100644 index 0000000..7582106 --- /dev/null +++ b/modules/certificates/racent.py @@ -0,0 +1,50 @@ +from config import settings +from common.query import Query + + +class DatasetApi(Query): + def __init__(self, domain): + Query.__init__(self) + self.domain = domain + self.module = 'Certificate' + self.source = 'Racent' + self.addr = 'https://face.racent.com/tool/query_ctlog' + self.api = settings.racent_api_token + + def query(self): + """ + 向接口查询子域并做子域匹配 + """ + self.header = self.get_header() + self.proxy = self.get_proxy(self.source) + params = {'token': self.api, 'keyword': self.domain} + print(self.addr, params) + resp = self.get(self.addr, params) + self.subdomains = self.collect_subdomains(resp) + + def run(self): + """ + 类执行入口 + """ + if not self.have_api(self.api): + return + self.begin() + self.query() + self.finish() + self.save_json() + self.gen_result() + self.save_db() + + +def run(domain): + """ + 类统一调用入口 + + :param str domain: 域名 + """ + query = DatasetApi(domain) + query.run() + + +if __name__ == '__main__': + run('example.com')