Class: Ronin::UI::CLI::Commands::Exploits

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

Instance Method Summary collapse

Instance Method Details


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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/ronin/ui/cli/commands/exploits.rb', line 70

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

  print_section "Exploit: #{exploit}" do
    puts "Name: #{exploit.name}"
    puts "Version: #{exploit.version}"
    puts "Type: #{exploit.type}" if verbose?
    puts "Status: #{exploit.status}"
    puts "Released: #{exploit.released}"
    puts "Reported: #{exploit.reported}"
    puts "License: #{exploit.license}" if exploit.license

    if exploit.description
      puts "Description:"
      spacer

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

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

    unless exploit.targets.empty?
      exploit.targets.each do |target|
        print_section "Target" do
          puts "Arch: #{target.arch}"         if target.arch
          puts "OS: #{target.os}"             if target.os
          puts "Software: #{target.software}" if target.software

          if exploit.description
            puts "Description:"

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

            spacer
          end
        end

        unless target.data.empty?
          print_section "Target Data" do
            target.data.each do |name,value|
              puts "#{name} [#{value.inspect}]"
            end
          end
        end
      end
    end

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

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