Changed encoding on jscript contents before uploading it

bug/bundler_fix
bwatters_r7 2017-01-13 16:19:58 -06:00
parent 31f85b905a
commit bcbb7b86d6
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ class MetasploitModule < Msf::Post
script_file = File.read(File.join(Msf::Config.data_directory, "post", "zip", "zip.js"))
src.gsub!("\\", "\\\\\\")
dst.gsub!("\\", "\\\\\\")
script_file << "zip(\"#{src}\",\"#{dst}\");"
script_file << "zip(\"#{src}\",\"#{dst}\");".force_encoding("UTF-8")
script_file
end
@ -92,7 +92,7 @@ class MetasploitModule < Msf::Post
script = wsh_script(datastore['DESTINATION'], datastore['SOURCE'])
tmp_path = "#{get_env('TEMP')}\\zip.js"
print_status("script file uploaded to #{tmp_path}")
write_file(tmp_path, script)
write_file(tmp_path, script.encode("UTF-16LE"))
cmd_exec("cscript.exe #{tmp_path}")
end