File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ class Module
57
57
# datastore, consumed by #replicant to allow clean override of MSF module methods.
58
58
REPLICANT_EXTENSION_DS_KEY = 'ReplicantExtensions'
59
59
60
+ # The set of keys in {#user_data} that make {#user_data_is_match?} return
61
+ # true
62
+ MATCH_KEYS = Set . new ( [ :match , :match_set , :run ] )
63
+
60
64
# Make include public so we can runtime extend
61
65
public_class_method :include
62
66
@@ -278,12 +282,12 @@ def fail_with(reason, msg=nil)
278
282
raise RuntimeError , "#{ reason . to_s } : #{ msg } "
279
283
end
280
284
281
- # Whether {user_data} contains everything necessary to make a
285
+ # Whether {# user_data} contains everything necessary to make a
282
286
# `MetasploitDataModels::AutomaticExploitation::MatchResult`
283
287
#
284
288
# @return [bool]
285
289
def user_data_is_match?
286
- user_data . kind_of? ( Hash ) && user_data . keys == [ :match , :match_set , :run ]
290
+ user_data . kind_of? ( Hash ) && Set . new ( user_data . keys ) . superset? ( MATCH_KEYS )
287
291
end
288
292
289
293
##
@@ -329,6 +333,8 @@ def self.cached?
329
333
# {Msf::Simple::Exploit#exploit_simple} or
330
334
# {Msf::Simple::Auxiliary#run_simple} for correlating where modules came
331
335
# from.
336
+ #
337
+ # @see #user_data_is_match?
332
338
attr_accessor :user_data
333
339
334
340
protected
You can’t perform that action at this time.
0 commit comments