Skip to content

Commit 8f43c22

Browse files
author
lsanchez-r7
committed
Passing the Mdm::Task down the chain
when reporting hosts from an Mdm::Task we need to pass the task all the way down. this wasnt done for the metasploit import format.
1 parent 1faf069 commit 8f43c22

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/msf/core/db.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4222,7 +4222,10 @@ def import_retina_xml(args={}, &block)
42224222
parser = Rex::Parser::RetinaXMLStreamParser.new
42234223
parser.on_found_host = Proc.new do |host|
42244224
hobj = nil
4225-
data = {:workspace => wspace}
4225+
data = {
4226+
:workspace => wspace,
4227+
:task => args[:task]
4228+
}
42264229
addr = host['address']
42274230
next if not addr
42284231

lib/msf/core/db_manager/import_msf_xml.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ def import_msf_xml(args={}, &block)
204204

205205
doc.elements.each("/#{btag}/hosts/host") do |host|
206206
host_data = {}
207+
host_data[:task] = args[:task]
207208
host_data[:workspace] = wspace
208209
host_data[:host] = nils_for_nulls(host.elements["address"].text.to_s.strip)
209210
if bl.include? host_data[:host]
@@ -247,6 +248,7 @@ def import_msf_xml(args={}, &block)
247248

248249
host.elements.each('services/service') do |service|
249250
service_data = {}
251+
service_data[:task] = args[:task]
250252
service_data[:workspace] = wspace
251253
service_data[:host] = hobj
252254
service_data[:port] = nils_for_nulls(service.elements["port"].text.to_s.strip).to_i

0 commit comments

Comments
 (0)