metasploit_data_models 6.0.4 → 6.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01f5880c5ba12f39dc6eeddebb5cccea705bc826fdb638f890aa56d910284e56
4
- data.tar.gz: 2173e9f9c5579a0ae4e1cdfa5be1500e8b35f46c0020d65d15d337252ac9e590
3
+ metadata.gz: 8729f3b36a9dba01a242ef1771a411729d487ea4a46cdef91738089c9d6844dc
4
+ data.tar.gz: 7cf123db2f63c885f9b6ba349310a93f14ce594929975df5d83b5dc0376757b3
5
5
  SHA512:
6
- metadata.gz: ebd5f964a69477d7f9073b036745b37da6bf7c00f1b99f2c107a2a29f846dac0f2fbf3d621757cf6be815c568d03bbbe300bef1649326322b1a07562c07524b6
7
- data.tar.gz: 0ec664ac1662f3575c7e40de104cc9b3dba9d81438e193f70e9e791bbce62635ab3e3151ebe3ba975c2268c2298e5200cc8dde32b78b63a574e8316c33cd3385
6
+ metadata.gz: 27a0720202b2b0b528ad7018fedbe095432f36be5fc2a3c8f6adc3f7aead9465930fdf0a0a69d373bdf83070a824a8e10b2ce0ce812f7e3f72c801920fe14b76
7
+ data.tar.gz: 6c8e79021ddb0d9b9cefbd1944f2b6d1f92c2dd51866373975996a7ea4c18c058e0acfc7b4c8b6283425def448a75956bced3fa9343b4716d5c333f44da6a3e8
checksums.yaml.gz.sig CHANGED
Binary file
@@ -72,7 +72,11 @@ class Mdm::Event < ApplicationRecord
72
72
  # {#name}-specific information about this event.
73
73
  #
74
74
  # @return [Hash]
75
- serialize :info, coder: MetasploitDataModels::Base64Serializer.new
75
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
76
+ serialize :info, coder: MetasploitDataModels::Base64Serializer.new(coerce: true)
77
+ else
78
+ serialize :info, MetasploitDataModels::Base64Serializer.new(coerce: true)
79
+ end
76
80
 
77
81
  #
78
82
  # Validations
@@ -69,7 +69,11 @@ class Mdm::Listener < ApplicationRecord
69
69
  # Options used to spawn this listener.
70
70
  #
71
71
  # @return [Hash]
72
- serialize :options, coder: MetasploitDataModels::Base64Serializer.new
72
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
73
+ serialize :options, coder: MetasploitDataModels::Base64Serializer.new(coerce: true)
74
+ else
75
+ serialize :options, MetasploitDataModels::Base64Serializer.new(coerce: true)
76
+ end
73
77
 
74
78
  #
75
79
  # Validations
@@ -140,7 +140,11 @@ class Mdm::Loot < ApplicationRecord
140
140
  # Serializations
141
141
  #
142
142
 
143
- serialize :data, coder: MetasploitDataModels::Base64Serializer.new
143
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
144
+ serialize :data, coder: MetasploitDataModels::Base64Serializer.new
145
+ else
146
+ serialize :data, MetasploitDataModels::Base64Serializer.new
147
+ end
144
148
 
145
149
  private
146
150
 
@@ -39,12 +39,20 @@ class Mdm::Macro < ApplicationRecord
39
39
  #
40
40
  # @return [Array<Hash{Symbol=>Object}>] Array of action hashes. Each action hash is have key :module with value
41
41
  # of an {Mdm::Module::Detail#fullname} and and key :options with value of options used to the run the module.
42
- serialize :actions, coder: MetasploitDataModels::Base64Serializer.new
42
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
43
+ serialize :actions, coder: MetasploitDataModels::Base64Serializer.new
44
+ else
45
+ serialize :actions, MetasploitDataModels::Base64Serializer.new
46
+ end
43
47
 
44
48
  # Preference for this macro, shared across all actions.
45
49
  #
46
50
  # @return [Hash]
47
- serialize :prefs, coder: MetasploitDataModels::Base64Serializer.new
51
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
52
+ serialize :prefs, coder: MetasploitDataModels::Base64Serializer.new
53
+ else
54
+ serialize :prefs, MetasploitDataModels::Base64Serializer.new
55
+ end
48
56
 
49
57
  # The maximum number of seconds that this macro is allowed to run.
50
58
  #
@@ -89,7 +89,11 @@ class Mdm::NexposeConsole < ApplicationRecord
89
89
  # List of sites known to Nexpose.
90
90
  #
91
91
  # @return [Array<String>] Array of site names.
92
- serialize :cached_sites, coder: MetasploitDataModels::Base64Serializer.new
92
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
93
+ serialize :cached_sites, coder: MetasploitDataModels::Base64Serializer.new
94
+ else
95
+ serialize :cached_sites, MetasploitDataModels::Base64Serializer.new
96
+ end
93
97
 
94
98
  #
95
99
  # Validations
@@ -113,7 +117,7 @@ class Mdm::NexposeConsole < ApplicationRecord
113
117
  #
114
118
  # @return [void]
115
119
  def strip_protocol
116
- self.address.gsub!(/^http(s)*:\/\//i,'') unless self.address.nil?
120
+ self.address.gsub!(/^http(s)*:\/\//i,'') unless self.address.nil?
117
121
  end
118
122
 
119
123
  Metasploit::Concern.run(self)
@@ -1,6 +1,6 @@
1
1
  # Data gathered or derived from the {#host} or {#service} such as its {#ntype fingerprint}.
2
2
  class Mdm::Note < ApplicationRecord
3
-
3
+
4
4
  #
5
5
  # Associations
6
6
  #
@@ -107,7 +107,11 @@ class Mdm::Note < ApplicationRecord
107
107
  # Serializations
108
108
  #
109
109
 
110
- serialize :data, coder: ::MetasploitDataModels::Base64Serializer.new
110
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
111
+ serialize :data, coder: ::MetasploitDataModels::Base64Serializer.new
112
+ else
113
+ serialize :data, ::MetasploitDataModels::Base64Serializer.new
114
+ end
111
115
 
112
116
  private
113
117
 
@@ -38,7 +38,11 @@ class Mdm::Profile < ApplicationRecord
38
38
  # Global settings.
39
39
  #
40
40
  # @return [Hash]
41
- serialize :settings, coder: MetasploitDataModels::Base64Serializer.new
41
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
42
+ serialize :settings, coder: MetasploitDataModels::Base64Serializer.new
43
+ else
44
+ serialize :settings, MetasploitDataModels::Base64Serializer.new
45
+ end
42
46
 
43
47
  Metasploit::Concern.run(self)
44
48
  end
@@ -1,7 +1,7 @@
1
1
  # A session opened on a {#host} using an {#via_exploit exploit} and controlled through a {#via_payload payload} to
2
2
  # connect back to the local host using meterpreter or a cmd shell.
3
3
  class Mdm::Session < ApplicationRecord
4
-
4
+
5
5
  #
6
6
  # Associations
7
7
  #
@@ -172,7 +172,11 @@ class Mdm::Session < ApplicationRecord
172
172
  # Serializations
173
173
  #
174
174
 
175
- serialize :datastore, coder: ::MetasploitDataModels::Base64Serializer.new
175
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
176
+ serialize :datastore, coder: ::MetasploitDataModels::Base64Serializer.new(coerce: true)
177
+ else
178
+ serialize :datastore, ::MetasploitDataModels::Base64Serializer.new(coerce: true)
179
+ end
176
180
 
177
181
  # Returns whether the session can be upgraded to a meterpreter session from a shell session on Windows.
178
182
  #
@@ -130,17 +130,29 @@ class Mdm::Task < ApplicationRecord
130
130
  # Options passed to `#module`.
131
131
  #
132
132
  # @return [Hash]
133
- serialize :options, coder: MetasploitDataModels::Base64Serializer.new
133
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
134
+ serialize :options, coder: MetasploitDataModels::Base64Serializer.new(coerce: true)
135
+ else
136
+ serialize :options, MetasploitDataModels::Base64Serializer.new(coerce: true)
137
+ end
134
138
 
135
139
  # Result of task running.
136
140
  #
137
141
  # @return [Hash]
138
- serialize :result, coder: MetasploitDataModels::Base64Serializer.new
142
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
143
+ serialize :result, coder: MetasploitDataModels::Base64Serializer.new(coerce: true)
144
+ else
145
+ serialize :result, MetasploitDataModels::Base64Serializer.new(coerce: true)
146
+ end
139
147
 
140
148
  # Settings used to configure this task outside of the {#options module options}.
141
149
  #
142
150
  # @return [Hash]
143
- serialize :settings, coder: MetasploitDataModels::Base64Serializer.new
151
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
152
+ serialize :settings, coder: MetasploitDataModels::Base64Serializer.new(coerce: true)
153
+ else
154
+ serialize :settings, MetasploitDataModels::Base64Serializer.new(coerce: true)
155
+ end
144
156
 
145
157
  #
146
158
  # Instance Methods
@@ -1,7 +1,7 @@
1
1
  # A user of metasploit-framework or metasploit-pro.
2
2
  class Mdm::User < ApplicationRecord
3
3
  extend MetasploitDataModels::SerializedPrefs
4
-
4
+
5
5
  #
6
6
  # Associations
7
7
  #
@@ -109,7 +109,11 @@ class Mdm::User < ApplicationRecord
109
109
  # Hash of user preferences
110
110
  #
111
111
  # @return [Hash]
112
- serialize :prefs, coder: MetasploitDataModels::Base64Serializer.new
112
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
113
+ serialize :prefs, coder: MetasploitDataModels::Base64Serializer.new
114
+ else
115
+ serialize :prefs, MetasploitDataModels::Base64Serializer.new
116
+ end
113
117
 
114
118
  # @!attribute time_zone
115
119
  # User's preferred time zone.
@@ -1,6 +1,6 @@
1
1
  # A filled-in form on a {#web_site}.
2
2
  class Mdm::WebForm < ApplicationRecord
3
-
3
+
4
4
  #
5
5
  # Associations
6
6
  #
@@ -46,7 +46,11 @@ class Mdm::WebForm < ApplicationRecord
46
46
  # Parameters submitted in this form.
47
47
  #
48
48
  # @return [Array<Array(String, String)>>]
49
- serialize :params, coder: MetasploitDataModels::Base64Serializer.new
49
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
50
+ serialize :params, coder: MetasploitDataModels::Base64Serializer.new
51
+ else
52
+ serialize :params, MetasploitDataModels::Base64Serializer.new
53
+ end
50
54
 
51
55
  Metasploit::Concern.run(self)
52
56
  end
@@ -81,12 +81,20 @@ class Mdm::WebPage < ApplicationRecord
81
81
  # Headers sent from server.
82
82
  #
83
83
  # @return [Hash{String => String}]
84
- serialize :headers, coder: MetasploitDataModels::Base64Serializer.new
84
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
85
+ serialize :headers, coder: MetasploitDataModels::Base64Serializer.new
86
+ else
87
+ serialize :headers, MetasploitDataModels::Base64Serializer.new
88
+ end
85
89
 
86
90
  # Cookies sent from server.
87
91
  #
88
92
  # @return [Hash{String => String}]
89
- serialize :cookie, coder: MetasploitDataModels::Base64Serializer.new
93
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
94
+ serialize :cookie, coder: MetasploitDataModels::Base64Serializer.new
95
+ else
96
+ serialize :cookie, MetasploitDataModels::Base64Serializer.new
97
+ end
90
98
  Metasploit::Concern.run(self)
91
99
  end
92
100
 
@@ -1,6 +1,6 @@
1
1
  # A Web Site running on a {#service}.
2
2
  class Mdm::WebSite < ApplicationRecord
3
-
3
+
4
4
  #
5
5
  # Associations
6
6
  #
@@ -60,7 +60,11 @@ class Mdm::WebSite < ApplicationRecord
60
60
 
61
61
  # @!attribute [rw] options
62
62
  # @todo Determine format and purpose of Mdm::WebSite#options.
63
- serialize :options, coder: ::MetasploitDataModels::Base64Serializer.new
63
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
64
+ serialize :options, coder: ::MetasploitDataModels::Base64Serializer.new
65
+ else
66
+ serialize :options, ::MetasploitDataModels::Base64Serializer.new
67
+ end
64
68
 
65
69
  #
66
70
  # Instance Methods
@@ -11,7 +11,7 @@
11
11
  # end
12
12
  # end
13
13
  class Mdm::WebVuln < ApplicationRecord
14
-
14
+
15
15
  #
16
16
  # CONSTANTS
17
17
  #
@@ -141,7 +141,11 @@ class Mdm::WebVuln < ApplicationRecord
141
141
  # Parameters sent as part of request
142
142
  #
143
143
  # @return [Array<Array(String, String)>] Array of parameter key value pairs
144
- serialize :params, coder: MetasploitDataModels::Base64Serializer.new(:default => DEFAULT_PARAMS)
144
+ if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
145
+ serialize :params, coder: MetasploitDataModels::Base64Serializer.new(default: DEFAULT_PARAMS)
146
+ else
147
+ serialize :params, MetasploitDataModels::Base64Serializer.new(default: DEFAULT_PARAMS)
148
+ end
145
149
 
146
150
  #
147
151
  # Methods
data/cortex.yaml CHANGED
@@ -10,6 +10,8 @@ info:
10
10
  x-cortex-type: service
11
11
  x-cortex-domain-parents:
12
12
  - tag: metasploit
13
+ x-cortex-groups:
14
+ - exposure:external-ship
13
15
  openapi: 3.0.1
14
16
  servers:
15
17
  - url: "/"
@@ -15,6 +15,10 @@ class MetasploitDataModels::Base64Serializer
15
15
 
16
16
  # The default for {#default}
17
17
  DEFAULT = {}
18
+
19
+ # The default for {#coerce}
20
+ COERCE_DEFAULT = false
21
+
18
22
  # Deserializers for {#load}
19
23
  # 1. Base64 decoding and then unmarshalling the value.
20
24
  # 2. Parsing the value as YAML.
@@ -47,6 +51,24 @@ class MetasploitDataModels::Base64Serializer
47
51
  end
48
52
 
49
53
  attr_writer :default
54
+ attr_writer :coerce
55
+
56
+ # Recursively coerce the object that has been passed in, keeping primitive types as their original type,
57
+ # while changing objects that cannot be serialized into a string representation of the object data.
58
+ def coerce_object(value)
59
+ case value
60
+ when Hash
61
+ value.transform_values { |v| coerce_object(v) }
62
+ when Array
63
+ value.map { |v| coerce_object(v) }
64
+ when File, IO
65
+ value.inspect
66
+ when String, Integer, Float, TrueClass, FalseClass, NilClass, Symbol
67
+ value
68
+ else
69
+ value.to_s
70
+ end
71
+ end
50
72
 
51
73
  # Serializes the value by marshalling the value and then base64 encodes the marshaled value.
52
74
  #
@@ -54,7 +76,8 @@ class MetasploitDataModels::Base64Serializer
54
76
  # @return [String]
55
77
  def dump(value)
56
78
  # Always store data back in the Marshal format
57
- marshalled = Marshal.dump(value)
79
+ to_serialize = @coerce ? coerce_object(value) : value
80
+ marshalled = Marshal.dump(to_serialize)
58
81
  base64_encoded = [ marshalled ].pack('m')
59
82
 
60
83
  base64_encoded
@@ -63,9 +86,10 @@ class MetasploitDataModels::Base64Serializer
63
86
  # @param attributes [Hash] attributes
64
87
  # @option attributes [Object] :default ({}) Value to use for {#default}.
65
88
  def initialize(attributes={})
66
- attributes.assert_valid_keys(:default)
89
+ attributes.assert_valid_keys(:default, :coerce)
67
90
 
68
91
  @default = attributes.fetch(:default, DEFAULT)
92
+ @coerce = attributes.fetch(:coerce, COERCE_DEFAULT)
69
93
  end
70
94
 
71
95
  # Deserializes the value by either
@@ -1,6 +1,6 @@
1
1
  module MetasploitDataModels
2
2
  # VERSION is managed by GemRelease
3
- VERSION = '6.0.4'
3
+ VERSION = '6.0.6'
4
4
 
5
5
  # @return [String]
6
6
  #
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.4
4
+ version: 6.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -34,7 +34,7 @@ cert_chain:
34
34
  DgscAao7wB3xW2BWEp1KnaDWkf1x9ttgoBEYyuYwU7uatB67kBQG1PKvLt79wHvz
35
35
  Dxs+KOjGbBRfMnPgVGYkORKVrZIwlaboHbDKxcVW5xv+oZc7KYXWGg==
36
36
  -----END CERTIFICATE-----
37
- date: 2024-06-12 00:00:00.000000000 Z
37
+ date: 2025-02-13 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: metasploit-yard
@@ -727,7 +727,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
727
727
  - !ruby/object:Gem::Version
728
728
  version: '0'
729
729
  requirements: []
730
- rubygems_version: 3.3.24
730
+ rubygems_version: 3.3.3
731
731
  signing_key:
732
732
  specification_version: 4
733
733
  summary: Database code for MSF and Metasploit Pro
metadata.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- -Y��(\1�#�t{:!����r�����)#ȝ��R�["���3
2
- �$�'U�Zho��6�YiXz�����ld��F��>�փT4�KKI�&��̜�;2�^˟8#-�#�?������١\�����`����u|��H���K�K�@ɢ��7��-��ֈ.̅_jk�CA|@�������I?�sC��n1�_lʄ8�@8�>"n(ۃ�(���Ⱦ�!cx���$�վj�%6���<0��*�d��ztyƳ��M���IY~��L�/-�NiN�q�S1�,��I�n%������+_Y�<j�e$�ud��w���aN�Q�x#(���3��T1��������Y�,�j~Z�?ԏ�ҏ�q����˼NZ֗0�����(8�
1
+ `�U��3uEh?�v��N>���I��&z)_ ����&�(WBͭ�J�b�iNb�R�4D��>;465���4D���Z����ޤ�7y�z���4�^N
2
+ ��
3
+ ���}R�r)�B�eo�G����5���Xw��U ���h WXefI�sOԅ���@�T{�L���>�>�b�z�ȧ�S���d�����-��k��7NXb�P�=���+w���ԭ��,G��%k;���
4
+ T�8�\���//�r�i>�%FE���V�����G�Սk�� g/R