From 29c68ef1ec2b8a8b20d121be953057a63432c4dd Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Tue, 10 Feb 2015 11:55:14 -0600 Subject: [PATCH] End fixing namespaces --- lib/msf/java/jmx.rb | 54 ++++++++++--------- .../exploits/multi/misc/java_jmx_server.rb | 4 +- .../exploits/multi/misc/java_rmi_server.rb | 2 +- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/lib/msf/java/jmx.rb b/lib/msf/java/jmx.rb index 269747b906..0c796daf2d 100644 --- a/lib/msf/java/jmx.rb +++ b/lib/msf/java/jmx.rb @@ -3,35 +3,37 @@ require 'rex/java/serialization' module Msf - module Jmx - require 'msf/java/jmx/util' - require 'msf/java/jmx/discovery' - require 'msf/java/jmx/handshake' - require 'msf/java/jmx/mbean' + module Java + module Jmx + require 'msf/java/jmx/util' + require 'msf/java/jmx/discovery' + require 'msf/java/jmx/handshake' + require 'msf/java/jmx/mbean' - include Msf::Java::Jmx::Util - include Msf::Java::Jmx::Discovery - include Msf::Java::Jmx::Handshake - include Msf::Java::Jmx::Mbean + include Msf::Java::Jmx::Util + include Msf::Java::Jmx::Discovery + include Msf::Java::Jmx::Handshake + include Msf::Java::Jmx::Mbean - def initialize(info = {}) - super + def initialize(info = {}) + super + + register_options( + [ + Msf::OptString.new('JMX_ROLE', [false, 'The role to interact with an authenticated JMX endpoint']), + Msf::OptString.new('JMX_PASSWORD', [false, 'The password to interact with an authenticated JMX endpoint']) + ], HTTP::Wordpress + ) + end + + def jmx_role + datastore['JMX_ROLE'] + end + + def jmx_password + datastore['JMX_PASSWORD'] + end - register_options( - [ - Msf::OptString.new('JMX_ROLE', [false, 'The role to interact with an authenticated JMX endpoint']), - Msf::OptString.new('JMX_PASSWORD', [false, 'The password to interact with an authenticated JMX endpoint']) - ], HTTP::Wordpress - ) end - - def jmx_role - datastore['JMX_ROLE'] - end - - def jmx_password - datastore['JMX_PASSWORD'] - end - end end diff --git a/modules/exploits/multi/misc/java_jmx_server.rb b/modules/exploits/multi/misc/java_jmx_server.rb index 5c2085eff0..0e96e0af72 100644 --- a/modules/exploits/multi/misc/java_jmx_server.rb +++ b/modules/exploits/multi/misc/java_jmx_server.rb @@ -8,9 +8,9 @@ require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking - include Msf::Jmx + include Msf::Java::Jmx include Msf::Exploit::Remote::HttpServer - include Msf::Rmi::Client + include Msf::Java::Rmi::Client def initialize(info = {}) super(update_info(info, diff --git a/modules/exploits/multi/misc/java_rmi_server.rb b/modules/exploits/multi/misc/java_rmi_server.rb index e49b00dc25..53697867d1 100644 --- a/modules/exploits/multi/misc/java_rmi_server.rb +++ b/modules/exploits/multi/misc/java_rmi_server.rb @@ -8,7 +8,7 @@ require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking - include Msf::Rmi::Client + include Msf::Java::Rmi::Client include Msf::Exploit::Remote::HttpServer def initialize(info = {})