parent
71af8fd9c2
commit
a0494b2eeb
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue