The check for required decoder hasn't a lot of sense

bug/bundler_fix
jvazquez-r7 2014-02-09 16:31:02 -06:00 committed by Spencer McIntyre
parent 9c6a521b94
commit ddd1dd5155
1 changed files with 2 additions and 12 deletions

View File

@ -138,15 +138,13 @@ module Exploit::CmdStager
# @option opts :flavor [Symbol] The cmd stager to use.
# @option opts :decoder [Symbol] The decoder stub to use.
# @return [void]
# @raise [ArgumentError] raised if a cmd stager can not be selected, it isn't
# compatible with the target platform or a required decoder stub can not be
# selected.
# @raise [ArgumentError] raised if a cmd stager can not be selected or it
# isn't compatible with the target platform.
def select_cmdstager(opts = {})
self.flavor = select_flavor(opts)
raise ArgumentError, "Unable to select CMD Stager" if flavor.nil?
raise ArgumentError, "The CMD Stager selected isn't compatible with the target" unless compatible?(flavor)
self.decoder = select_decoder(opts)
raise ArgumentError, "Unable to select decoder stub" if decoder.nil? && decoder_required?(flavor)
end
@ -179,14 +177,6 @@ module Exploit::CmdStager
DECODERS[f]
end
# Answers if the input flavor needs a decoder stub.
#
# @param f [Symbol] the input flavor.
# @return [Boolean] true if the flavor needs a decoder, false otherwise.
def decoder_required?(f)
!DECODERS[f].nil?
end
# Selects the correct cmd stager decoder to use based on three rules: (1) use
# the decoder provided in input options, (2) use the decoder provided by the
# user through datastore options, (3) select the default decoder for the