Class: Ronin::Masscan::CLI::Commands::Import Private

Inherits:
Ronin::Masscan::CLI::Command show all
Includes:
Importable
Defined in:
lib/ronin/masscan/cli/commands/import.rb

Overview

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

The ronin-masscan import command.

Usage

ronin-masscan import [options] MASSCAN_FILE

Options

    --db NAME                    The database to connect to (Default: default)
    --db-uri URI                 The database URI to connect to
-F binary|list|json|ndjson,      Specifies the format of the scan file
    --format
-h, --help                       Print help information

Arguments

MASSCAN_FILE                     The masscan scan file to import

Instance Method Summary collapse

Methods included from Importable

#import_file, included

Instance Method Details

#run(masscan_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.

Runs the ronin-masscan import command.

Parameters:

  • masscan_file (String)

    The masscan scan file to import.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/ronin/masscan/cli/commands/import.rb', line 72

def run(masscan_file)
  unless File.file?(masscan_file)
    print_error "no such file or directory: #{masscan_file}"
    exit(1)
  end

  require 'ronin/db'
  require 'ronin/masscan/importer'

  DB.connect

  if options[:format]
    import_file(masscan_file, format: options[:format])
  else
    import_file(masscan_file)
  end
end