@@ -140,10 +140,9 @@ def set_exploit_options(xploit)
140
140
xploit . datastore [ 'DisablePayloadHandler' ] = true
141
141
xploit . datastore [ 'BrowserProfilePrefix' ] = browser_profile_prefix
142
142
xploit . datastore [ 'URIPATH' ] = "/#{ assign_module_resource } "
143
- xploit . datastore [ 'WORKSPACE' ] = self . workspace
144
143
145
- # TODO: Add BAPv2 tracking information (?) - HD
146
- # TODO: Change exploit output options? - HD
144
+ # Register this module as a child and copy datastore options
145
+ xploit . register_parent ( self )
147
146
end
148
147
149
148
@@ -152,12 +151,13 @@ def set_exploit_options(xploit)
152
151
# @param resource [String] The resource to check.
153
152
# @return [TrueClass] Resource is taken.
154
153
# @return [FalseClass] Resource is not taken.
155
- # TODO: Prevent partial prefix match - HD
156
154
def is_resource_taken? ( resource )
157
155
taken = false
158
156
159
157
bap_exploits . each do |m |
160
- return true if m . datastore [ 'URIPATH' ] == resource
158
+ # Prevent partial matching of one resource within another
159
+ return true if m . datastore [ 'URIPATH' ] . index ( resource )
160
+ return true if resource . index ( m . datastore [ 'URIPATH' ] )
161
161
end
162
162
163
163
taken
@@ -206,8 +206,10 @@ def sort_bap_exploits
206
206
# @return [Hash] A hash with each module list sorted by disclosure date.
207
207
def sort_date_in_group ( bap_groups )
208
208
bap_groups . each_pair do |ranking , module_list |
209
- # TODO: Handle wonky dates in local modules better - HD
210
- bap_groups [ ranking ] = module_list . sort_by { |m | Date . parse ( m . disclosure_date . to_s ) } . reverse
209
+ bap_groups [ ranking ] = module_list . sort_by { |m |
210
+ dstr = m . disclosure_date || "1970-01-01"
211
+ Date . parse ( dstr ) rescue Date . parse ( "1970-01-01" )
212
+ } . reverse
211
213
end
212
214
end
213
215
@@ -337,8 +339,9 @@ def start_payload_listeners
337
339
# Configurable only by BAP
338
340
multi_handler . datastore [ 'ExitOnSession' ] = false
339
341
multi_handler . datastore [ 'EXITFUNC' ] = 'thread'
340
- multi_handler . datastore [ 'WORKSPACE' ] = self . workspace
341
342
343
+ # Register this module as a child and copy datastore options
344
+ multi_handler . register_parent ( self )
342
345
343
346
# Now we're ready to start the handler
344
347
multi_handler . exploit_simple (
0 commit comments