metasploit_data_models 0.24.4 → 0.24.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -3
  3. data/.travis.yml +3 -6
  4. data/CONTRIBUTING.md +52 -10
  5. data/Gemfile +8 -1
  6. data/Rakefile +0 -23
  7. data/app/models/mdm/api_key.rb +1 -41
  8. data/app/models/mdm/client.rb +1 -41
  9. data/app/models/mdm/cred.rb +19 -107
  10. data/app/models/mdm/event.rb +1 -48
  11. data/app/models/mdm/exploit_attempt.rb +16 -65
  12. data/app/models/mdm/exploited_host.rb +1 -28
  13. data/app/models/mdm/host_detail.rb +1 -45
  14. data/app/models/mdm/host_tag.rb +8 -6
  15. data/app/models/mdm/listener.rb +1 -53
  16. data/app/models/mdm/macro.rb +0 -42
  17. data/app/models/mdm/mod_ref.rb +0 -21
  18. data/app/models/mdm/module/action.rb +0 -15
  19. data/app/models/mdm/module/arch.rb +0 -10
  20. data/app/models/mdm/module/author.rb +0 -16
  21. data/app/models/mdm/module/mixin.rb +0 -13
  22. data/app/models/mdm/module/platform.rb +0 -11
  23. data/app/models/mdm/module/target.rb +0 -18
  24. data/app/models/mdm/nexpose_console.rb +4 -82
  25. data/app/models/mdm/profile.rb +0 -36
  26. data/app/models/mdm/route.rb +5 -17
  27. data/app/models/mdm/session_event.rb +1 -33
  28. data/app/models/mdm/tag.rb +10 -49
  29. data/app/models/mdm/task.rb +45 -94
  30. data/app/models/mdm/task_cred.rb +0 -29
  31. data/app/models/mdm/task_host.rb +0 -25
  32. data/app/models/mdm/task_service.rb +0 -25
  33. data/app/models/mdm/task_session.rb +0 -25
  34. data/app/models/mdm/user.rb +6 -188
  35. data/app/models/mdm/vuln_attempt.rb +12 -37
  36. data/app/models/mdm/vuln_detail.rb +5 -139
  37. data/app/models/mdm/vuln_ref.rb +1 -4
  38. data/app/models/mdm/web_form.rb +1 -35
  39. data/app/models/mdm/web_page.rb +1 -70
  40. data/app/models/mdm/web_site.rb +1 -51
  41. data/app/models/mdm/wmap_request.rb +0 -85
  42. data/app/models/mdm/wmap_target.rb +0 -40
  43. data/app/models/mdm/workspace.rb +14 -152
  44. data/app/models/metasploit_data_models/automatic_exploitation.rb +16 -0
  45. data/app/models/metasploit_data_models/automatic_exploitation/match.rb +24 -19
  46. data/app/models/metasploit_data_models/automatic_exploitation/match_result.rb +5 -33
  47. data/app/models/metasploit_data_models/automatic_exploitation/match_set.rb +4 -22
  48. data/app/models/metasploit_data_models/automatic_exploitation/run.rb +3 -13
  49. data/app/models/metasploit_data_models/ip_address/v4/segmented.rb +1 -1
  50. data/app/models/metasploit_data_models/module_run.rb +1 -1
  51. data/app/models/metasploit_data_models/search/visitor/where.rb +1 -1
  52. data/app/validators/ip_format_validator.rb +0 -4
  53. data/app/validators/parameters_validator.rb +0 -12
  54. data/app/validators/password_is_strong_validator.rb +1 -10
  55. data/lib/mdm/host/operating_system_normalization.rb +10 -7
  56. data/lib/metasploit_data_models.rb +0 -4
  57. data/lib/metasploit_data_models/engine.rb +0 -2
  58. data/lib/metasploit_data_models/serialized_prefs.rb +0 -6
  59. data/lib/metasploit_data_models/version.rb +10 -24
  60. data/lib/tasks/yard.rake +33 -0
  61. data/metasploit_data_models.gemspec +2 -9
  62. data/spec/app/models/mdm/api_key_spec.rb +3 -1
  63. data/spec/app/models/mdm/client_spec.rb +11 -9
  64. data/spec/app/models/mdm/cred_spec.rb +54 -42
  65. data/spec/app/models/mdm/event_spec.rb +23 -21
  66. data/spec/app/models/mdm/exploit_attempt_spec.rb +21 -19
  67. data/spec/app/models/mdm/exploited_host_spec.rb +13 -11
  68. data/spec/app/models/mdm/host_detail_spec.rb +17 -15
  69. data/spec/app/models/mdm/host_spec.rb +260 -261
  70. data/spec/app/models/mdm/host_tag_spec.rb +8 -6
  71. data/spec/app/models/mdm/listener_spec.rb +32 -30
  72. data/spec/app/models/mdm/loot_spec.rb +23 -21
  73. data/spec/app/models/mdm/macro_spec.rb +3 -1
  74. data/spec/app/models/mdm/mod_ref_spec.rb +3 -1
  75. data/spec/app/models/mdm/module/action_spec.rb +12 -10
  76. data/spec/app/models/mdm/module/arch_spec.rb +12 -10
  77. data/spec/app/models/mdm/module/author_spec.rb +17 -22
  78. data/spec/app/models/mdm/module/detail_spec.rb +75 -184
  79. data/spec/app/models/mdm/module/mixin_spec.rb +12 -10
  80. data/spec/app/models/mdm/module/platform_spec.rb +12 -10
  81. data/spec/app/models/mdm/module/ref_spec.rb +12 -10
  82. data/spec/app/models/mdm/module/target_spec.rb +15 -13
  83. data/spec/app/models/mdm/nexpose_console_spec.rb +37 -35
  84. data/spec/app/models/mdm/note_spec.rb +25 -23
  85. data/spec/app/models/mdm/profile_spec.rb +3 -1
  86. data/spec/app/models/mdm/ref_spec.rb +12 -10
  87. data/spec/app/models/mdm/route_spec.rb +8 -6
  88. data/spec/app/models/mdm/service_spec.rb +40 -38
  89. data/spec/app/models/mdm/session_event_spec.rb +12 -10
  90. data/spec/app/models/mdm/session_spec.rb +15 -13
  91. data/spec/app/models/mdm/tag_spec.rb +29 -29
  92. data/spec/app/models/mdm/task_cred_spec.rb +11 -9
  93. data/spec/app/models/mdm/task_host_spec.rb +11 -9
  94. data/spec/app/models/mdm/task_service_spec.rb +11 -9
  95. data/spec/app/models/mdm/task_session_spec.rb +9 -7
  96. data/spec/app/models/mdm/task_spec.rb +29 -27
  97. data/spec/app/models/mdm/user_spec.rb +19 -17
  98. data/spec/app/models/mdm/vuln_attempt_spec.rb +16 -14
  99. data/spec/app/models/mdm/vuln_detail_spec.rb +28 -26
  100. data/spec/app/models/mdm/vuln_ref_spec.rb +10 -8
  101. data/spec/app/models/mdm/vuln_spec.rb +26 -24
  102. data/spec/app/models/mdm/web_form_spec.rb +13 -11
  103. data/spec/app/models/mdm/web_page_spec.rb +21 -19
  104. data/spec/app/models/mdm/web_site_spec.rb +23 -21
  105. data/spec/app/models/mdm/web_vuln_spec.rb +65 -63
  106. data/spec/app/models/mdm/wmap_request_spec.rb +3 -1
  107. data/spec/app/models/mdm/wmap_target_spec.rb +3 -1
  108. data/spec/app/models/mdm/workspace_spec.rb +100 -97
  109. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +5 -3
  110. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +15 -13
  111. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +3 -1
  112. data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +3 -1
  113. data/spec/app/models/metasploit_data_models/ip_address/v4/cidr_spec.rb +12 -10
  114. data/spec/app/models/metasploit_data_models/ip_address/v4/nmap_spec.rb +6 -4
  115. data/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +23 -21
  116. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +11 -9
  117. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +23 -21
  118. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/segmented_spec.rb +6 -4
  119. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/single_spec.rb +15 -22
  120. data/spec/app/models/metasploit_data_models/ip_address/v4/single_spec.rb +6 -4
  121. data/spec/app/models/metasploit_data_models/module_run_spec.rb +3 -1
  122. data/spec/app/models/metasploit_data_models/search/operation/ip_address_spec.rb +20 -18
  123. data/spec/app/models/metasploit_data_models/search/operation/port/number_spec.rb +8 -6
  124. data/spec/app/models/metasploit_data_models/search/operation/port/range_spec.rb +10 -8
  125. data/spec/app/models/metasploit_data_models/search/operation/range_spec.rb +10 -8
  126. data/spec/app/models/metasploit_data_models/search/operator/ip_address_spec.rb +4 -2
  127. data/spec/app/models/metasploit_data_models/search/operator/multitext_spec.rb +10 -8
  128. data/spec/app/models/metasploit_data_models/search/operator/port/list_spec.rb +8 -6
  129. data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +11 -9
  130. data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +7 -5
  131. data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +19 -17
  132. data/spec/app/models/metasploit_data_models/search/visitor/method_spec.rb +7 -5
  133. data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +23 -61
  134. data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +10 -8
  135. data/spec/app/validators/parameters_validator_spec.rb +29 -29
  136. data/spec/app/validators/password_is_strong_validator_spec.rb +46 -54
  137. data/spec/dummy/db/structure.sql +3403 -0
  138. data/spec/factories/mdm/module/details.rb +1 -1
  139. data/spec/lib/base64_serializer_spec.rb +19 -19
  140. data/spec/lib/metasploit_data_models/ip_address/cidr_spec.rb +12 -18
  141. data/spec/lib/metasploit_data_models/ip_address/range_spec.rb +6 -4
  142. data/spec/lib/metasploit_data_models/match/child_spec.rb +4 -2
  143. data/spec/lib/metasploit_data_models/match/parent_spec.rb +6 -4
  144. data/spec/lib/metasploit_data_models/version_spec.rb +141 -3
  145. data/spec/spec_helper.rb +12 -86
  146. data/spec/support/shared/examples/mdm/module/detail/does_not_support_stance_with_mtype.rb +2 -2
  147. data/spec/support/shared/examples/mdm/module/detail/supports_stance_with_mtype.rb +4 -4
  148. data/spec/support/shared/examples/metasploit_data_models/search/operation/ipaddress/match.rb +2 -2
  149. data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_children.rb +5 -5
  150. data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_metasploit_model_search_operation_base.rb +5 -5
  151. data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb +3 -3
  152. data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_metasploit_model_search_group_base.rb +6 -7
  153. metadata +9 -67
  154. data/CHANGELOG.md +0 -6
  155. data/RELEASING.md +0 -88
  156. data/UPGRADING.md +0 -1
  157. data/lib/metasploit_data_models/automatic_exploitation.rb +0 -25
  158. data/spec/lib/metasploit_data_models_spec.rb +0 -4
@@ -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
- # Details for vulnerabilities supplied by this Nexpose console.
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
@@ -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)
@@ -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
- # Associations
3
+ # Relations
5
4
  #
6
5
 
7
- # The session over which this route traverses.
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
- # Associations
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
@@ -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
- # Associations
5
+ # Relations
7
6
  #
8
7
 
9
- # Joins {#hosts} to this tag.
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
- # through: :hosts_tags
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 desc
43
- # Longer description of what this tag should be used for or means when applied to a {#hosts host}.
25
+ # @!attribute [r] hosts
26
+ # Host that are tagged with this tag.
44
27
  #
45
- # @return [String]
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