Class: Ronin::Payloads::CLI::Commands::New Private
- Inherits:
-
Ronin::Payloads::CLI::Command
- Object
- Core::CLI::Command
- Ronin::Payloads::CLI::Command
- Ronin::Payloads::CLI::Commands::New
- Includes:
- Core::CLI::Generator, Core::CLI::Generator::Options::Author, Core::CLI::Generator::Options::Description, Core::CLI::Generator::Options::Reference, Core::CLI::Generator::Options::Summary, Generator
- Defined in:
- lib/ronin/payloads/cli/commands/new.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Creates a new payload file.
Usage
ronin-payload new [options] FILE
Options
-t asm|shellcode|c|go|rust|command|shell|powershell|html|javascript|typescript|java|sql|php|python|ruby|nodejs,
--type The type for the new payload
-a, --author NAME The name of the author
-e, --author-email EMAIL The email address of the author
-S, --summary TEXT One sentence summary
-D, --description TEXT Longer description
-R, --reference URL Adds a reference URL
-h, --help Print help information
Arguments
FILE The path to the new payload file.
Constant Summary
Constants included from Generator
Instance Attribute Summary collapse
-
#references ⇒ Array<String>
readonly
private
The references to add to the payload.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ New
constructor
private
Initializes the
ronin-payloads new
command. -
#run(file) ⇒ Object
private
Runs the
ronin-payloads new
command.
Constructor Details
#initialize(**kwargs) ⇒ New
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.
Initializes the ronin-payloads new
command.
95 96 97 98 99 |
# File 'lib/ronin/payloads/cli/commands/new.rb', line 95 def initialize(**kwargs) super(**kwargs) @payload_type = PAYLOAD_TYPES.fetch(:payload) end |
Instance Attribute Details
#references ⇒ Array<String> (readonly)
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.
The references to add to the payload.
87 88 89 |
# File 'lib/ronin/payloads/cli/commands/new.rb', line 87 def references @references end |
Instance Method Details
#run(file) ⇒ Object
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.
Runs the ronin-payloads new
command.
107 108 109 110 111 112 113 |
# File 'lib/ronin/payloads/cli/commands/new.rb', line 107 def run(file) @file_name = File.basename(file,File.extname(file)) @class_name = CommandKit::Inflector.camelize(@file_name) erb "payload.rb.erb", file chmod '+x', file end |