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' SESSION_EVENT_MDM_CLASS = 'Mdm::SessionEvent'
def session_events(opts = {}) 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 end
def report_session_event(opts) def report_session_event(opts)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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