Class: Ronin::Payloads::URLPayload
- Defined in:
- lib/ronin/payloads/url_payload.rb
Overview
Represents a payload which is hosted publicly at a specified URL.
Example
class MyHostedPayload < URLPayload
url 'https://evil.com/downloads/my_payload'
end
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Payload
Class Method Summary collapse
-
.payload_type ⇒ Symbol
private
Returns the type or kind of payload.
-
.url(new_url = nil) ⇒ String
Gets or sets the URL for the payload.
Instance Method Summary collapse
-
#build ⇒ Object
Builds the URL payload.
Methods inherited from Payload
#built?, #built_payload, #bytesize, #cleanup, #encode_payload, #encoded_payload, encoder_class, #initialize, #length, #perform_build, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #perform_validate, #postlaunch, #prelaunch, #rebuild_payload, #reencode_payload, register, #to_s, #validate
Constructor Details
This class inherits a constructor from Ronin::Payloads::Payload
Class Method Details
.payload_type ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This is used internally to map an payload class to a printable type.
Returns the type or kind of payload.
72 73 74 |
# File 'lib/ronin/payloads/url_payload.rb', line 72 def self.payload_type :url_payload end |
.url(new_url = nil) ⇒ String
Gets or sets the URL for the payload.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ronin/payloads/url_payload.rb', line 51 def self.url(new_url=nil) if new_url @url = new_url else @url || if superclass < URLPayload superclass.url || raise(NotImplementedError,"#{self} did not define a url") end end end |
Instance Method Details
#build ⇒ Object
Builds the URL payload.
79 80 81 |
# File 'lib/ronin/payloads/url_payload.rb', line 79 def build @payload = self.class.url end |