diff --git a/spec/lib/msf/core/encoded_payload_spec.rb b/spec/lib/msf/core/encoded_payload_spec.rb index ef9eb94ccb..de496bc34b 100644 --- a/spec/lib/msf/core/encoded_payload_spec.rb +++ b/spec/lib/msf/core/encoded_payload_spec.rb @@ -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