Module: VulnDataProxy

Included in:
DataProxyAutoLoader
Defined in:
lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb

Instance Method Summary collapse

Instance Method Details

#delete_vuln(opts) ⇒ Object



50
51
52
53
54
55
56
57
58
# File 'lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb', line 50

def delete_vuln(opts)
  begin
    self.data_service_operation do |data_service|
      data_service.delete_vuln(opts)
    end
  rescue => e
    self.log_error(e, "Problem deleting vuln")
  end
end

#find_or_create_vuln(opts) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb', line 15

def find_or_create_vuln(opts)
  begin
    vuln = vulns(opts.clone)
    if vuln.nil? || vuln.first.nil?
      vuln = report_vuln(opts.clone)
    else
      vuln = vuln.first
    end
    vuln
  rescue => e
    self.log_error(e, "Problem finding or creating vuln")
  end
end

#report_vuln(opts) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb', line 29

def report_vuln(opts)
  begin
    self.data_service_operation do |data_service|
      add_opts_workspace(opts)
      data_service.report_vuln(opts)
    end
  rescue => e
    self.log_error(e, "Problem reporting vuln")
  end
end

#update_vuln(opts) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb', line 40

def update_vuln(opts)
  begin
    self.data_service_operation do |data_service|
      data_service.update_vuln(opts)
    end
  rescue => e
    self.log_error(e, "Problem updating vuln")
  end
end

#vulns(opts) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb', line 4

def vulns(opts)
  begin
    self.data_service_operation do |data_service|
      add_opts_workspace(opts)
      data_service.vulns(opts)
    end
  rescue => e
    self.log_error(e, "Problem retrieving vulns")
  end
end