2010-05-03 19:13:09 +02:00
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
# $Revision$
|
|
|
|
#
|
2009-12-22 19:52:48 +01:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
class Plugin::EventTester < Msf::Plugin
|
2013-09-30 20:47:53 +02:00
|
|
|
class Subscriber
|
2016-02-02 21:29:35 +01:00
|
|
|
def respond_to?(name, *args)
|
|
|
|
# Why yes, I can do that.
|
|
|
|
true
|
|
|
|
end
|
2013-09-30 20:47:53 +02:00
|
|
|
def method_missing(name, *args)
|
|
|
|
$stdout.puts("Event fired: #{name}(#{args.join(", ")})")
|
|
|
|
end
|
|
|
|
end
|
2009-12-22 19:52:48 +01:00
|
|
|
|
2013-09-30 20:47:53 +02:00
|
|
|
def name; "event_tester"; end
|
2009-12-22 19:52:48 +01:00
|
|
|
|
2013-09-30 20:47:53 +02:00
|
|
|
def initialize(framework, opts)
|
|
|
|
super
|
|
|
|
@subscriber = Subscriber.new
|
2014-12-12 03:03:11 +01:00
|
|
|
framework.events.add_custom_subscriber(@subscriber)
|
|
|
|
framework.events.add_db_subscriber(@subscriber)
|
2013-09-30 20:47:53 +02:00
|
|
|
framework.events.add_exploit_subscriber(@subscriber)
|
|
|
|
framework.events.add_general_subscriber(@subscriber)
|
2014-12-12 03:03:11 +01:00
|
|
|
framework.events.add_session_subscriber(@subscriber)
|
2013-09-30 20:47:53 +02:00
|
|
|
framework.events.add_ui_subscriber(@subscriber)
|
|
|
|
end
|
|
|
|
def cleanup
|
2014-12-12 03:03:11 +01:00
|
|
|
framework.events.remove_custom_subscriber(@subscriber)
|
|
|
|
framework.events.remove_db_subscriber(@subscriber)
|
2013-09-30 20:47:53 +02:00
|
|
|
framework.events.remove_exploit_subscriber(@subscriber)
|
|
|
|
framework.events.remove_general_subscriber(@subscriber)
|
2014-12-12 03:03:11 +01:00
|
|
|
framework.events.remove_session_subscriber(@subscriber)
|
2013-09-30 20:47:53 +02:00
|
|
|
framework.events.remove_ui_subscriber(@subscriber)
|
|
|
|
end
|
2009-12-22 19:52:48 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|