Skip to content

Commit bcbb7b8

Browse files
committed
Changed encoding on jscript contents before uploading it
1 parent 31f85b9 commit bcbb7b8

File tree

1 file changed

+2
-2
lines changed
  • modules/post/multi/manage

1 file changed

+2
-2
lines changed

modules/post/multi/manage/zip.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def wsh_script(dst, src)
4343
script_file = File.read(File.join(Msf::Config.data_directory, "post", "zip", "zip.js"))
4444
src.gsub!("\\", "\\\\\\")
4545
dst.gsub!("\\", "\\\\\\")
46-
script_file << "zip(\"#{src}\",\"#{dst}\");"
46+
script_file << "zip(\"#{src}\",\"#{dst}\");".force_encoding("UTF-8")
4747
script_file
4848
end
4949

@@ -92,7 +92,7 @@ def upload_exec_wsh_script_zip
9292
script = wsh_script(datastore['DESTINATION'], datastore['SOURCE'])
9393
tmp_path = "#{get_env('TEMP')}\\zip.js"
9494
print_status("script file uploaded to #{tmp_path}")
95-
write_file(tmp_path, script)
95+
write_file(tmp_path, script.encode("UTF-16LE"))
9696
cmd_exec("cscript.exe #{tmp_path}")
9797
end
9898

0 commit comments

Comments
 (0)