final generation and specs
generation wrapped method complete with specsbug/bundler_fix
parent
4dcae920f8
commit
fc9105d862
|
@ -74,7 +74,7 @@ module Msf
|
|||
|
||||
# @return [String] A string containing the bytes of the payload in the format selected
|
||||
def generate_payload
|
||||
if platform == "java" or arch == "java"
|
||||
if platform == "java" or arch == "java" or payload.start_with? "java/"
|
||||
generate_java_payload
|
||||
else
|
||||
raw_payload = generate_raw_payload
|
||||
|
|
|
@ -494,4 +494,27 @@ describe Msf::PayloadGenerator do
|
|||
end
|
||||
end
|
||||
|
||||
context '#generate_payload' do
|
||||
|
||||
it 'calls each step of the process' do
|
||||
my_generator = payload_generator
|
||||
my_generator.should_receive(:generate_raw_payload).and_call_original
|
||||
my_generator.should_receive(:add_shellcode).and_call_original
|
||||
my_generator.should_receive(:encode_payload).and_call_original
|
||||
my_generator.should_receive(:prepend_nops).and_call_original
|
||||
my_generator.should_receive(:format_payload).and_call_original
|
||||
my_generator.generate_payload
|
||||
end
|
||||
|
||||
context 'when the payload is java' do
|
||||
let(:payload) { "java/meterpreter/reverse_tcp" }
|
||||
|
||||
it 'calls generate_java_payload' do
|
||||
my_generator = payload_generator
|
||||
my_generator.should_receive(:generate_java_payload)
|
||||
my_generator.generate_payload
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue