From f8bfe833d8ab34eb864b658497f845f03dac7c59 Mon Sep 17 00:00:00 2001 From: mpgn Date: Fri, 17 Jun 2022 16:51:12 -0400 Subject: [PATCH] Smbexec improvement "STATUS_OBJECT_NAME_NOT_FOUND" with server 2019 https://github.com/SecureAuthCorp/impacket/issues/777#issuecomment-1048253251 --- cme/protocols/smb/smbexec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cme/protocols/smb/smbexec.py b/cme/protocols/smb/smbexec.py index f14ec5b9..7972021e 100755 --- a/cme/protocols/smb/smbexec.py +++ b/cme/protocols/smb/smbexec.py @@ -87,7 +87,7 @@ class SMBEXEC: self.__batchFile = gen_random_string(6) + '.bat' if self.__retOutput: - command = self.__shell + 'echo '+ data + ' ^> \\\\127.0.0.1\\{}\\{} 2^>^&1 > %TEMP%\{} & %COMSPEC% /Q /c %TEMP%\{} & del %TEMP%\{}'.format(self.__share_name, self.__output, self.__batchFile, self.__batchFile, self.__batchFile) + command = self.__shell + 'echo '+ data + ' ^> \\\\127.0.0.1\\{}\\{} 2^>^&1 > %TEMP%\{} & %COMSPEC% /Q /c %TEMP%\{} & %COMSPEC% /Q /c del %TEMP%\{}'.format(self.__share_name, self.__output, self.__batchFile, self.__batchFile, self.__batchFile) else: command = self.__shell + data