优化常规检查模块

This commit is contained in:
Jing Ling
2020-08-22 01:05:23 +08:00
parent 9847ca6ecc
commit b4ea31561f
8 changed files with 54 additions and 55 deletions
+5 -13
View File
@@ -1,16 +1,15 @@
"""
检查crossdomain.xml文件收集子域名
"""
from common.module import Module
from common.check import Check
class CheckCDX(Module):
class CheckCDX(Check):
"""
检查crossdomain.xml文件收集子域名
"""
def __init__(self, domain: str):
Module.__init__(self)
Check.__init__(self)
self.domain = domain
self.module = 'Check'
self.source = "CrossDomainXml"
@@ -19,15 +18,8 @@ class CheckCDX(Module):
"""
检查crossdomain.xml收集子域名
"""
urls = [f'http://{self.domain}/crossdomain.xml',
f'https://{self.domain}/crossdomain.xml',
f'http://www.{self.domain}/crossdomain.xml',
f'https://www.{self.domain}/crossdomain.xml']
for url in urls:
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
resp = self.get(url, check=False)
self.subdomains = self.collect_subdomains(resp)
filenames = {'crossdomain.xml'}
self.to_check(filenames)
def run(self):
"""