From aa40ef1789e3c39bc04b7738b82bdc9249a2b539 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Wed, 18 Apr 2018 17:38:42 -0500 Subject: [PATCH] Grab session_dto workspace from host --- .../framework/data_service/proxy/session_data_proxy.rb | 2 +- lib/msf/core/db_manager/session.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/metasploit/framework/data_service/proxy/session_data_proxy.rb b/lib/metasploit/framework/data_service/proxy/session_data_proxy.rb index 1a966506c5..92b12c39e2 100644 --- a/lib/metasploit/framework/data_service/proxy/session_data_proxy.rb +++ b/lib/metasploit/framework/data_service/proxy/session_data_proxy.rb @@ -1,7 +1,7 @@ module SessionDataProxy def report_session(opts) begin - data_service = self.get_data_service() + data_service = self.get_data_service data_service.report_session(opts) rescue Exception => e self.log_error(e, "Problem reporting session") diff --git a/lib/msf/core/db_manager/session.rb b/lib/msf/core/db_manager/session.rb index 5a6534e789..ae54413c1e 100644 --- a/lib/msf/core/db_manager/session.rb +++ b/lib/msf/core/db_manager/session.rb @@ -119,12 +119,12 @@ module Msf::DBManager::Session return if not active ::ActiveRecord::Base.connection_pool.with_connection { - workspace = find_workspace(session_dto[:workspace]) host_data = session_dto[:host_data] + workspace = workspaces({ name: host_data[:workspace].name }) h_opts = {} h_opts[:host] = host_data[:host] h_opts[:arch] = host_data[:arch] - h_opts[:workspace] = workspace + h_opts[:workspace] = host_data[:workspace] host = find_or_create_host(h_opts) session_data = session_dto[:session_data]