Class: Ronin::UI::CLI::Commands::Payloads

Inherits:
ResourcesCommand
  • Object
show all
Defined in:
lib/ronin/ui/cli/commands/payloads.rb

Instance Method Summary collapse

Instance Method Details


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
# File 'lib/ronin/ui/cli/commands/payloads.rb', line 62

def print_resource(payload)
  unless verbose?
    puts "  #{payload}"
    return
  end

  print_section "Payload: #{payload}" do
    puts "Name: #{payload.name}"
    puts "Version: #{payload.version}"
    puts "Type: #{payload.type}" if verbose?
    puts "Status: #{payload.status}"
    puts "Released: #{payload.released}"
    puts "Reported: #{payload.reported}"
    puts "License: #{payload.license}" if payload.license
    puts "Arch: #{payload.arch}"       if payload.arch
    puts "OS: #{payload.os}"           if payload.os

    spacer

    if payload.description
      puts "Description:"
      spacer

      indent do
        payload.description.each_line { |line| puts line }
      end

      spacer
    end

    unless payload.authors.empty?
      print_section "Authors" do
        payload.authors.each do |author|
          payload.authors.each { |author| puts author }
        end
      end
    end

    begin
      payload.load_script!
    rescue Exception => error
      print_exception error
    end

    unless payload.params.empty?
      print_array payload.params.values, title: 'Parameters'
    end
  end
end