Skip to content

Commit

Permalink
Land #10410, add script for setting up and managing data services
Browse files Browse the repository at this point in the history
The msfdb script allows you to create, delete, start, and
stop local and remote data services. The database backend requires
PostgreSQL and the webservice provides a REST API to interact with it.
  • Loading branch information
jbarnett-r7 committed Aug 7, 2018
2 parents e00ed38 + 75249d8 commit 201b91f
Show file tree
Hide file tree
Showing 2 changed files with 930 additions and 1 deletion.
30 changes: 29 additions & 1 deletion lib/msf/core/db_manager/http/servlet_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
require 'msf/core/db_manager/http/db_manager_proxy'
require 'msf/core/db_manager/http/job_processor'
require 'metasploit/framework/data_service/remote/http/response_data_helper'
require 'rex/ui/text/output/stdio'

module ServletHelper
include ResponseDataHelper

@@console_printer = Rex::Ui::Text::Output::Stdio.new

def set_error_on_response(error)
print_error "Error handling request: #{error.message}", error
headers = {'Content-Type' => 'text/plain'}
Expand Down Expand Up @@ -134,7 +137,32 @@ def warden
def warden_options
env['warden.options']
end


def print_line(msg)
@@console_printer.print_line(msg)
end

def print_warning(msg)
@@console_printer.print_warning(msg)
end

def print_good(msg)
@@console_printer.print_good(msg)
end

def print_error(msg, exception = nil)
unless exception.nil?
msg += "\n Call Stack:"
exception.backtrace.each {|line|
msg += "\n"
msg += "\t #{line}"
}
end

@@console_printer.print_error(msg)
end


#######
private
#######
Expand Down
Loading

0 comments on commit 201b91f

Please sign in to comment.