CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/metasploit/framework/data_service.rb
Views: 11779
1
require 'metasploit/framework/data_service/stubs/host_data_service'
2
require 'metasploit/framework/data_service/stubs/vuln_data_service'
3
require 'metasploit/framework/data_service/stubs/event_data_service'
4
require 'metasploit/framework/data_service/stubs/workspace_data_service'
5
require 'metasploit/framework/data_service/stubs/note_data_service'
6
require 'metasploit/framework/data_service/stubs/web_data_service'
7
require 'metasploit/framework/data_service/stubs/service_data_service'
8
require 'metasploit/framework/data_service/stubs/session_data_service'
9
require 'metasploit/framework/data_service/stubs/session_event_service'
10
require 'metasploit/framework/data_service/stubs/exploit_data_service'
11
require 'metasploit/framework/data_service/stubs/loot_data_service'
12
require 'metasploit/framework/data_service/stubs/msf_data_service'
13
14
#
15
# All data service implementations should include this module to ensure proper implementation
16
#
17
module Metasploit
18
module Framework
19
module DataService
20
include HostDataService
21
include EventDataService
22
include VulnDataService
23
include WorkspaceDataService
24
include WebDataService
25
include NoteDataService
26
include ServiceDataService
27
include SessionDataService
28
include SessionEventDataService
29
include ExploitDataService
30
include LootDataService
31
include MsfDataService
32
33
def name
34
raise 'DataService#name is not implemented';
35
end
36
37
def active
38
raise 'DataService#active is not implemented';
39
end
40
41
def active=(value)
42
raise 'DataService#active= is not implemented';
43
end
44
45
def is_local?
46
raise 'DataService#is_local? is not implemented';
47
end
48
49
#
50
# Hold metadata about a data service
51
#
52
class Metadata
53
attr_reader :id
54
attr_reader :name
55
attr_reader :active
56
attr_reader :is_local
57
58
def initialize (id, name, active, is_local)
59
self.id = id
60
self.name = name
61
self.active = active
62
self.is_local = is_local
63
64
end
65
66
#######
67
private
68
#######
69
70
attr_writer :id
71
attr_writer :name
72
attr_writer :active
73
attr_writer :is_local
74
75
end
76
end
77
end
78
end
79
80