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(domain, resp.text)
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
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(domain, resp.text)
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
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(domain, resp.text)
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
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(domain, str(resp.json()))
|
||||
subdomains = self.match_subdomains(domain, str(resp.json()))
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -36,7 +36,7 @@ class FoFa(Search):
|
||||
if not resp:
|
||||
return
|
||||
resp_json = resp.json()
|
||||
subdomains = self.match(self.domain, str(resp_json))
|
||||
subdomains = self.match_subdomains(self.domain, str(resp_json))
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
@@ -34,7 +34,7 @@ class Gitee(Search):
|
||||
if 'class="empty-box"' in resp.text:
|
||||
break
|
||||
soup = BeautifulSoup(resp.text, 'html.parser')
|
||||
subdomains = self.match(self.domain, soup.text)
|
||||
subdomains = self.match_subdomains(self.domain, soup.text)
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import requests
|
||||
from config import api
|
||||
from common.utils import match_subdomain
|
||||
from common.search import Search
|
||||
from config.log import logger
|
||||
|
||||
@@ -61,7 +60,7 @@ class GithubAPI(Search):
|
||||
if resp.status_code != 200:
|
||||
logger.log('ERROR', f'{self.source}模块搜索出错')
|
||||
break
|
||||
subdomains = match_subdomain(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(self.domain, 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(domain, resp.text)
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
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(domain, str(resp.json()))
|
||||
subdomains = self.match_subdomains(domain, str(resp.json()))
|
||||
if not subdomains:
|
||||
break
|
||||
if not full_search:
|
||||
|
||||
@@ -25,7 +25,7 @@ class ShodanAPI(Search):
|
||||
resp = self.get(self.addr, params)
|
||||
if not resp:
|
||||
return
|
||||
subdomains = self.match(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(self.domain, 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(domain, resp.text)
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
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(domain, resp.text)
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
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(domain, text)
|
||||
subdomains = self.match_subdomains(domain, text)
|
||||
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(domain, resp.text)
|
||||
subdomains = self.match_subdomains(domain, resp.text)
|
||||
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(self.domain, resp.text)
|
||||
subdomains = self.match_subdomains(self.domain, resp.text)
|
||||
if not subdomains: # 搜索没有发现子域名则停止搜索
|
||||
break
|
||||
self.subdomains = self.subdomains.union(subdomains)
|
||||
|
||||
Reference in New Issue
Block a user