metasploit_data_models 0.24.4 → 0.24.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +3 -3
- data/.travis.yml +3 -6
- data/CONTRIBUTING.md +52 -10
- data/Gemfile +8 -1
- data/Rakefile +0 -23
- data/app/models/mdm/api_key.rb +1 -41
- data/app/models/mdm/client.rb +1 -41
- data/app/models/mdm/cred.rb +19 -107
- data/app/models/mdm/event.rb +1 -48
- data/app/models/mdm/exploit_attempt.rb +16 -65
- data/app/models/mdm/exploited_host.rb +1 -28
- data/app/models/mdm/host_detail.rb +1 -45
- data/app/models/mdm/host_tag.rb +8 -6
- data/app/models/mdm/listener.rb +1 -53
- data/app/models/mdm/macro.rb +0 -42
- data/app/models/mdm/mod_ref.rb +0 -21
- data/app/models/mdm/module/action.rb +0 -15
- data/app/models/mdm/module/arch.rb +0 -10
- data/app/models/mdm/module/author.rb +0 -16
- data/app/models/mdm/module/mixin.rb +0 -13
- data/app/models/mdm/module/platform.rb +0 -11
- data/app/models/mdm/module/target.rb +0 -18
- data/app/models/mdm/nexpose_console.rb +4 -82
- data/app/models/mdm/profile.rb +0 -36
- data/app/models/mdm/route.rb +5 -17
- data/app/models/mdm/session_event.rb +1 -33
- data/app/models/mdm/tag.rb +10 -49
- data/app/models/mdm/task.rb +45 -94
- data/app/models/mdm/task_cred.rb +0 -29
- data/app/models/mdm/task_host.rb +0 -25
- data/app/models/mdm/task_service.rb +0 -25
- data/app/models/mdm/task_session.rb +0 -25
- data/app/models/mdm/user.rb +6 -188
- data/app/models/mdm/vuln_attempt.rb +12 -37
- data/app/models/mdm/vuln_detail.rb +5 -139
- data/app/models/mdm/vuln_ref.rb +1 -4
- data/app/models/mdm/web_form.rb +1 -35
- data/app/models/mdm/web_page.rb +1 -70
- data/app/models/mdm/web_site.rb +1 -51
- data/app/models/mdm/wmap_request.rb +0 -85
- data/app/models/mdm/wmap_target.rb +0 -40
- data/app/models/mdm/workspace.rb +14 -152
- data/app/models/metasploit_data_models/automatic_exploitation.rb +16 -0
- data/app/models/metasploit_data_models/automatic_exploitation/match.rb +24 -19
- data/app/models/metasploit_data_models/automatic_exploitation/match_result.rb +5 -33
- data/app/models/metasploit_data_models/automatic_exploitation/match_set.rb +4 -22
- data/app/models/metasploit_data_models/automatic_exploitation/run.rb +3 -13
- data/app/models/metasploit_data_models/ip_address/v4/segmented.rb +1 -1
- data/app/models/metasploit_data_models/module_run.rb +1 -1
- data/app/models/metasploit_data_models/search/visitor/where.rb +1 -1
- data/app/validators/ip_format_validator.rb +0 -4
- data/app/validators/parameters_validator.rb +0 -12
- data/app/validators/password_is_strong_validator.rb +1 -10
- data/lib/mdm/host/operating_system_normalization.rb +10 -7
- data/lib/metasploit_data_models.rb +0 -4
- data/lib/metasploit_data_models/engine.rb +0 -2
- data/lib/metasploit_data_models/serialized_prefs.rb +0 -6
- data/lib/metasploit_data_models/version.rb +10 -24
- data/lib/tasks/yard.rake +33 -0
- data/metasploit_data_models.gemspec +2 -9
- data/spec/app/models/mdm/api_key_spec.rb +3 -1
- data/spec/app/models/mdm/client_spec.rb +11 -9
- data/spec/app/models/mdm/cred_spec.rb +54 -42
- data/spec/app/models/mdm/event_spec.rb +23 -21
- data/spec/app/models/mdm/exploit_attempt_spec.rb +21 -19
- data/spec/app/models/mdm/exploited_host_spec.rb +13 -11
- data/spec/app/models/mdm/host_detail_spec.rb +17 -15
- data/spec/app/models/mdm/host_spec.rb +260 -261
- data/spec/app/models/mdm/host_tag_spec.rb +8 -6
- data/spec/app/models/mdm/listener_spec.rb +32 -30
- data/spec/app/models/mdm/loot_spec.rb +23 -21
- data/spec/app/models/mdm/macro_spec.rb +3 -1
- data/spec/app/models/mdm/mod_ref_spec.rb +3 -1
- data/spec/app/models/mdm/module/action_spec.rb +12 -10
- data/spec/app/models/mdm/module/arch_spec.rb +12 -10
- data/spec/app/models/mdm/module/author_spec.rb +17 -22
- data/spec/app/models/mdm/module/detail_spec.rb +75 -184
- data/spec/app/models/mdm/module/mixin_spec.rb +12 -10
- data/spec/app/models/mdm/module/platform_spec.rb +12 -10
- data/spec/app/models/mdm/module/ref_spec.rb +12 -10
- data/spec/app/models/mdm/module/target_spec.rb +15 -13
- data/spec/app/models/mdm/nexpose_console_spec.rb +37 -35
- data/spec/app/models/mdm/note_spec.rb +25 -23
- data/spec/app/models/mdm/profile_spec.rb +3 -1
- data/spec/app/models/mdm/ref_spec.rb +12 -10
- data/spec/app/models/mdm/route_spec.rb +8 -6
- data/spec/app/models/mdm/service_spec.rb +40 -38
- data/spec/app/models/mdm/session_event_spec.rb +12 -10
- data/spec/app/models/mdm/session_spec.rb +15 -13
- data/spec/app/models/mdm/tag_spec.rb +29 -29
- data/spec/app/models/mdm/task_cred_spec.rb +11 -9
- data/spec/app/models/mdm/task_host_spec.rb +11 -9
- data/spec/app/models/mdm/task_service_spec.rb +11 -9
- data/spec/app/models/mdm/task_session_spec.rb +9 -7
- data/spec/app/models/mdm/task_spec.rb +29 -27
- data/spec/app/models/mdm/user_spec.rb +19 -17
- data/spec/app/models/mdm/vuln_attempt_spec.rb +16 -14
- data/spec/app/models/mdm/vuln_detail_spec.rb +28 -26
- data/spec/app/models/mdm/vuln_ref_spec.rb +10 -8
- data/spec/app/models/mdm/vuln_spec.rb +26 -24
- data/spec/app/models/mdm/web_form_spec.rb +13 -11
- data/spec/app/models/mdm/web_page_spec.rb +21 -19
- data/spec/app/models/mdm/web_site_spec.rb +23 -21
- data/spec/app/models/mdm/web_vuln_spec.rb +65 -63
- data/spec/app/models/mdm/wmap_request_spec.rb +3 -1
- data/spec/app/models/mdm/wmap_target_spec.rb +3 -1
- data/spec/app/models/mdm/workspace_spec.rb +100 -97
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +5 -3
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +15 -13
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/ip_address/v4/cidr_spec.rb +12 -10
- data/spec/app/models/metasploit_data_models/ip_address/v4/nmap_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +23 -21
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +11 -9
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +23 -21
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/segmented_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/single_spec.rb +15 -22
- data/spec/app/models/metasploit_data_models/ip_address/v4/single_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/module_run_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/search/operation/ip_address_spec.rb +20 -18
- data/spec/app/models/metasploit_data_models/search/operation/port/number_spec.rb +8 -6
- data/spec/app/models/metasploit_data_models/search/operation/port/range_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operation/range_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operator/ip_address_spec.rb +4 -2
- data/spec/app/models/metasploit_data_models/search/operator/multitext_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operator/port/list_spec.rb +8 -6
- data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +11 -9
- data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +7 -5
- data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +19 -17
- data/spec/app/models/metasploit_data_models/search/visitor/method_spec.rb +7 -5
- data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +23 -61
- data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +10 -8
- data/spec/app/validators/parameters_validator_spec.rb +29 -29
- data/spec/app/validators/password_is_strong_validator_spec.rb +46 -54
- data/spec/dummy/db/structure.sql +3403 -0
- data/spec/factories/mdm/module/details.rb +1 -1
- data/spec/lib/base64_serializer_spec.rb +19 -19
- data/spec/lib/metasploit_data_models/ip_address/cidr_spec.rb +12 -18
- data/spec/lib/metasploit_data_models/ip_address/range_spec.rb +6 -4
- data/spec/lib/metasploit_data_models/match/child_spec.rb +4 -2
- data/spec/lib/metasploit_data_models/match/parent_spec.rb +6 -4
- data/spec/lib/metasploit_data_models/version_spec.rb +141 -3
- data/spec/spec_helper.rb +12 -86
- data/spec/support/shared/examples/mdm/module/detail/does_not_support_stance_with_mtype.rb +2 -2
- data/spec/support/shared/examples/mdm/module/detail/supports_stance_with_mtype.rb +4 -4
- data/spec/support/shared/examples/metasploit_data_models/search/operation/ipaddress/match.rb +2 -2
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_children.rb +5 -5
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_metasploit_model_search_operation_base.rb +5 -5
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb +3 -3
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_metasploit_model_search_group_base.rb +6 -7
- metadata +9 -67
- data/CHANGELOG.md +0 -6
- data/RELEASING.md +0 -88
- data/UPGRADING.md +0 -1
- data/lib/metasploit_data_models/automatic_exploitation.rb +0 -25
- data/spec/lib/metasploit_data_models_spec.rb +0 -4
data/app/models/mdm/mod_ref.rb
CHANGED
@@ -1,24 +1,3 @@
|
|
1
|
-
# Joins a {Mdm::Module::Detail} and {Mdm::Ref} indirectly through the {Mdm::Module::Detail#refname} matching {#module},
|
2
|
-
# {Mdm::Module::Detail#mtype} matching {#mtype}, and {Mdm::Ref#name} matching {#ref}.
|
3
1
|
class Mdm::ModRef < ActiveRecord::Base
|
4
|
-
#
|
5
|
-
# Attributes
|
6
|
-
#
|
7
|
-
|
8
|
-
# @!attribute module
|
9
|
-
# An {Mdm::Module::Detail#refname}.
|
10
|
-
#
|
11
|
-
# @return [String]
|
12
|
-
|
13
|
-
# @!attribute mtype
|
14
|
-
# An {Mdm::Module::Detail#mtype}.
|
15
|
-
#
|
16
|
-
# @return [String]
|
17
|
-
|
18
|
-
# @!attribute ref
|
19
|
-
# An {Mdm::Ref#name}.
|
20
|
-
#
|
21
|
-
# @return [String]
|
22
|
-
|
23
2
|
Metasploit::Concern.run(self)
|
24
3
|
end
|
@@ -1,8 +1,3 @@
|
|
1
|
-
# Actions that auxiliary or post Metasploit Modules can perform. Actions are used to select subcommand-like behavior
|
2
|
-
# implemented by the same Metasploit Nodule. The semantics of a given action are specific to a given
|
3
|
-
# {Mdm::Module::Detail Metasploit Module}: if two {Mdm::Module::Detail Metasploit Modules} have
|
4
|
-
# {Mdm::Module::Action actions} with the same {Mdm::Module::Action#name name}, no similarity should be assumed between
|
5
|
-
# those two {Mdm::Module::Action actions} or {Mdm::Module::Detail Metasploit Modules}.
|
6
1
|
class Mdm::Module::Action < ActiveRecord::Base
|
7
2
|
self.table_name = 'module_actions'
|
8
3
|
|
@@ -10,18 +5,8 @@ class Mdm::Module::Action < ActiveRecord::Base
|
|
10
5
|
# Associations
|
11
6
|
#
|
12
7
|
|
13
|
-
# The Metasploit Module with this action.
|
14
8
|
belongs_to :detail, :class_name => 'Mdm::Module::Detail'
|
15
9
|
|
16
|
-
#
|
17
|
-
# Attributes
|
18
|
-
#
|
19
|
-
|
20
|
-
# @!attribute [rw] name
|
21
|
-
# The name of this action.
|
22
|
-
#
|
23
|
-
# @return [String]
|
24
|
-
|
25
10
|
#
|
26
11
|
# Mass Assignment Security
|
27
12
|
#
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# A supported architecture for a given {Mdm::Module::Detail Metasploit Module}
|
2
1
|
class Mdm::Module::Arch < ActiveRecord::Base
|
3
2
|
self.table_name = 'module_archs'
|
4
3
|
|
@@ -8,15 +7,6 @@ class Mdm::Module::Arch < ActiveRecord::Base
|
|
8
7
|
|
9
8
|
belongs_to :detail, :class_name => 'Mdm::Module::Detail'
|
10
9
|
|
11
|
-
#
|
12
|
-
# Attributes
|
13
|
-
#
|
14
|
-
|
15
|
-
# @!attribute name
|
16
|
-
# The architecture abbreviation, such as `'x86'`
|
17
|
-
#
|
18
|
-
# @return [String]
|
19
|
-
|
20
10
|
#
|
21
11
|
# Mass Assignment Security
|
22
12
|
#
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# The {#email} and {#name} of an author of a {#detail Metasploit Module}.
|
2
1
|
class Mdm::Module::Author < ActiveRecord::Base
|
3
2
|
self.table_name = 'module_authors'
|
4
3
|
|
@@ -6,23 +5,8 @@ class Mdm::Module::Author < ActiveRecord::Base
|
|
6
5
|
# Associations
|
7
6
|
#
|
8
7
|
|
9
|
-
# The authored Metasploit Module.
|
10
8
|
belongs_to :detail, :class_name => 'Mdm::Module::Detail'
|
11
9
|
|
12
|
-
#
|
13
|
-
# Attributes
|
14
|
-
#
|
15
|
-
|
16
|
-
# @!attribute email
|
17
|
-
# The email address of the author.
|
18
|
-
#
|
19
|
-
# @return [String]
|
20
|
-
|
21
|
-
# @!attribute name
|
22
|
-
# The name of the author.
|
23
|
-
#
|
24
|
-
# @return [String]
|
25
|
-
|
26
10
|
#
|
27
11
|
# Mass Assignment Security
|
28
12
|
#
|
@@ -1,6 +1,3 @@
|
|
1
|
-
# @deprecated Never populated by metasploit-framework.
|
2
|
-
#
|
3
|
-
# Module mixed into a {#detail Metasploit Module}.
|
4
1
|
class Mdm::Module::Mixin < ActiveRecord::Base
|
5
2
|
self.table_name = 'module_mixins'
|
6
3
|
|
@@ -8,18 +5,8 @@ class Mdm::Module::Mixin < ActiveRecord::Base
|
|
8
5
|
# Associations
|
9
6
|
#
|
10
7
|
|
11
|
-
# Metasploit Module the {#name named} `Module` was mixed in.
|
12
8
|
belongs_to :detail, :class_name => 'Mdm::Module::Detail'
|
13
9
|
|
14
|
-
#
|
15
|
-
# Attributes
|
16
|
-
#
|
17
|
-
|
18
|
-
# @!attribute name
|
19
|
-
# The `Module#name` of the mixed in `Module`.
|
20
|
-
#
|
21
|
-
# @return [String]
|
22
|
-
|
23
10
|
#
|
24
11
|
# Mass Assignment Security
|
25
12
|
#
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# {#name Platform} on which the {#detail Metasploit Module} can run.
|
2
1
|
class Mdm::Module::Platform < ActiveRecord::Base
|
3
2
|
self.table_name = 'module_platforms'
|
4
3
|
|
@@ -6,18 +5,8 @@ class Mdm::Module::Platform < ActiveRecord::Base
|
|
6
5
|
# Associations
|
7
6
|
#
|
8
7
|
|
9
|
-
# The Metasploit Module that can run on the {#name named} platform.
|
10
8
|
belongs_to :detail, :class_name => 'Mdm::Module::Detail'
|
11
9
|
|
12
|
-
#
|
13
|
-
# Attributes
|
14
|
-
#
|
15
|
-
|
16
|
-
# @!attribute name
|
17
|
-
# The name of the platform.
|
18
|
-
#
|
19
|
-
# @return [String]
|
20
|
-
|
21
10
|
#
|
22
11
|
# Mass Assignment Security
|
23
12
|
#
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# A potential target for a {Mdm::Module::Detail exploit Metasploit Module}. Targets can change options including
|
2
|
-
# offsets for ROP chains to tune an exploit to work with different system libraries and versions.
|
3
1
|
class Mdm::Module::Target < ActiveRecord::Base
|
4
2
|
self.table_name = 'module_targets'
|
5
3
|
|
@@ -7,24 +5,8 @@ class Mdm::Module::Target < ActiveRecord::Base
|
|
7
5
|
# Associations
|
8
6
|
#
|
9
7
|
|
10
|
-
# Exploit Metasploit Module with the {#name named} target at the given {#index}.
|
11
8
|
belongs_to :detail, :class_name => 'Mdm::Module::Detail'
|
12
9
|
|
13
|
-
#
|
14
|
-
# Attributes
|
15
|
-
#
|
16
|
-
|
17
|
-
# @!attribute index
|
18
|
-
# The index of this target in the {#detail exploit Metasploit Module}'s list of targets. The index is used for
|
19
|
-
# target selection.
|
20
|
-
#
|
21
|
-
# @return [Integer]
|
22
|
-
|
23
|
-
# @!attribute name
|
24
|
-
# The name of this target.
|
25
|
-
#
|
26
|
-
# @return [String]
|
27
|
-
|
28
10
|
#
|
29
11
|
# Mass Assignment Security
|
30
12
|
#
|
@@ -1,94 +1,23 @@
|
|
1
|
-
# A connection to Nexpose from Metasploit.
|
2
1
|
class Mdm::NexposeConsole < ActiveRecord::Base
|
3
2
|
#
|
4
3
|
# Associations
|
5
4
|
#
|
6
5
|
|
7
|
-
#
|
6
|
+
# @!attribute vuln_details
|
7
|
+
# Details for vulnerabilities supplied by this Nexpose console.
|
8
|
+
#
|
9
|
+
# @return [ActiveRecord::Relation<Mdm::VulnDetail>]
|
8
10
|
has_many :vuln_details,
|
9
11
|
class_name: 'Mdm::VulnDetail',
|
10
12
|
foreign_key: :nx_console_id,
|
11
13
|
inverse_of: :nexpose_console
|
12
14
|
|
13
|
-
#
|
14
|
-
# Attributes
|
15
|
-
#
|
16
|
-
|
17
|
-
# @!attribute address
|
18
|
-
# Address on which Nexpose is running.
|
19
|
-
#
|
20
|
-
# @return [String]
|
21
|
-
|
22
|
-
# @!attribute cert
|
23
|
-
# @return [String]
|
24
|
-
|
25
|
-
# @!attribute created_at
|
26
|
-
# When this Nexpose console was created.
|
27
|
-
#
|
28
|
-
# @return [DateTime]
|
29
|
-
|
30
|
-
# @!attribute enabled
|
31
|
-
# Whether metasploit tried to connect to this Nexpose console.
|
32
|
-
#
|
33
|
-
# @return [false] is not allowed to connect.
|
34
|
-
# @return [true] is allowed to connect.
|
35
|
-
|
36
|
-
# @!attribute name
|
37
|
-
# Name of this Nexpose console to differentiate from other Nexpose consoles.
|
38
|
-
#
|
39
|
-
# @return [String]
|
40
|
-
|
41
|
-
# @!attribute owner
|
42
|
-
# {Mdm::User#username Name of user} that setup this console.
|
43
|
-
#
|
44
|
-
# @return [String]
|
45
|
-
# @todo https://www.pivotaltracker.com/story/show/52413415
|
46
|
-
|
47
|
-
# @!attribute password
|
48
|
-
# Password used to authenticate to Nexpose.
|
49
|
-
#
|
50
|
-
# @return [String]
|
51
|
-
# @todo https://www.pivotaltracker.com/story/show/52414551
|
52
|
-
|
53
|
-
# @!attribute port
|
54
|
-
# Port on {#address} that Nexpose is running.
|
55
|
-
#
|
56
|
-
# @return [Integer]
|
57
|
-
|
58
|
-
# @!attribute status
|
59
|
-
# Status of the connection to Nexpose.
|
60
|
-
#
|
61
|
-
# @return [String]
|
62
|
-
|
63
|
-
# @!attribute updated_at
|
64
|
-
# The last time this Nexpose console was updated.
|
65
|
-
#
|
66
|
-
# @return [DateTime]
|
67
|
-
|
68
|
-
# @!attribute username
|
69
|
-
# Username used to authenticate to Nexpose.
|
70
|
-
#
|
71
|
-
# @return [String]
|
72
|
-
|
73
|
-
# @!attribute version
|
74
|
-
# The version of Nexpose. Used to handle protocol difference in different versions of Nexpose.
|
75
|
-
#
|
76
|
-
# @return [String]
|
77
|
-
|
78
|
-
#
|
79
|
-
# Callbacks
|
80
|
-
#
|
81
|
-
|
82
15
|
before_save :strip_protocol
|
83
16
|
|
84
17
|
#
|
85
18
|
# Serializations
|
86
19
|
#
|
87
20
|
|
88
|
-
# @!attribute [rw] cached_sites
|
89
|
-
# List of sites known to Nexpose.
|
90
|
-
#
|
91
|
-
# @return [Array<String>] Array of site names.
|
92
21
|
serialize :cached_sites, MetasploitDataModels::Base64Serializer.new
|
93
22
|
|
94
23
|
#
|
@@ -101,13 +30,6 @@ class Mdm::NexposeConsole < ActiveRecord::Base
|
|
101
30
|
validates :port, :numericality => { :only_integer => true }, :inclusion => {:in => 1..65535}
|
102
31
|
validates :username, :presence => true
|
103
32
|
|
104
|
-
#
|
105
|
-
# Instance Methdos
|
106
|
-
#
|
107
|
-
|
108
|
-
# Strips '`http://`' or `'https://'` from {#address}.
|
109
|
-
#
|
110
|
-
# @return [void]
|
111
33
|
def strip_protocol
|
112
34
|
self.address.gsub!(/^http(s)*:\/\//i,'')
|
113
35
|
end
|
data/app/models/mdm/profile.rb
CHANGED
@@ -1,43 +1,7 @@
|
|
1
|
-
# User settings.
|
2
1
|
class Mdm::Profile < ActiveRecord::Base
|
3
|
-
#
|
4
|
-
# Attributes
|
5
|
-
#
|
6
|
-
|
7
|
-
# @!attribute active
|
8
|
-
# Whether this is the currently active profile.
|
9
|
-
#
|
10
|
-
# @return [true] if this is the active profile.
|
11
|
-
# @return [false] if this profile is inactive and another profile is active.
|
12
|
-
|
13
|
-
# @!attribute created_at
|
14
|
-
# When this profile was created.
|
15
|
-
#
|
16
|
-
# @return [DateTime]
|
17
|
-
|
18
|
-
# @!attribute name
|
19
|
-
# Name of this profile to distinguish it from other profiles.
|
20
|
-
#
|
21
|
-
# @return [String]
|
22
|
-
|
23
|
-
# @!attribute owner
|
24
|
-
# Owner of this profile.
|
25
|
-
#
|
26
|
-
# @return ['<system>'] System-wide profile for all users.
|
27
|
-
# @return [String] Name of user that uses this profile.
|
28
|
-
|
29
|
-
# @!attribute updated_at
|
30
|
-
# The last time this profile was updated.
|
31
|
-
#
|
32
|
-
# @return [DateTime]
|
33
|
-
|
34
2
|
#
|
35
3
|
# Serializations
|
36
4
|
#
|
37
|
-
|
38
|
-
# Global settings.
|
39
|
-
#
|
40
|
-
# @return [Hash]
|
41
5
|
serialize :settings, MetasploitDataModels::Base64Serializer.new
|
42
6
|
|
43
7
|
Metasploit::Concern.run(self)
|
data/app/models/mdm/route.rb
CHANGED
@@ -1,27 +1,15 @@
|
|
1
|
-
# Network route that goes through a {#session} to allow accessing IPs on the remote end of the session.
|
2
1
|
class Mdm::Route < ActiveRecord::Base
|
3
2
|
#
|
4
|
-
#
|
3
|
+
# Relations
|
5
4
|
#
|
6
5
|
|
7
|
-
#
|
6
|
+
# @!attribute [rw] session
|
7
|
+
# The session over which this route traverses.
|
8
|
+
#
|
9
|
+
# @return [Mdm::Session]
|
8
10
|
belongs_to :session,
|
9
11
|
class_name: 'Mdm::Session',
|
10
12
|
inverse_of: :routes
|
11
13
|
|
12
|
-
#
|
13
|
-
# Attributes
|
14
|
-
#
|
15
|
-
|
16
|
-
# @!attribute netmask
|
17
|
-
# The netmask for this route.
|
18
|
-
#
|
19
|
-
# @return [String]
|
20
|
-
|
21
|
-
# @!attribute subnet
|
22
|
-
# The subnet for this route.
|
23
|
-
#
|
24
|
-
# @return [String]
|
25
|
-
|
26
14
|
Metasploit::Concern.run(self)
|
27
15
|
end
|
@@ -1,43 +1,11 @@
|
|
1
|
-
# Events that occurred when using a {#session}.
|
2
1
|
class Mdm::SessionEvent < ActiveRecord::Base
|
3
2
|
#
|
4
|
-
#
|
3
|
+
# Relations
|
5
4
|
#
|
6
5
|
|
7
|
-
# The session in which the event occurred.
|
8
6
|
belongs_to :session,
|
9
7
|
class_name: 'Mdm::Session',
|
10
8
|
inverse_of: :events
|
11
9
|
|
12
|
-
# @!attribute command
|
13
|
-
# The command that was run through the session that triggered this event.
|
14
|
-
#
|
15
|
-
# @return [String]
|
16
|
-
|
17
|
-
# @!attribute created_at
|
18
|
-
# When this event occurred.
|
19
|
-
#
|
20
|
-
# @return [DateTime]
|
21
|
-
|
22
|
-
# @!attribute etype
|
23
|
-
# The type of the event.
|
24
|
-
#
|
25
|
-
# @return [String]
|
26
|
-
|
27
|
-
# @!attribute local_path
|
28
|
-
# The current local directory when {#command} was run.
|
29
|
-
#
|
30
|
-
# @return [String]
|
31
|
-
|
32
|
-
# @!attribute output
|
33
|
-
# The {#output} of running {#command}.
|
34
|
-
#
|
35
|
-
# @return [String]
|
36
|
-
|
37
|
-
# @!attribute remote_path
|
38
|
-
# The current remote directory when {#command} was run.
|
39
|
-
#
|
40
|
-
# @return [String]
|
41
|
-
|
42
10
|
Metasploit::Concern.run(self)
|
43
11
|
end
|
data/app/models/mdm/tag.rb
CHANGED
@@ -1,70 +1,32 @@
|
|
1
|
-
# Tag {#hosts_tags assigned} to {#hosts}. Tags can be used to group together hosts for targeting and reporting.
|
2
1
|
class Mdm::Tag < ActiveRecord::Base
|
3
2
|
include Metasploit::Model::Search
|
4
3
|
|
5
4
|
#
|
6
|
-
#
|
5
|
+
# Relations
|
7
6
|
#
|
8
7
|
|
9
|
-
#
|
8
|
+
# @!attribute hosts_tags
|
9
|
+
# Joins {#hosts} to this tag.
|
10
|
+
#
|
11
|
+
# @return [ActiveRecord::Relation<Mdm::HostTag>]
|
10
12
|
has_many :hosts_tags,
|
11
13
|
class_name: 'Mdm::HostTag',
|
12
14
|
dependent: :destroy,
|
13
15
|
inverse_of: :tag
|
14
16
|
|
15
|
-
# User that created this tag.
|
16
17
|
belongs_to :user,
|
17
18
|
class_name: 'Mdm::User',
|
18
19
|
inverse_of: :tags
|
19
20
|
|
20
21
|
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
|
24
|
-
# Hosts that are tagged with this tag.
|
25
|
-
has_many :hosts, :through => :hosts_tags, :class_name => 'Mdm::Host'
|
26
|
-
|
27
|
-
#
|
28
|
-
# Attributes
|
29
|
-
#
|
30
|
-
|
31
|
-
# @!attribute created_at
|
32
|
-
# When this tag was created by {#user}.
|
33
|
-
#
|
34
|
-
# @return [DateTime]
|
35
|
-
|
36
|
-
# @!attribute critical
|
37
|
-
# Whether this tag represents a critical finding about the {#hosts}.
|
22
|
+
# Through :hosts_tags
|
38
23
|
#
|
39
|
-
# @return [true] this tag is critical.
|
40
|
-
# @return [false] this tag is non-critical.
|
41
24
|
|
42
|
-
# @!attribute
|
43
|
-
#
|
25
|
+
# @!attribute [r] hosts
|
26
|
+
# Host that are tagged with this tag.
|
44
27
|
#
|
45
|
-
# @return [
|
46
|
-
|
47
|
-
# @!attribute name
|
48
|
-
# The name of the tag. The name is what a user actually enters to tag a {#hosts host}.
|
49
|
-
#
|
50
|
-
# @return [String]
|
51
|
-
|
52
|
-
# @!attribute report_detail
|
53
|
-
# Whether to include this tag in a report details section.
|
54
|
-
#
|
55
|
-
# @return [true] include this tag in the report details section.
|
56
|
-
# @return [false] do not include this tag in the report details section.
|
57
|
-
|
58
|
-
# @!attribute report_summary
|
59
|
-
# Whether to include this tag in a report summary section.
|
60
|
-
#
|
61
|
-
# @return [true] include this tag in the report summary section.
|
62
|
-
# @return [false] do not include this tag in the report summary section.
|
63
|
-
|
64
|
-
# @!attribute updated_at
|
65
|
-
# The last time this tag was updated.
|
66
|
-
#
|
67
|
-
# @return [DateTime]
|
28
|
+
# @return [ActiveRecord::Relation<Mdm::Host>]
|
29
|
+
has_many :hosts, :through => :hosts_tags, :class_name => 'Mdm::Host'
|
68
30
|
|
69
31
|
#
|
70
32
|
# Search
|
@@ -105,7 +67,6 @@ class Mdm::Tag < ActiveRecord::Base
|
|
105
67
|
end
|
106
68
|
end
|
107
69
|
|
108
|
-
# (see #name)
|
109
70
|
def to_s
|
110
71
|
name
|
111
72
|
end
|