Class: Wpxf::Payloads::Custom
- Inherits:
-
Wpxf::Payload
- Object
- Wpxf::Payload
- Wpxf::Payloads::Custom
- Includes:
- Wpxf
- Defined in:
- lib/wpxf/payloads/custom.rb
Overview
A custom payload container.
Instance Attribute Summary
Attributes inherited from Wpxf::Payload
Attributes included from Options
Instance Method Summary collapse
- #encoded ⇒ Object
-
#initialize ⇒ Custom
constructor
A new instance of Custom.
- #payload_path ⇒ Object
- #prepare(mod) ⇒ Object
- #raw ⇒ Object
Methods included from Wpxf
app_path, build_module_list, change_stdout_sync, custom_modules_path, data_directory, databases_path, gemspec, home_directory, load_custom_modules, load_module, modules_path, payloads_path, version
Methods inherited from Wpxf::Payload
#check, #cleanup, #constants, #enqueue_command, #escape_single_quotes, #generate_vars, #obfuscated_variables, #php_preamble, #post_exploit, #random_var_name
Methods included from Options
#all_options_valid?, #get_option, #get_option_value, #missing_options, #normalized_option_value, #option_valid?, #option_value?, #register_advanced_options, #register_evasion_options, #register_option, #register_options, #scoped_option_change, #set_option_value, #unregister_option, #unset_option
Constructor Details
#initialize ⇒ Custom
Returns a new instance of Custom.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/wpxf/payloads/custom.rb', line 8 def initialize super unregister_option(get_option('encode_payload')) ([ StringOption.new( name: 'payload_path', required: true, desc: 'The path to the custom payload' ) ]) end |
Instance Method Details
#encoded ⇒ Object
21 22 23 |
# File 'lib/wpxf/payloads/custom.rb', line 21 def encoded raw end |
#payload_path ⇒ Object
25 26 27 |
# File 'lib/wpxf/payloads/custom.rb', line 25 def payload_path File.(datastore['payload_path']) end |
#prepare(mod) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/wpxf/payloads/custom.rb', line 29 def prepare(mod) unless File.exist?(payload_path) mod.emit_error "#{payload_path} does not exist" return false end true end |
#raw ⇒ Object
38 39 40 |
# File 'lib/wpxf/payloads/custom.rb', line 38 def raw File.open(payload_path, 'rb', &:read) end |