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 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.
89 90 91 92 93 |
# File 'lib/ronin/payloads/cli/commands/new.rb', line 89 def initialize(**kwargs) super(**kwargs) @payload_type = PAYLOAD_TYPES.fetch(:payload) 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.
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/ronin/payloads/cli/commands/new.rb', line 101 def run(file) @directory = File.dirname(file) @file_name = File.basename(file,File.extname(file)) @class_name = CommandKit::Inflector.camelize(@file_name) mkdir @directory unless @directory == '.' erb "payload.rb.erb", file chmod '+x', file end |