Module: Msf::DBManager::DbExport

Included in:
Msf::DBManager
Defined in:
lib/msf/core/db_manager/db_export.rb

Instance Method Summary collapse

Instance Method Details

#run_db_export(opts) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/msf/core/db_manager/db_export.rb', line 4

def run_db_export(opts)
  wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)
  exporter = Msf::DBManager::Export.new(wspace)

  output_file = exporter.send("to_#{opts[:format]}_file".intern, opts[:path]) do |mtype, mstatus, mname|
    if mtype == :status
      if mstatus == Msf::DBManager::Export::STATUS_START
        ilog "    >> Starting export of #{mname}"
      end
      if mstatus == Msf::DBManager::Export::STATUS_COMPLETE
        ilog "    >> Finished export of #{mname}"
      end
    end
  end

  File.expand_path(output_file)
end