From 1b97cebac3edfd5f70c8a9cebb57d87cb571b78e Mon Sep 17 00:00:00 2001 From: Marshall Hallenbeck Date: Thu, 21 Sep 2023 23:44:05 -0400 Subject: [PATCH] fix escaping in smbexec --- nxc/protocols/smb/smbexec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxc/protocols/smb/smbexec.py b/nxc/protocols/smb/smbexec.py index 81a70f92..7e1dbfbc 100755 --- a/nxc/protocols/smb/smbexec.py +++ b/nxc/protocols/smb/smbexec.py @@ -114,7 +114,7 @@ class SMBEXEC: self.__batchFile = gen_random_string(6) + ".bat" if self.__retOutput: - command = self.__shell + "echo " + data + f" ^> \\\\127.0.0.1\\{self.__share_name}\\{self.__output} 2^>^&1 > %TEMP%\\{self.__batchFile} & %COMSPEC% /Q /c %TEMP%\{self.__batchFile} & %COMSPEC% /Q /c del %TEMP%\\{self.__batchFile}" + command = self.__shell + "echo " + data + f" ^> \\\\127.0.0.1\\{self.__share_name}\\{self.__output} 2^>^&1 > %TEMP%\\{self.__batchFile} & %COMSPEC% /Q /c %TEMP%\\{self.__batchFile} & %COMSPEC% /Q /c del %TEMP%\\{self.__batchFile}" else: command = self.__shell + data