Class: Ronin::Payloads::CLI::Commands::Show Private

Inherits:
PayloadCommand show all
Includes:
CommandKit::Printing::Fields, Core::CLI::Printing::Arch, Core::CLI::Printing::Metadata, Core::CLI::Printing::OS, Core::CLI::Printing::Params, Printing
Defined in:
lib/ronin/payloads/cli/commands/show.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.

Prints information about a payload.

Usage

ronin-payloads show [options] {--file FILE | NAME}

Options

-f, --file FILE                  The optional file to load the payload from
-v, --verbose                    Enables verbose output
-h, --help                       Print help information

Arguments

NAME                             The name of the payload to load

Constant Summary

Constants included from Printing

Printing::PAYLOAD_TYPES

Instance Attribute Summary

Attributes inherited from PayloadCommand

#payload, #payload_class

Instance Method Summary collapse

Methods included from Printing

#payload_type

Methods inherited from PayloadCommand

#initialize_payload, #load_payload, #load_payload_from, #validate_payload

Methods included from PayloadMethods

#initialize_payload, #load_payload, #load_payload_from, #validate_payload

Instance Method Details

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.

Prints the metadata for a payload class.

Parameters:



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/ronin/payloads/cli/commands/show.rb', line 84

def print_payload(payload)
  puts "[ #{payload.id} ]"
  puts

  indent do
    fields = {}

    fields['Type']    = payload_type(payload)
    fields['Summary'] = payload.summary if payload.summary

    if payload.include?(Metadata::Arch)
      if (arch = payload.arch)
        fields['Arch'] = arch_name(arch)
      end
    end

    if payload.include?(Metadata::OS)
      if (os = payload.os)
        fields['OS'] = os_name(os)
      end
    end

    print_fields(fields)
    puts

    print_authors(payload)
    print_description(payload)
    print_references(payload)
    print_params(payload)
  end
end

#run(name = nil) ⇒ 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 show command.

Parameters:

  • name (String) (defaults to: nil)

    The optional name of the payload to load and print metadata about.



73
74
75
76
77
# File 'lib/ronin/payloads/cli/commands/show.rb', line 73

def run(name=nil)
  super(name)

  print_payload(payload_class)
end