From 2d8782d7113dd20439399e9ead659ff06580e86a Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Tue, 17 Mar 2015 11:48:38 -0500 Subject: [PATCH] Fix RMI specs --- spec/lib/msf/java/rmi/client/streams_spec.rb | 20 +++++++++++++++++--- spec/lib/msf/java/rmi/client_spec.rb | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/spec/lib/msf/java/rmi/client/streams_spec.rb b/spec/lib/msf/java/rmi/client/streams_spec.rb index 0f92c1952b..9d7cdf2634 100644 --- a/spec/lib/msf/java/rmi/client/streams_spec.rb +++ b/spec/lib/msf/java/rmi/client/streams_spec.rb @@ -22,13 +22,27 @@ describe Msf::Java::Rmi::Client::Streams do end let(:opts_header) { "JRMI\x00\x01\x4d" } - let(:default_call) { "\x50\xac\xed\x00\x05" } + let(:default_call) do + "\x50\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\xff\xff\xff" + + "\xff\x00\x00\x00\x00\x00\x00\x00\x00" + end let(:call_opts) do { - :message_id => Rex::Proto::Rmi::Model::PING_MESSAGE + message_id: Rex::Proto::Rmi::Model::CALL_MESSAGE, + object_number: 2, + uid_number: 0, + uid_time: 0, + uid_count: 0, + operation: 0, + hash: 0xf6b6898d8bf28643 } end - let(:opts_call) { "\x52\xac\xed\x00\x05" } + let(:opts_call) do + "\x50\xac\xed\x00\x05\x77\x22\x00\x00\x00\x00\x00\x00\x00\x02\x00" + + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + + "\x00\xf6\xb6\x89\x8d\x8b\xf2\x86\x43" + end let(:default_dgc_ack) { "\x54\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" } let(:dgc_ack_opts) do diff --git a/spec/lib/msf/java/rmi/client_spec.rb b/spec/lib/msf/java/rmi/client_spec.rb index 72665d3a66..0669e5fd1d 100644 --- a/spec/lib/msf/java/rmi/client_spec.rb +++ b/spec/lib/msf/java/rmi/client_spec.rb @@ -59,7 +59,7 @@ describe Msf::Java::Rmi::Client do describe "#send_call" do it "returns the number of bytes sent" do - expect(mod.send_call(sock: io)).to eq(5) + expect(mod.send_call(sock: io)).to eq(41) end end