From 3bc0608579abf7ec82d31b7905d3e1d97062380b Mon Sep 17 00:00:00 2001 From: christopher lee Date: Thu, 1 Feb 2018 13:59:15 -0600 Subject: [PATCH] Finish POC cleanup --- lib/metasploit/framework/data_service.rb | 10 +++++++--- lib/msf/ui/console/command_dispatcher/core.rb | 16 ---------------- lib/msf/ui/console/command_dispatcher/db.rb | 6 +++++- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/lib/metasploit/framework/data_service.rb b/lib/metasploit/framework/data_service.rb index 57717af775..a5321dbec4 100644 --- a/lib/metasploit/framework/data_service.rb +++ b/lib/metasploit/framework/data_service.rb @@ -34,6 +34,9 @@ module DataService raise 'DataLService#active is not implemented'; end + # + # Hold metadata about a data service + # class Metadata attr_reader :id attr_reader :name @@ -45,14 +48,15 @@ module DataService self.active = active end + ####### private + ####### + attr_writer :id attr_writer :name attr_writer :active end - -end - +end end end diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index 001196ce30..66264bc56c 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -20,7 +20,6 @@ require 'msf/ui/console/command_dispatcher/jobs' require 'msf/ui/console/command_dispatcher/resource' require 'msf/ui/console/command_dispatcher/modules' require 'msf/util/document_generator' -require 'metasploit/framework/data_service/remote/msf_red/msf_red_service' module Msf module Ui @@ -108,7 +107,6 @@ class Core "?" => "Help menu", "banner" => "Display an awesome metasploit banner", "cd" => "Change the current working directory", - "msf_red_connect" => "Connect to MSF Platform", "connect" => "Communicate with a host", "color" => "Toggle color", "exit" => "Exit the console", @@ -263,20 +261,6 @@ class Core end - def cmd_msf_red_connect(*args) - while (arg = args.shift) - case arg - when '-u' - username = args.shift - when '-p' - password = args.shift - end - end - - msf_red_service = MSFRedService.new() - msf_red_service.launch(username, password) - end - def cmd_connect_help print_line "Usage: connect [options] " print_line diff --git a/lib/msf/ui/console/command_dispatcher/db.rb b/lib/msf/ui/console/command_dispatcher/db.rb index 99d560ff47..55b42fd185 100644 --- a/lib/msf/ui/console/command_dispatcher/db.rb +++ b/lib/msf/ui/console/command_dispatcher/db.rb @@ -85,7 +85,11 @@ module Msf end def cmd_set_data_service(service_id) - framework.db.set_data_service(service_id) + begin + framework.db.set_data_service(service_id) + rescue Exception => e + print_error "Unable to set data service: #{e.message}" + end end def cmd_list_data_services()