From 3ec37b14a62164b8fd0cd25bfe6ad646f101b8e2 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Mon, 30 Jun 2014 20:23:57 +0100 Subject: [PATCH] trying some more encoding as the file wasnt exactly the same - issue #742 --- plugins/dbms/mssqlserver/filesystem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/dbms/mssqlserver/filesystem.py b/plugins/dbms/mssqlserver/filesystem.py index 0b3be8c67..cfa11ac17 100644 --- a/plugins/dbms/mssqlserver/filesystem.py +++ b/plugins/dbms/mssqlserver/filesystem.py @@ -184,7 +184,8 @@ class Filesystem(GenericFilesystem): $Content = [System.Convert]::FromBase64String("%s") Set-Content -Path %s -Value $Content -Encoding Byte """ % (encodedFileContent, randPSScriptPath) - psString = binToHexQuery.replace(" ", "").replace("\n", ";") + + psString = psString.replace(" ", "").replace("\n", ";") logger.debug("uploading the PowerShell script to %s, please wait.." % randPSScriptPath) self.xpCmdshellWriteFile(psString, tmpPath, randPSScript)