mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
添加绕过cloudFlare验证
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import time
|
import time
|
||||||
|
import cloudscraper
|
||||||
from common.query import Query
|
from common.query import Query
|
||||||
|
from config import logger
|
||||||
|
|
||||||
|
|
||||||
class BufferOver(Query):
|
class BufferOver(Query):
|
||||||
@@ -8,20 +10,26 @@ class BufferOver(Query):
|
|||||||
self.domain = self.register(domain)
|
self.domain = self.register(domain)
|
||||||
self.module = 'Dataset'
|
self.module = 'Dataset'
|
||||||
self.source = 'BufferOverQuery'
|
self.source = 'BufferOverQuery'
|
||||||
self.addr = 'https://dns.bufferover.run/dns'
|
self.addr = 'https://dns.bufferover.run/dns?q='
|
||||||
|
|
||||||
def query(self):
|
def query(self):
|
||||||
"""
|
"""
|
||||||
向接口查询子域并做子域匹配
|
向接口查询子域并做子域匹配
|
||||||
"""
|
"""
|
||||||
time.sleep(self.delay)
|
time.sleep(self.delay)
|
||||||
self.header = self.get_header()
|
# 绕过cloudFlare验证
|
||||||
self.proxy = self.get_proxy(self.source)
|
scraper = cloudscraper.create_scraper()
|
||||||
params = {'q': self.domain}
|
scraper.interpreter = 'js2py'
|
||||||
resp = self.get(self.addr, params)
|
scraper.proxies = self.get_proxy(self.source)
|
||||||
|
url = self.addr + self.domain
|
||||||
|
try:
|
||||||
|
resp = scraper.get(url, timeout=self.timeout)
|
||||||
|
except Exception as e:
|
||||||
|
logger.log('ERROR', e.args)
|
||||||
|
return
|
||||||
if not resp:
|
if not resp:
|
||||||
return
|
return
|
||||||
subdomains = self.match(self.domain, resp.text)
|
subdomains = self.match(self.domain, str(resp.json()))
|
||||||
# 合并搜索子域名搜索结果
|
# 合并搜索子域名搜索结果
|
||||||
self.subdomains = self.subdomains.union(subdomains)
|
self.subdomains = self.subdomains.union(subdomains)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user