mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-10-25 00:56:14 +08:00
优化
This commit is contained in:
@@ -6,7 +6,7 @@ from config.log import logger
|
||||
class CensysAPI(Query):
|
||||
def __init__(self, domain):
|
||||
Query.__init__(self)
|
||||
self.domain = self.register(domain)
|
||||
self.domain = self.get_maindomain(domain)
|
||||
self.module = 'Certificate'
|
||||
self.source = "CensysAPIQuery"
|
||||
self.addr = 'https://www.censys.io/api/v1/search/certificates'
|
||||
@@ -33,7 +33,7 @@ class CensysAPI(Query):
|
||||
if status != 'ok':
|
||||
logger.log('ALERT', f'{self.source} module {status}')
|
||||
return
|
||||
subdomains = self.match_subdomains(self.domain, str(json))
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
pages = json.get('metadata').get('pages')
|
||||
for page in range(2, pages + 1):
|
||||
@@ -41,7 +41,7 @@ class CensysAPI(Query):
|
||||
resp = self.post(self.addr, json=data, auth=(self.id, self.secret))
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
def run(self):
|
||||
|
||||
@@ -22,7 +22,7 @@ class CertSpotter(Query):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
# 合并搜索子域名搜索结果
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from common.query import Query
|
||||
class Crtsh(Query):
|
||||
def __init__(self, domain):
|
||||
Query.__init__(self)
|
||||
self.domain = self.register(domain)
|
||||
self.domain = self.get_maindomain(domain)
|
||||
self.module = 'Certificate'
|
||||
self.source = 'CrtshQuery'
|
||||
self.addr = 'https://crt.sh/'
|
||||
@@ -21,7 +21,7 @@ class Crtsh(Query):
|
||||
if not resp:
|
||||
return
|
||||
text = resp.text.replace(r'\n', ' ')
|
||||
subdomains = self.match_subdomains(self.domain, text)
|
||||
subdomains = self.match_subdomains(text)
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
def run(self):
|
||||
|
||||
@@ -5,7 +5,7 @@ from common.query import Query
|
||||
class Google(Query):
|
||||
def __init__(self, domain):
|
||||
Query.__init__(self)
|
||||
self.domain = self.register(domain)
|
||||
self.domain = self.get_maindomain(domain)
|
||||
self.module = 'Certificate'
|
||||
self.source = 'GoogleQuery'
|
||||
self.addr = 'https://transparencyreport.google.com/' \
|
||||
@@ -23,7 +23,7 @@ class Google(Query):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
# 合并搜索子域名搜索结果
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user