Handle both serialized & unserialized cases on import

bug/bundler_fix
HD Moore 2015-09-16 08:11:15 -07:00
parent ef043cebc3
commit b7572d5494
1 changed files with 12 additions and 1 deletions

View File

@ -241,7 +241,18 @@ module Msf::DBManager::Import::MetasploitFramework::XML
host_data = {} host_data = {}
host_data[:task] = args[:task] host_data[:task] = args[:task]
host_data[:workspace] = wspace host_data[:workspace] = wspace
host_data[:host] = nils_for_nulls(unserialize_object(host.elements["address"]))
# A regression resulted in the address field being serialized in some cases.
# Lets handle both instances to keep things happy. See #5837 & #5985
addr = nils_for_nulls(host.elements["address"])
next unless addr
# No period or colon means this must be in base64-encoded serialized form
if addr !~ /[\.\:]/
addr = unserialize_object(addr)
end
host_data[:host] = addr
if bl.include? host_data[:host] if bl.include? host_data[:host]
next next
else else