Move under Msf::WebServices namespace

GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-10-23 23:46:40 -04:00
parent 1cb23301a6
commit e144cc6738
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
3 changed files with 83 additions and 79 deletions

View File

@ -8,6 +8,7 @@ require 'msf/core/web_services/servlet_helper'
require 'msf/core/web_services/servlet/auth_servlet'
require 'msf/core/web_services/servlet/json_rpc_servlet'
module Msf::WebServices
class JsonRpcApp < Sinatra::Base
helpers ServletHelper
helpers Msf::RPC::JSON::DispatcherHelper
@ -65,3 +66,4 @@ class JsonRpcApp < Sinatra::Base
end
end
end

View File

@ -1,5 +1,6 @@
require 'msf/core/rpc'
module Msf::WebServices
module JsonRpcServlet
def self.api_path
@ -21,7 +22,7 @@ module JsonRpcServlet
begin
body = request.body.read
tmp_params = sanitize_params(params)
data = get_dispatcher(settings.dispatchers, tmp_params[:version].to_sym, settings.framework).process(body)
data = get_dispatcher(settings.dispatchers, tmp_params[:version].to_sym, framework).process(body)
set_raw_response(data)
rescue => e
print_error("There was an error executing the RPC: #{e.message}.", e)
@ -32,3 +33,4 @@ module JsonRpcServlet
}
end
end
end

View File

@ -18,4 +18,4 @@ end
# Note: setup Rails environment before calling require
require 'msf/core/web_services/json_rpc_app'
run JsonRpcApp
run Msf::WebServices::JsonRpcApp