test: add x86/xor_dynamic badchars test

GSoC/Meterpreter_Web_Console
phra 2018-09-01 03:00:14 +02:00
parent 1ddd22d073
commit 16f2cd6910
No known key found for this signature in database
GPG Key ID: 91FF93D1B85D76B5
1 changed files with 20 additions and 0 deletions

View File

@ -11,6 +11,7 @@ RSpec.describe Msf::EncodedPayload do
'x86/shikata_ga_nai',
# Great rank
'x86/call4_dword_xor',
'x86/xor_dynamic',
'generic/none',
],
module_type: 'encoder',
@ -141,6 +142,25 @@ RSpec.describe Msf::EncodedPayload do
end
end
context 'with bad characters: "\\x00\\x0a\\x0d"' do
let(:badchars) { "\x00\x0a\x0d".force_encoding('binary') }
let(:ancestor_reference_names) {
%w{singles/linux/x86/meterpreter_reverse_tcp}
}
let(:reference_name) {
'linux/x86/meterpreter_reverse_tcp'
}
specify 'chooses x86/xor_dynamic' do
expect(encoded_payload.encoder.refname).to eq("x86/xor_dynamic")
end
specify do
expect(encoded_payload.encoded).not_to include(badchars)
end
end
end