Move under Msf::WebServices namespace
parent
1cb23301a6
commit
e144cc6738
|
@ -8,7 +8,8 @@ require 'msf/core/web_services/servlet_helper'
|
|||
require 'msf/core/web_services/servlet/auth_servlet'
|
||||
require 'msf/core/web_services/servlet/json_rpc_servlet'
|
||||
|
||||
class JsonRpcApp < Sinatra::Base
|
||||
module Msf::WebServices
|
||||
class JsonRpcApp < Sinatra::Base
|
||||
helpers ServletHelper
|
||||
helpers Msf::RPC::JSON::DispatcherHelper
|
||||
|
||||
|
@ -64,4 +65,5 @@ class JsonRpcApp < Sinatra::Base
|
|||
action: AuthServlet.api_unauthenticated_path
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -1,6 +1,7 @@
|
|||
require 'msf/core/rpc'
|
||||
|
||||
module JsonRpcServlet
|
||||
module Msf::WebServices
|
||||
module JsonRpcServlet
|
||||
|
||||
def self.api_path
|
||||
'/api/:version/json-rpc'
|
||||
|
@ -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)
|
||||
|
@ -31,4 +32,5 @@ module JsonRpcServlet
|
|||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue