From 2a7e3fb600619f540eca2348f152082cfd686ae4 Mon Sep 17 00:00:00 2001 From: Brian Patterson Date: Mon, 4 Apr 2016 17:35:31 -0500 Subject: [PATCH] Fix an error in the OpenVas and Burp Issue importers where the vuln and host info would import into the default workspace instead of the current workspace --- lib/rex/parser/burp_issue_nokogiri.rb | 4 ++-- lib/rex/parser/openvas_nokogiri.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/rex/parser/burp_issue_nokogiri.rb b/lib/rex/parser/burp_issue_nokogiri.rb index c14ec9c869..a1a482b280 100644 --- a/lib/rex/parser/burp_issue_nokogiri.rb +++ b/lib/rex/parser/burp_issue_nokogiri.rb @@ -99,7 +99,7 @@ module Rex return unless @state[:port] return unless @state[:proto] return unless @state[:service_name] - service_info = {} + service_info = {:workspace => @args[:wspace]} service_info[:host] = @state[:host] service_info[:port] = @state[:port] service_info[:proto] = @state[:proto] @@ -112,7 +112,7 @@ module Rex return unless @state[:vuln_name] return unless @state[:issue_detail] return unless @state[:refs] - vuln_info = {} + vuln_info = {:workspace => @args[:wspace]} vuln_info[:service_id] = @state[:service_object].id vuln_info[:host] = @state[:host] vuln_info[:name] = @state[:vuln_name] diff --git a/lib/rex/parser/openvas_nokogiri.rb b/lib/rex/parser/openvas_nokogiri.rb index 07fd3c6b82..ba3f35fd01 100644 --- a/lib/rex/parser/openvas_nokogiri.rb +++ b/lib/rex/parser/openvas_nokogiri.rb @@ -132,6 +132,7 @@ module Parser vuln_info[:info] = @state[:vuln_desc] vuln_info[:port] = @state[:port] vuln_info[:proto] = @state[:proto] + vuln_info[:workspace] = @args[:wspace] db_report(:vuln, vuln_info) end @@ -145,6 +146,7 @@ module Parser vuln_info[:info] = @state[:vuln_desc] vuln_info[:port] = @state[:port] vuln_info[:proto] = @state[:proto] + vuln_info[:workspace] = @args[:wspace] db_report(:vuln, vuln_info) end @@ -157,11 +159,13 @@ module Parser service_info[:name] = @state[:name] service_info[:port] = @state[:port] service_info[:proto] = @state[:proto] + service_info[:workspace] = @args[:wspace] db_report(:service, service_info) host_info = {} host_info[:host] = @state[:host] + host_info[:workspace] = @args[:wspace] db_report(:host, host_info) end