metasploit-framework/lib/msf/java/jmx/discovery.rb

30 lines
884 B
Ruby
Raw Normal View History

2015-01-16 03:18:03 +00:00
# -*- coding: binary -*-
module Msf
2015-02-10 16:58:57 +00:00
module Java
module Jmx
# This module provides methods which help to handle JMX end points discovery
module Discovery
# Builds a Rex::Java::Serialization::Model::Stream to discover
# an JMX RMI endpoint
#
# @return [Rex::Java::Serialization::Model::Stream]
def discovery_stream
obj_id = "\x00" * 22 # Padding since there isn't an UnicastRef ObjId to use still
2015-02-10 16:58:57 +00:00
block_data = Rex::Java::Serialization::Model::BlockData.new(
nil,
"#{obj_id}\x00\x00\x00\x02\x44\x15\x4d\xc9\xd4\xe6\x3b\xdf"
)
2015-01-20 17:18:18 +00:00
2015-02-10 16:58:57 +00:00
stream = Rex::Java::Serialization::Model::Stream.new
stream.contents << block_data
stream.contents << Rex::Java::Serialization::Model::Utf.new(nil, 'jmxrmi')
2015-01-16 03:18:03 +00:00
2015-02-10 16:58:57 +00:00
stream
end
2015-01-16 03:18:03 +00:00
end
end
end
end