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
bug/bundler_fix
Louis Sato 2016-10-18 17:42:48 -05:00
parent 43fd0a8813
commit f18cbd655e
No known key found for this signature in database
GPG Key ID: 501290E4CECB7DF4
1 changed files with 4 additions and 0 deletions

View File

@ -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
#