Exploit database

GH-2f0cd68c1ebec57852b6f70ecd63d5d2

pblittle/aws-suture

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2014-0160

106 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files4
pblittle/aws-sutureRevision 6fc8113777ae

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

lib/suture/report.rb

Ruby · 1,866 bytes
require 'suture/aws'

module Suture
  class Report
    require 'command_line_reporter'
    include CommandLineReporter

    attr_reader :servers
    attr_reader :check_command
    attr_reader :check_result

    def initialize(servers = [], check_command, check_result)
      @servers = servers
      @check_command = check_command
      @check_result = check_result
    end

    def render
      print_report_header

      servers.each do |server|
        table(:border => true) do
          print_report_body(server) if server.ready?
        end
      end
    end

    def print_report_header
      table(:border => true) do
        row do
          column('Server ID', :width => 12)
          column('OpenSSL Version', :width => 36)
          column('Name', :width => 28)
          column('Public IP', :width => 16)
          column('Key Name', :width => 24)
        end
      end
    end

    def print_report_body(server)
      begin
        checks = server.ssh(check_command)
        check_results = results(checks)

        result = check_results[0].strip
        result_color = result_color(result)
      rescue StandardError => error
        result = error.message
        result_color = 'blue'
      end

      row do
        column(server.id, :color => result_color, :width => 12)
        column(result, :color => result_color, :width => 38)
        column(server.tags['Name'], :color => result_color, :width => 26)
        column(server.public_ip_address, :color => result_color, :width => 16)
        column(server.key_name, :color => result_color, :width => 24)
      end
    end

    def results(checks)
      checks.reduce([]) do |result, check|
        result << check.stdout
        result
      end
    end

    def result_color(result)
      if /#{check_result}/m.match(result)
        'green'
      else
        'red'
      end
    end
  end
end