modules/illScrappy/metasploit-framework/lib/msf/core/payload_generator.rb
def generate_raw_payload
      if payload == 'stdin'
        if arch.blank?
          raise IncompatibleArch, "You must select an arch for a custom payload"
        elsif platform.blank?
          raise IncompatiblePlatform, "You must select a platform for a custom payload"
        end
        stdin
      else
        payload_module = framework.payloads.create(payload)

        chosen_platform = choose_platform(payload_module)
        if chosen_platform.platforms.empty?
          raise IncompatiblePlatform, "The selected platform is incompatible with the payload"
        end

        chosen_arch = choose_arch(payload_module)
        unless chosen_arch
          raise IncompatibleArch, "The selected arch is incompatible with the payload"
        end

        payload_module.generate_simple(
            'Format'      => 'raw',
            'Options'     => datastore,
            'Encoder'     => nil,
            'MaxSize'     => @space,
            'DisableNops' => true
        )
      end
    end
# This method generates the raw form of the payload as generated by the payload module itself.
# @raise [Msf::IncompatiblePlatform] if no platform was selected for a stdin payload
# @raise [Msf::IncompatibleArch] if no arch was selected for a stdin payload
# @raise [Msf::IncompatiblePlatform] if the platform is incompatible with the payload
# @raise [Msf::IncompatibleArch] if the arch is incompatible with the payload
# @return [String] the raw bytes of the payload to be generated
This method generates the raw form of the payload as generated by the payload module itself.
This method generates the raw form of the payload as generated by the payload module itself .
def generate_raw_payload
      if payload == 'stdin'
        if arch.blank?
          raise IncompatibleArch, "You must select an arch for a custom payload"
        elsif platform.blank?
          raise IncompatiblePlatform, "You must select a platform for a custom payload"
        end
        stdin
      else
        payload_module = framework.payloads.create(payload)
        chosen_platform = choose_platform(payload_module)
        if chosen_platform.platforms.empty?
          raise IncompatiblePlatform, "The selected platform is incompatible with the payload"
        end
        chosen_arch = choose_arch(payload_module)
        unless chosen_arch
          raise IncompatibleArch, "The selected arch is incompatible with the payload"
        end
        payload_module.generate_simple(
            'Format'      => 'raw',
            'Options'     => datastore,
            'Encoder'     => nil,
            'MaxSize'     => @space,
            'DisableNops' => true
        )
      end
    end
def generate_raw_payload if payload == 'stdin' if arch . blank? raise IncompatibleArch , "You must select an arch for a custom payload" elsif platform . blank? raise IncompatiblePlatform , "You must select a platform for a custom payload" end stdin else payload_module = framework . payloads . create ( payload ) chosen_platform = choose_platform ( payload_module ) if chosen_platform . platforms . empty? raise IncompatiblePlatform , "The selected platform is incompatible with the payload" end chosen_arch = choose_arch ( payload_module ) unless chosen_arch raise IncompatibleArch , "The selected arch is incompatible with the payload" end payload_module . generate_simple ( 'Format' => 'raw' , 'Options' => datastore , 'Encoder' => nil , 'MaxSize' => @space , 'DisableNops' => true ) end end
This method generates the raw form of the payload as generated by the payload module itself.
This method generates the raw form of the payload as generated by the payload module itself .
the raw bytes of the payload to be generated
the raw bytes of the payload to be generated
String
[Msf::IncompatiblePlatform] if no platform was selected for a stdin payload
[ Msf :: IncompatiblePlatform ] if no platform was selected for a stdin payload
[Msf::IncompatibleArch] if no arch was selected for a stdin payload
[ Msf :: IncompatibleArch ] if no arch was selected for a stdin payload
[Msf::IncompatiblePlatform] if the platform is incompatible with the payload
[ Msf :: IncompatiblePlatform ] if the platform is incompatible with the payload
[Msf::IncompatibleArch] if the arch is incompatible with the payload
[ Msf :: IncompatibleArch ] if the arch is incompatible with the payload