修改日志输出

This commit is contained in:
shmilylty
2019-08-03 22:34:59 +08:00
parent 3635f8f0a6
commit 2f1c1fed97
6 changed files with 14 additions and 28 deletions
+3 -8
View File
@@ -3,7 +3,7 @@
检查内容安全策略收集子域名收集子域名
"""
import queue
import requests
from common import utils
from common.module import Module
from config import logger
@@ -43,14 +43,13 @@ class CheckCSP(Module):
类执行入口
"""
logger.log('DEBUG', f'开始执行{self.source}检查{self.domain}域响应头中的内容安全策略字段')
self.check()
logger.log('DEBUG', f'结束执行{self.source}检查{self.domain}域响应头中的内容安全策略字段')
self.save_json()
self.gen_result()
self.save_db()
rx_queue.put(self.results)
logger.log('DEBUG', f'结束执行{self.source}检查{self.domain}域响应头中的内容安全策略字段')
self.finish()
def do(domain, rx_queue, header=None): # 统一入口名字 方便多线程调用
@@ -63,13 +62,9 @@ def do(domain, rx_queue, header=None): # 统一入口名字 方便多线程调
"""
check = CheckCSP(domain, header)
check.run(rx_queue)
logger.log('INFOR', f'{check.source}模块耗时{check.elapsed}秒发现子域{len(check.subdomains)}')
logger.log('DEBUG', f'{check.source}模块发现的子域 {check.subdomains}')
if __name__ == '__main__':
import requests
# resp = requests.get('https://content-security-policy.com/')
result_queue = queue.Queue()
resp = requests.get('https://www.baidu.com/')