模块优化

This commit is contained in:
Jing Ling
2020-08-10 18:19:11 +08:00
parent 4f462fcd60
commit 8a035c76ca
42 changed files with 49 additions and 153 deletions
+2 -10
View File
@@ -18,19 +18,11 @@ class AlienVault(Query):
base = 'https://otx.alienvault.com/api/v1/indicators/domain'
dns = f'{base}/{self.domain}/passive_dns'
resp = self.get(dns)
if not resp:
return
json = resp.json()
subdomains = self.match_subdomains(str(json))
self.subdomains = self.subdomains.union(subdomains)
self.subdomains = self.collect_subdomains(resp)
url = f'{base}/{self.domain}/url_list'
resp = self.get(url)
if not resp:
return
json = resp.json()
subdomains = self.match_subdomains(str(json))
self.subdomains = self.subdomains.union(subdomains)
self.subdomains = self.collect_subdomains(resp)
def run(self):
"""
+1 -4
View File
@@ -20,10 +20,7 @@ class ThreatBookAPI(Query):
params = {'apikey': self.key,
'resource': self.domain}
resp = self.post(self.addr, params)
if not resp:
return
subdomains = self.match_subdomains(resp.text)
self.subdomains = self.subdomains.union(subdomains)
self.subdomains = self.collect_subdomains(resp)
def run(self):
"""
+1 -5
View File
@@ -18,11 +18,7 @@ class ThreatMiner(Query):
params = {'e': 'subdomains_container',
'q': self.domain, 't': 0, 'rt': 10}
resp = self.get(self.addr, params)
if not resp:
return
subdomains = self.match_subdomains(resp.text)
# 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains)
self.subdomains = self.collect_subdomains(resp)
def run(self):
"""