Extract Msf::DBManager::Import::Nessus::XML

MSP-11124
bug/bundler_fix
Luke Imhoff 2014-10-15 11:27:23 -05:00
parent 71af8fd9c2
commit a0494b2eeb
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
3 changed files with 24 additions and 21 deletions

View File

@ -413,27 +413,6 @@ module Msf::DBManager::Import
end
end
#
# Import Nessus XML v1 and v2 output
#
# Old versions of openvas exported this as well
#
def import_nessus_xml_file(args={})
filename = args[:filename]
wspace = args[:wspace] || workspace
data = ""
::File.open(filename, 'rb') do |f|
data = f.read(f.stat.size)
end
if data.index("NessusClientData_v2")
import_nessus_xml_v2(args.merge(:data => data))
else
import_nessus_xml(args.merge(:data => data))
end
end
def import_nessus_xml_v2(args={}, &block)
data = args[:data]
wspace = args[:wspace] || workspace

View File

@ -1,5 +1,7 @@
module Msf::DBManager::Import::Nessus
autoload :NBE, 'msf/core/db_manager/import/nessus/nbe'
autoload :XML, 'msf/core/db_manager/import/nessus/xml'
include Msf::DBManager::Import::Nessus::NBE
include Msf::DBManager::Import::Nessus::XML
end

View File

@ -0,0 +1,22 @@
module Msf::DBManager::Import::Nessus::XML
#
# Import Nessus XML v1 and v2 output
#
# Old versions of openvas exported this as well
#
def import_nessus_xml_file(args={})
filename = args[:filename]
wspace = args[:wspace] || workspace
data = ""
::File.open(filename, 'rb') do |f|
data = f.read(f.stat.size)
end
if data.index("NessusClientData_v2")
import_nessus_xml_v2(args.merge(:data => data))
else
import_nessus_xml(args.merge(:data => data))
end
end
end