This commit is contained in:
shmilylty
2019-08-07 01:32:49 +08:00
parent 8ba3b926ce
commit b628859d32
45 changed files with 253 additions and 172 deletions
+9 -5
View File
@@ -22,15 +22,19 @@ class CertDBAPI(Query):
time.sleep(self.delay)
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
params = {'domain': self.domain, 'api_token': self.token, 'page': page_num}
params = {'domain': self.domain,
'api_token': self.token,
'page': page_num}
resp = self.get(self.addr, params)
if not resp:
return
resp_json = resp.json()
subdomains_find = utils.match_subdomain(self.domain, str(resp_json))
self.subdomains = self.subdomains.union(subdomains_find) # 合并搜索子域名搜索结果
json = resp.json()
subdomains_find = utils.match_subdomain(self.domain, str(json))
# 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains_find)
page_num += 1
if resp_json.get('count') < 30: # 默认每次查询最多返回30条 当前条数小于30条说明已经查完
# 默认每次查询最多返回30条 当前条数小于30条说明已经查完
if json.get('count') < 30:
break
def run(self):
@@ -18,12 +18,14 @@ class CertSpotter(Query):
time.sleep(self.delay)
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
params = {'domain': self.domain, 'include_subdomains': 'true', 'expand': 'dns_names'}
params = {'domain': self.domain, 'include_subdomains': 'true',
'expand': 'dns_names'}
resp = self.get(self.addr, params)
if not resp:
return
subdomains_find = utils.match_subdomain(self.domain, str(resp.json()))
self.subdomains = self.subdomains.union(subdomains_find) # 合并搜索子域名搜索结果
# 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains_find)
def run(self):
"""
@@ -49,5 +51,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__':
do('example.com')
+2 -1
View File
@@ -18,7 +18,8 @@ class Entrust(Query):
time.sleep(self.delay)
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
params = {'fields': 'subjectDN', 'domain': self.domain, 'includeExpired': 'true'}
params = {'fields': 'subjectDN', 'domain': self.domain,
'includeExpired': 'true'}
resp = self.get(self.addr, params)
if not resp:
return
+6 -3
View File
@@ -9,7 +9,8 @@ class Google(Query):
self.domain = self.register(domain)
self.module = 'Certificate'
self.source = 'GoogleQuery'
self.addr = 'https://transparencyreport.google.com/transparencyreport/api/v3/httpsreport/ct/certsearch'
self.addr = 'https://transparencyreport.google.com/' \
'transparencyreport/api/v3/httpsreport/ct/certsearch'
def query(self):
"""
@@ -18,12 +19,14 @@ class Google(Query):
time.sleep(self.delay)
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
params = {'include_expired': 'true', 'include_subdomains': 'true', 'domain': self.domain}
params = {'include_expired': 'true', 'include_subdomains': 'true',
'domain': self.domain}
resp = self.get(self.addr, params)
if not resp:
return
subdomains_find = utils.match_subdomain(self.domain, resp.text)
self.subdomains = self.subdomains.union(subdomains_find) # 合并搜索子域名搜索结果
# 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains_find)
def run(self):
"""