Skip to content

Commit 7ccc86d

Browse files
committed
Use cmd_exec
1 parent 31b7ef4 commit 7ccc86d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/exploits/windows/local/persistence.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ def target_exec(script_on_target)
230230
# Error handling for process.execute() can throw a RequestError in send_request.
231231
begin
232232
unless datastore['EXE::Custom']
233-
session.shell_command_token(script_on_target)
233+
cmd_exec("wscript \"#{script_on_target}\"")
234234
else
235-
session.shell_command_token("cscript \"#{script_on_target}\"")
235+
cmd_exec("cscript \"#{script_on_target}\"")
236236
end
237237
rescue
238238
print_error("Failed to execute payload on target")

0 commit comments

Comments
 (0)