Homogenize GET requests

GSoC/Meterpreter_Web_Console
James Barnett 2018-07-18 12:43:48 -05:00
parent 846df018e0
commit 08b53a1ef7
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
10 changed files with 7 additions and 13 deletions

View File

@ -7,7 +7,7 @@ module RemoteSessionEventDataService
SESSION_EVENT_MDM_CLASS = 'Mdm::SessionEvent'
def session_events(opts = {})
json_to_mdm_object(self.get_data(SESSION_EVENT_API_PATH, opts), SESSION_EVENT_MDM_CLASS, [])
json_to_mdm_object(self.get_data(SESSION_EVENT_API_PATH, nil, opts), SESSION_EVENT_MDM_CLASS, [])
end
def report_session_event(opts)

View File

@ -27,7 +27,6 @@ module HostServlet
def self.get_host
lambda {
begin
opts = parse_json_request(request, false)
sanitized_params = sanitize_params(params)
data = get_db.hosts(sanitized_params)
includes = [:loots]

View File

@ -22,7 +22,6 @@ module LootServlet
def self.get_loot
lambda {
begin
opts = parse_json_request(request, false)
sanitized_params = sanitize_params(params)
data = get_db.loots(sanitized_params)
includes = [:host]

View File

@ -22,7 +22,6 @@ module NoteServlet
def self.get_note
lambda {
begin
opts = parse_json_request(request, false)
sanitized_params = sanitize_params(params)
data = get_db.notes(sanitized_params)
includes = [:host]

View File

@ -22,8 +22,8 @@ module ServiceServlet
def self.get_services
lambda {
begin
opts = sanitize_params(params)
data = get_db.services(opts)
sanitized_params = sanitize_params(params)
data = get_db.services(sanitized_params)
includes = [:host]
set_json_response(data, includes)
rescue => e

View File

@ -16,8 +16,8 @@ module SessionEventServlet
def self.get_session_event
lambda {
begin
opts = parse_json_request(request, false)
data = get_db.session_events(opts)
sanitized_params = sanitize_params(params)
data = get_db.session_events(sanitized_params)
set_json_response(data)
rescue => e
set_error_on_response(e)

View File

@ -20,7 +20,6 @@ module SessionServlet
def self.get_session
lambda {
begin
opts = parse_json_request(request, false)
sanitized_params = sanitize_params(params)
data = get_db.sessions(sanitized_params)
includes = [:host]

View File

@ -20,8 +20,8 @@ module VulnAttemptServlet
def self.get_vuln_attempt
lambda {
begin
opts = parse_json_request(request, false)
data = get_db.vuln_attempts(params.symbolize_keys)
sanitized_params = sanitize_params(params)
data = get_db.vuln_attempts(sanitized_params)
set_json_response(data)
rescue => e
set_error_on_response(e)

View File

@ -22,7 +22,6 @@ module VulnServlet
def self.get_vuln
lambda {
begin
opts = parse_json_request(request, false)
sanitized_params = sanitize_params(params)
data = get_db.vulns(sanitized_params)
includes = [:host, :vulns_refs, :refs, :module_refs]

View File

@ -22,7 +22,6 @@ module WorkspaceServlet
def self.get_workspace
lambda {
begin
opts = parse_json_request(request, false)
includes = nil
sanitized_params = sanitize_params(params)