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.

26 lines
838 B

2 months ago
import os
import shlex
import re
2 months ago
from tools.ToolBase import ToolBase
class SmtpuserenumTool(ToolBase):
def validate_instruction(self, instruction):
timeout = 0
# 获取当前程序所在目录
current_path = os.path.dirname(os.path.realpath(__file__))
new_user_path = os.path.join(current_path, "../payload", "users")
match = re.search(r'-U\s+(\S+)', instruction)
if match:
file_path = match.group(1)
# 检查该文件是否存在
if not os.path.isfile(file_path):
# 替换原文件路径为新的路径
instruction = instruction.replace(file_path, new_user_path)
return instruction,timeout
2 months ago
def analyze_result(self, result,instruction,stderr,stdout):
#指令结果分析
return result