Decode the badchars string correctly.

bug/bundler_fix
Joe Vennix 2014-09-20 17:48:03 -05:00
parent a846d084ca
commit d9a713b415
No known key found for this signature in database
GPG Key ID: 127B05FB3E85A2B0
2 changed files with 4 additions and 2 deletions

View File

@ -364,7 +364,9 @@ module Msf
iterations.times do |x| iterations.times do |x|
shellcode = encoder_module.encode(shellcode.dup, badchars, nil, platform_list) shellcode = encoder_module.encode(shellcode.dup, badchars, nil, platform_list)
cli_print "#{encoder_module.refname} succeeded with size #{shellcode.length} (iteration=#{x})" cli_print "#{encoder_module.refname} succeeded with size #{shellcode.length} (iteration=#{x})"
raise EncoderSpaceViolation, "encoder has made a buffer that is too big" if shellcode.length > space if shellcode.length > space
raise EncoderSpaceViolation, "encoder has made a buffer that is too big"
end
end end
shellcode shellcode
end end

View File

@ -99,7 +99,7 @@ require 'msf/core/payload_generator'
end end
opt.on('-b', '--bad-chars <list>', String, 'The list of characters to avoid example: \'\x00\xff\'') do |b| opt.on('-b', '--bad-chars <list>', String, 'The list of characters to avoid example: \'\x00\xff\'') do |b|
opts[:badchars] = b opts[:badchars] = Rex::Text.hex_to_raw(b)
end end
opt.on('-i', '--iterations <count>', Integer, 'The number of times to encode the payload') do |i| opt.on('-i', '--iterations <count>', Integer, 'The number of times to encode the payload') do |i|