Module: RemoteVulnDataService

Includes:
ResponseDataHelper
Included in:
DataServiceAutoLoader
Defined in:
lib/metasploit/framework/data_service/remote/http/remote_vuln_data_service.rb

Constant Summary collapse

VULN_API_PATH =
'/api/v1/vulns'
VULN_MDM_CLASS =
'Mdm::Vuln'

Instance Method Summary collapse

Methods included from ResponseDataHelper

#json_to_hash, #json_to_mdm_object, #process_file, #to_ar

Instance Method Details

#delete_vuln(opts) ⇒ Object



27
28
29
# File 'lib/metasploit/framework/data_service/remote/http/remote_vuln_data_service.rb', line 27

def delete_vuln(opts)
  json_to_mdm_object(self.delete_data(VULN_API_PATH, opts), VULN_MDM_CLASS)
end

#report_vuln(opts) ⇒ Object



14
15
16
# File 'lib/metasploit/framework/data_service/remote/http/remote_vuln_data_service.rb', line 14

def report_vuln(opts)
  json_to_mdm_object(self.post_data(VULN_API_PATH, opts), VULN_MDM_CLASS).first
end

#update_vuln(opts) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/metasploit/framework/data_service/remote/http/remote_vuln_data_service.rb', line 18

def update_vuln(opts)
  path = VULN_API_PATH
  if opts && opts[:id]
    id = opts.delete(:id)
    path = "#{VULN_API_PATH}/#{id}"
  end
  json_to_mdm_object(self.put_data(path, opts), VULN_MDM_CLASS)
end

#vulns(opts) ⇒ Object



9
10
11
12
# File 'lib/metasploit/framework/data_service/remote/http/remote_vuln_data_service.rb', line 9

def vulns(opts)
  path = get_path_select(opts, VULN_API_PATH)
  json_to_mdm_object(self.get_data(path, nil, opts), VULN_MDM_CLASS)
end