mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
优化常规检查模块
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
"""
|
||||
检查内容安全策略收集子域名收集子域名
|
||||
"""
|
||||
from common.module import Module
|
||||
from common.check import Check
|
||||
|
||||
|
||||
class CheckRobots(Module):
|
||||
class CheckRobots(Check):
|
||||
"""
|
||||
检查sitemap收集子域名
|
||||
"""
|
||||
def __init__(self, domain):
|
||||
Module.__init__(self)
|
||||
Check.__init__(self)
|
||||
self.domain = domain
|
||||
self.module = 'Check'
|
||||
self.source = 'Sitemap'
|
||||
@@ -18,20 +18,8 @@ class CheckRobots(Module):
|
||||
"""
|
||||
正则匹配域名的sitemap文件中的子域
|
||||
"""
|
||||
urls = [f'http://{self.domain}/sitemap.xml',
|
||||
f'http://www.{self.domain}/sitemap.xml',
|
||||
f'http://{self.domain}/sitemap.txt',
|
||||
f'http://www.{self.domain}/sitemap.txt',
|
||||
f'http://{self.domain}/sitemap.html',
|
||||
f'http://www.{self.domain}/sitemap.html',
|
||||
f'http://{self.domain}/sitemap_index.xml',
|
||||
f'http://www.{self.domain}/sitemap_index.xml']
|
||||
for url in urls:
|
||||
self.header = self.get_header()
|
||||
self.proxy = self.get_proxy(self.source)
|
||||
self.timeout = 10
|
||||
resp = self.get(url, check=False)
|
||||
self.subdomains = self.collect_subdomains(resp)
|
||||
filenames = {'sitemap.xml', 'sitemap.txt', 'sitemap.html'}
|
||||
self.to_check(filenames)
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user