统一调整子域匹配函数

This commit is contained in:
Jing Ling
2020-05-11 21:17:25 +08:00
parent ebd55faa9e
commit 74d5354ead
57 changed files with 94 additions and 93 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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 -2
View File
@@ -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)
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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)