metasploit-framework/spec/lib/msf/java/jmx/discovery_spec.rb

34 lines
837 B
Ruby
Raw Normal View History

2015-01-20 22:49:02 +00:00
# -*- coding:binary -*-
require 'spec_helper'
require 'rex/java'
require 'msf/jmx'
2015-01-20 23:29:48 +00:00
describe Msf::Jmx::Discovery do
2015-01-20 22:49:02 +00:00
subject(:mod) do
mod = ::Msf::Exploit.new
mod.extend ::Msf::Jmx
mod.send(:initialize)
mod
end
let(:stream_discovery) do
"\xac\xed\x00\x05\x77\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02" +
"\x44\x15\x4d\xc9\xd4\xe6\x3b\xdf\x74\x00\x06\x6a\x6d\x78\x72\x6d" +
"\x69"
end
describe "#discovery_stream" do
it "returns a Rex::Java::Serialization::Model::Stream" do
expect(mod.discovery_stream).to be_a(Rex::Java::Serialization::Model::Stream)
end
it "builds a valid stream to discover an jmxrmi endpoing" do
expect(mod.discovery_stream.encode).to eq(stream_discovery)
end
end
end