mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
优化
This commit is contained in:
@@ -30,7 +30,7 @@ class Ask(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text, fuzzy=False)
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -54,7 +54,7 @@ class Baidu(Search):
|
||||
# 获取百度跳转URL响应头的Location字段获取直链
|
||||
subdomains = self.redirect_match(domain, resp.text)
|
||||
else:
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text, fuzzy=False)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -36,7 +36,7 @@ class Bing(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text, fuzzy=False)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -37,7 +37,7 @@ class BingAPI(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -37,7 +37,7 @@ class FoFa(Search):
|
||||
if not resp:
|
||||
return
|
||||
resp_json = resp.json()
|
||||
subdomains = self.match_subdomains(self.domain, str(resp_json))
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
@@ -10,7 +10,7 @@ class Gitee(Search):
|
||||
self.source = 'GiteeSearch'
|
||||
self.module = 'Search'
|
||||
self.addr = 'https://search.gitee.com/'
|
||||
self.domain = self.register(domain)
|
||||
self.domain = self.get_maindomain(domain)
|
||||
self.header = self.get_header()
|
||||
|
||||
def search(self, full_search=False):
|
||||
@@ -34,7 +34,7 @@ class Gitee(Search):
|
||||
if 'class="empty-box"' in resp.text:
|
||||
break
|
||||
soup = BeautifulSoup(resp.text, 'html.parser')
|
||||
subdomains = self.match_subdomains(self.domain, soup.text)
|
||||
subdomains = self.match_subdomains(soup.text, fuzzy=False)
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -10,7 +10,7 @@ class GithubAPI(Search):
|
||||
self.source = 'GithubAPISearch'
|
||||
self.module = 'Search'
|
||||
self.addr = 'https://api.github.com/search/code'
|
||||
self.domain = self.register(domain)
|
||||
self.domain = self.get_maindomain(domain)
|
||||
self.session = requests.Session()
|
||||
self.auth_url = 'https://api.github.com'
|
||||
self.token = api.github_api_token
|
||||
@@ -60,7 +60,7 @@ class GithubAPI(Search):
|
||||
if resp.status_code != 200:
|
||||
logger.log('ERROR', f'{self.source} module query failed')
|
||||
break
|
||||
subdomains = self.match_subdomains(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
if not subdomains:
|
||||
break
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
@@ -40,7 +40,7 @@ class Google(Search):
|
||||
resp = self.get(url=self.addr, params=payload)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text, fuzzy=False)
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -35,7 +35,7 @@ class GoogleAPI(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -5,7 +5,7 @@ from common.search import Search
|
||||
class ShodanAPI(Search):
|
||||
def __init__(self, domain):
|
||||
Search.__init__(self)
|
||||
self.domain = self.register(domain)
|
||||
self.domain = self.get_maindomain(domain)
|
||||
self.module = 'Search'
|
||||
self.source = 'ShodanAPISearch'
|
||||
self.addr = 'https://api.shodan.io/shodan/host/search'
|
||||
@@ -25,7 +25,7 @@ class ShodanAPI(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
if subdomains:
|
||||
|
||||
@@ -31,7 +31,7 @@ class So(Search):
|
||||
resp = self.get(url=self.addr, params=payload)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text, fuzzy=False)
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -28,7 +28,7 @@ class Sogou(Search):
|
||||
resp = self.get(self.addr, payload)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text, fuzzy=False)
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -36,7 +36,7 @@ class Yahoo(Search):
|
||||
if not resp:
|
||||
return
|
||||
text = resp.text.replace('<b>', '').replace('</b>', '')
|
||||
subdomains = self.match_subdomains(domain, text)
|
||||
subdomains = self.match_subdomains(text, fuzzy=False)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -36,7 +36,7 @@ class Yandex(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text, fuzzy=False)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -48,7 +48,7 @@ class ZoomEyeAPI(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match_subdomains(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(resp.text)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
Reference in New Issue
Block a user