Module: Ronin::Vulns::CLI::Importable Private

Includes:
DB::CLI::Printing, Printing
Included in:
WebVulnCommand
Defined in:
lib/ronin/vulns/cli/importable.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Mixin module which adds the ability to import web vulns into the ronin-db database.

Since:

  • 0.2.0

Constant Summary

Constants included from Printing

Printing::VULN_TYPES

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Printing

#log_vuln, #print_vuln, #print_vulns, #vuln_param_name, #vuln_param_type, #vuln_type

Class Method Details

.included(command) ⇒ 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.

Includes Ronin::DB::CLI::DatabaseOptions into the including command class.

Parameters:

Since:

  • 0.2.0



48
49
50
# File 'lib/ronin/vulns/cli/importable.rb', line 48

def self.included(command)
  command.include DB::CLI::DatabaseOptions
end

Instance Method Details

#import_vuln(vuln) ⇒ 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.

Imports a web vulnerability into the ronin-db database.

Parameters:

  • vuln (WebVuln)

    The web vulnerability to import.

Since:

  • 0.2.0



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/ronin/vulns/cli/importable.rb', line 60

def import_vuln(vuln)
  Importer.import(vuln)

  vuln_type  = vuln_type(vuln)
  param_type = vuln_param_type(vuln)
  param_name = vuln_param_name(vuln)

  if (param_type && param_name)
    log_info "Imported #{vuln_type} vulnerability on URL #{vuln.url} and #{param_type} '#{param_name}'"
  else
    log_info "Imported #{vuln_type} vulnerability on URL #{vuln.url}"
  end
end