Module: Ronin::Payloads::Helpers::Chained

Includes:
Ronin::Payloads::HasPayload
Defined in:
lib/ronin/payloads/helpers/chained.rb

Overview

Allows a payload to wrap around another payload, creating a chain of payloads that will deploy in order.

Instance Attribute Summary

Attributes included from Ronin::Payloads::HasPayload

#payload

Instance Method Summary collapse

Methods included from Ronin::Payloads::HasPayload

#default_payload, #initialize, #method_missing, #payload_class, #respond_to?, #use_payload!, #use_payload_from!

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ronin::Payloads::HasPayload

Instance Method Details

#build!(options = {}, &block) ⇒ Object

Builds the chained payload first, then the payload.

See Also:


53
54
55
56
57
# File 'lib/ronin/payloads/helpers/chained.rb', line 53

def build!(options={},&block)
  @payload.build!() if @payload

  return super(options,&block)
end

#chain(sub_payload) ⇒ Payload

Chains the payload to another payload.


44
45
46
# File 'lib/ronin/payloads/helpers/chained.rb', line 44

def chain(sub_payload)
  self.payload = sub_payload
end

#deploy! {|(payload)| ... } ⇒ Payload

Verifies the built payload and deploys the payload. After the payload has been deployed, the chained payload will then be deployed.

Yields:

  • ((payload))

    If a block is given, the chained payload will be passed to the block.

Yield Parameters:

  • payload (Payload)

    The chained payload.

See Also:

  • Payload#deploy!

76
77
78
79
80
81
82
83
# File 'lib/ronin/payloads/helpers/chained.rb', line 76

def deploy!(&block)
  if @payload
    super()
    return @payload.deploy!(&block)
  end

  return super(&block)
end