from tools.ToolBase import ToolBase import shlex class SmbclientTool(ToolBase): def validate_instruction(self, instruction): #指令过滤 timeout = 0 instruction = instruction.replace("\\", "\\\\") #instruction = shlex.quote(instruction) #smbclient \\\\192.168.204.137\\tmp -N -c 'put /etc/passwd test_upload; rm test_upload' 针对这样的指令会出错 return instruction,timeout def analyze_result(self, result,instruction,stderr,stdout): #指令结果分析 return result