Module: Msf::DBManager::Import::OpenVAS

Included in:
Msf::DBManager::Import
Defined in:
lib/msf/core/db_manager/import/open_vas.rb

Instance Method Summary collapse

Instance Method Details

#import_openvas_new_xml(args = {}, &block) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/msf/core/db_manager/import/open_vas.rb', line 13

def import_openvas_new_xml(args={}, &block)
  wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name
  if Rex::Parser.nokogiri_loaded
    parser = "Nokogiri v#{::Nokogiri::VERSION}"
    noko_args = args.dup
    noko_args[:workspace] = wspace
    if block
      yield(:parser, parser)
      import_openvas_noko_stream(noko_args) {|type, data| yield type,data}
    else
      import_openvas_noko_stream(noko_args)
    end
    return true
  else # Sorry
    raise Msf::DBImportError.new("Could not import due to missing Nokogiri parser. Try 'gem install nokogiri'.")
  end
end

#import_openvas_noko_stream(args = {}, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/msf/core/db_manager/import/open_vas.rb', line 3

def import_openvas_noko_stream(args={}, &block)
  if block
    doc = Rex::Parser::OpenVASDocument.new(args,framework.db) {|type, data| yield type,data }
  else
    doc = Rex::Parser::OpenVASDocument.new(args,self)
  end
  parser = ::Nokogiri::XML::SAX::Parser.new(doc)
  parser.parse(args[:data])
end

#import_openvas_xml(args = {}, &block) ⇒ Object

Of course they had to change the nessus format.

Raises:



34
35
36
# File 'lib/msf/core/db_manager/import/open_vas.rb', line 34

def import_openvas_xml(args={}, &block)
  raise Msf::DBImportError.new("No OpenVas XML support. Please submit a patch to msfdev[at]metasploit.com")
end