From f18cbd655e30665a6023079d458173a387374a1f Mon Sep 17 00:00:00 2001 From: Louis Sato Date: Tue, 18 Oct 2016 17:42:48 -0500 Subject: [PATCH] delay fingerprinting of host MS-2073 * imports are slow mainly caused by fingerprinting after every service creation * now only fingerprints after all the services are created for imports --- lib/msf/core/db_manager/import.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/msf/core/db_manager/import.rb b/lib/msf/core/db_manager/import.rb index 8b994583b6..6ed5676c06 100644 --- a/lib/msf/core/db_manager/import.rb +++ b/lib/msf/core/db_manager/import.rb @@ -85,10 +85,14 @@ module Msf::DBManager::Import # import_file_detect will raise an error if the filetype # is unknown. def import(args={}, &block) + wspace = args[:wspace] || args['wspace'] || workspace + wspace.update_attribute(:import_fingerprint, true) data = args[:data] || args['data'] ftype = import_filetype_detect(data) yield(:filetype, @import_filedata[:type]) if block self.send "import_#{ftype}".to_sym, args, &block + wspace.hosts.each(&:normalize_os) + wspace.update_attribute(:import_fingerprint, false) end #