Add events method

GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-12-21 21:37:42 -05:00
parent a457973702
commit 7e10b38421
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
3 changed files with 25 additions and 1 deletions

View File

@ -1,5 +1,16 @@
module EventDataProxy
def events(opts = {})
begin
self.data_service_operation do |data_service|
add_opts_workspace(opts)
data_service.events(opts)
end
rescue => e
self.log_error(e, "Problem retrieving events")
end
end
def report_event(opts)
begin
self.data_service_operation do |data_service|

View File

@ -1,5 +1,15 @@
require 'metasploit/framework/data_service/remote/http/response_data_helper'
module RemoteEventDataService
include ResponseDataHelper
EVENT_API_PATH = '/api/v1/events'
EVENT_MDM_CLASS = 'Mdm::Event'
def events(opts)
path = get_path_select(opts, EVENT_API_PATH)
json_to_mdm_object(self.get_data(path, nil, opts), EVENT_MDM_CLASS, [])
end
def report_event(opts)
self.post_data_async(EVENT_API_PATH, opts)

View File

@ -1,7 +1,10 @@
module EventDataService
def events(opts)
raise 'EventDataService#events is not implemented'
end
def report_event(opts)
raise 'EventDataService#report_event is not implemented'
end
end