mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-25 20:37:48 +08:00
修复netcraft模块问题
This commit is contained in:
@@ -12,39 +12,21 @@ class NetCraft(Query):
|
|||||||
self.domain = domain
|
self.domain = domain
|
||||||
self.module = 'Dataset'
|
self.module = 'Dataset'
|
||||||
self.source = 'NetCraftQuery'
|
self.source = 'NetCraftQuery'
|
||||||
self.init = 'https://searchdns.netcraft.com/'
|
self.addr = 'https://searchdns.netcraft.com/?restriction=site+contains&position=limited'
|
||||||
self.addr = 'https://searchdns.netcraft.com/?restriction=site+contains'
|
|
||||||
self.page_num = 1
|
self.page_num = 1
|
||||||
self.per_page_num = 20
|
self.per_page_num = 20
|
||||||
|
|
||||||
def bypass_verification(self):
|
|
||||||
"""
|
|
||||||
绕过NetCraft的JS验证
|
|
||||||
"""
|
|
||||||
resp = self.get(self.init)
|
|
||||||
if not resp:
|
|
||||||
return False
|
|
||||||
self.cookie = resp.cookies
|
|
||||||
cookie_value = self.cookie['netcraft_js_verification_challenge']
|
|
||||||
cookie_encode = parse.unquote(cookie_value).encode('utf-8')
|
|
||||||
verify_taken = hashlib.sha1(cookie_encode).hexdigest()
|
|
||||||
self.cookie['netcraft_js_verification_response'] = verify_taken
|
|
||||||
return True
|
|
||||||
|
|
||||||
def query(self):
|
def query(self):
|
||||||
"""
|
"""
|
||||||
向接口查询子域并做子域匹配
|
向接口查询子域并做子域匹配
|
||||||
"""
|
"""
|
||||||
self.header = self.get_header() # NetCraft会检查User-Agent
|
self.header = self.get_header() # NetCraft会检查User-Agent
|
||||||
self.proxy = self.get_proxy(self.source)
|
self.proxy = self.get_proxy(self.source)
|
||||||
if not self.bypass_verification():
|
|
||||||
return
|
|
||||||
last = ''
|
last = ''
|
||||||
while True:
|
while True:
|
||||||
time.sleep(self.delay)
|
time.sleep(self.delay)
|
||||||
self.proxy = self.get_proxy(self.source)
|
self.proxy = self.get_proxy(self.source)
|
||||||
params = {'restriction': 'site ends with',
|
params = {'host': '*.' + self.domain,
|
||||||
'host': '.' + self.domain,
|
|
||||||
'from': self.page_num}
|
'from': self.page_num}
|
||||||
resp = self.get(self.addr + last, params)
|
resp = self.get(self.addr + last, params)
|
||||||
subdomains = self.match_subdomains(resp)
|
subdomains = self.match_subdomains(resp)
|
||||||
|
|||||||
Reference in New Issue
Block a user