Skip to content

Commit 6b117d7

Browse files
committed
2 parents 65b316c + 0c1d02c commit 6b117d7

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

lib/msf/core/event_dispatcher.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def method_missing(name, *args)
176176
found = false
177177
case event
178178
when "on"
179-
if respond_to?(subscribers)
179+
if respond_to?(subscribers, true)
180180
found = true
181181
self.send(subscribers).each do |sub|
182182
next if not sub.respond_to?(name)
@@ -221,11 +221,11 @@ def remove_event_subscriber(array, subscriber) # :nodoc:
221221
array.delete(subscriber)
222222
end
223223

224-
attr_accessor :general_event_subscribers # :nodoc:
225224
attr_accessor :custom_event_subscribers # :nodoc:
225+
attr_accessor :db_event_subscribers # :nodoc:
226226
attr_accessor :exploit_event_subscribers # :nodoc:
227+
attr_accessor :general_event_subscribers # :nodoc:
227228
attr_accessor :session_event_subscribers # :nodoc:
228-
attr_accessor :db_event_subscribers # :nodoc:
229229
attr_accessor :ui_event_subscribers # :nodoc:
230230

231231
end

lib/msf/core/payload.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ def compatible_nops
449449
#
450450
def on_session(session)
451451

452-
453452
# If this payload is associated with an exploit, inform the exploit
454453
# that a session has been created and potentially shut down any
455454
# open sockets. This allows active exploits to continue hammering

plugins/event_tester.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@ def name; "event_tester"; end
2121
def initialize(framework, opts)
2222
super
2323
@subscriber = Subscriber.new
24+
framework.events.add_custom_subscriber(@subscriber)
25+
framework.events.add_db_subscriber(@subscriber)
2426
framework.events.add_exploit_subscriber(@subscriber)
25-
framework.events.add_session_subscriber(@subscriber)
2627
framework.events.add_general_subscriber(@subscriber)
27-
framework.events.add_db_subscriber(@subscriber)
28+
framework.events.add_session_subscriber(@subscriber)
2829
framework.events.add_ui_subscriber(@subscriber)
2930
end
3031
def cleanup
32+
framework.events.remove_custom_subscriber(@subscriber)
33+
framework.events.remove_db_subscriber(@subscriber)
3134
framework.events.remove_exploit_subscriber(@subscriber)
32-
framework.events.remove_session_subscriber(@subscriber)
3335
framework.events.remove_general_subscriber(@subscriber)
34-
framework.events.remove_db_subscriber(@subscriber)
36+
framework.events.remove_session_subscriber(@subscriber)
3537
framework.events.remove_ui_subscriber(@subscriber)
3638
end
3739
end

0 commit comments

Comments
 (0)