Module: Ronin::Nmap::CLI::Importable Private

Includes:
Core::CLI::Logging, DB::CLI::Printing
Included in:
Commands::Import, Commands::Scan
Defined in:
lib/ronin/nmap/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 nmap XML into the ronin-db database.

Class Method Summary collapse

Instance Method Summary collapse

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:



46
47
48
# File 'lib/ronin/nmap/cli/importable.rb', line 46

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

Instance Method Details

#import_file(xml_file) ⇒ 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 an nmap XML file into the ronin-db database.

Parameters:

  • xml_file (String)

    The path to the nmap XML file to import.



58
59
60
61
62
63
64
# File 'lib/ronin/nmap/cli/importable.rb', line 58

def import_file(xml_file)
  Importer.import_file(xml_file) do |record|
    if (type = record_type(record))
      log_info "Imported #{type}: #{record}"
    end
  end
end