You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
814 B
22 lines
814 B
2 months ago
|
# Nikto工具类
|
||
|
import re
|
||
|
from tools.ToolBase import ToolBase
|
||
|
|
||
|
class NiktoTool(ToolBase):
|
||
|
def validate_instruction(self, instruction):
|
||
|
'''
|
||
|
检查指令,过滤规则----暂时屏蔽一些高性能参数
|
||
|
1.-ssl 强制启用 SSL/TLS 连接扫描,若目标服务器未优化加密处理,可能导致资源消耗过大
|
||
|
:param instruction:
|
||
|
:return:
|
||
|
'''
|
||
|
timeout = 0
|
||
|
# 使用正则表达式匹配 -ssl 参数及其相邻的空格
|
||
|
cleaned_command = re.sub(r'\s+-ssl\b|\b-ssl\b', '', instruction, flags=re.IGNORECASE)
|
||
|
# 处理可能残留的多余空格
|
||
|
return re.sub(r'\s+', ' ', cleaned_command).strip(),timeout
|
||
|
|
||
|
|
||
|
def analyze_result(self, result,instruction,stderr,stdout):
|
||
|
# 检查结果
|
||
|
return result
|