diff --git a/lib/msf/core/db_manager/vuln.rb b/lib/msf/core/db_manager/vuln.rb index 5b3e9caf27..0f3f5b0f82 100644 --- a/lib/msf/core/db_manager/vuln.rb +++ b/lib/msf/core/db_manager/vuln.rb @@ -168,7 +168,7 @@ module Msf::DBManager::Vuln sname = opts[:proto] end - service = host.services.find_or_create_by_port_and_proto(opts[:port].to_i, proto) + service = host.services.where(port: opts[:port].to_i, proto: proto).first_or_create end # Try to find an existing vulnerability with the same service & references diff --git a/lib/msf/core/db_manager/workspace.rb b/lib/msf/core/db_manager/workspace.rb index f512e015b0..2f409db51e 100644 --- a/lib/msf/core/db_manager/workspace.rb +++ b/lib/msf/core/db_manager/workspace.rb @@ -4,7 +4,7 @@ module Msf::DBManager::Workspace # def add_workspace(name) ::ActiveRecord::Base.connection_pool.with_connection { - ::Mdm::Workspace.find_or_create_by_name(name) + ::Mdm::Workspace.where(name: name).first_or_create } end