Changed encoding on jscript contents before uploading it
parent
31f85b905a
commit
bcbb7b86d6
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue