Land #6285, excellent new sound plugin scheme
commit
eb57163db6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -155,7 +155,14 @@ class Exploit
|
||||||
# If we didn't run a payload handler for this exploit it doesn't
|
# If we didn't run a payload handler for this exploit it doesn't
|
||||||
# make sense to complain to the user that we didn't get a session
|
# make sense to complain to the user that we didn't get a session
|
||||||
unless (mod.datastore["DisablePayloadHandler"])
|
unless (mod.datastore["DisablePayloadHandler"])
|
||||||
print_status("Exploit completed, but no session was created.")
|
fail_msg = 'Exploit completed, but no session was created.'
|
||||||
|
print_status(fail_msg)
|
||||||
|
begin
|
||||||
|
framework.events.on_session_fail(fail_msg)
|
||||||
|
rescue ::Exception => e
|
||||||
|
wlog("Exception in on_session_open event handler: #{e.class}: #{e}")
|
||||||
|
wlog("Call Stack\n#{e.backtrace.join("\n")}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,6 +37,9 @@ module FrameworkEventManager
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def on_session_fail(reason='')
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Called when a session is closed and removed from the framework.
|
# Called when a session is closed and removed from the framework.
|
||||||
#
|
#
|
||||||
|
|
|
@ -13,8 +13,8 @@ module Msf
|
||||||
|
|
||||||
class Plugin::EventSounds < Msf::Plugin
|
class Plugin::EventSounds < Msf::Plugin
|
||||||
|
|
||||||
|
|
||||||
attr_accessor :theme, :base, :queue, :queue_thread
|
attr_accessor :theme, :base, :queue, :queue_thread
|
||||||
|
attr_reader :try_harder, :excellent, :got_a_shell, :exploit_worked, :wonderful
|
||||||
|
|
||||||
include Msf::SessionEvent
|
include Msf::SessionEvent
|
||||||
|
|
||||||
|
@ -23,25 +23,27 @@ class Plugin::EventSounds < Msf::Plugin
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_session_open(session)
|
def on_session_open(session)
|
||||||
event = 'session_open_' + session.type
|
sound = [
|
||||||
play_sound(event)
|
excellent,
|
||||||
|
got_a_shell,
|
||||||
|
exploit_worked,
|
||||||
|
wonderful
|
||||||
|
].sample
|
||||||
|
play_sound(sound)
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_session_close(session, reason='')
|
def on_session_close(session, reason='')
|
||||||
sid = session.sid.to_s
|
# Cannot find an audio clip of muts saying something suitable for this.
|
||||||
play_sound('session')
|
end
|
||||||
sid.unpack("C*").each do |c|
|
|
||||||
play_sound("num" + [c].pack("C"))
|
def on_session_fail(reason='')
|
||||||
end
|
play_sound(try_harder)
|
||||||
play_sound('closed')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_plugin_load
|
def on_plugin_load
|
||||||
play_sound('plugin_load')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_plugin_unload
|
def on_plugin_unload
|
||||||
play_sound('plugin_unload')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def start_sound_queue
|
def start_sound_queue
|
||||||
|
@ -49,7 +51,7 @@ class Plugin::EventSounds < Msf::Plugin
|
||||||
begin
|
begin
|
||||||
while(true)
|
while(true)
|
||||||
while(event = self.queue.shift)
|
while(event = self.queue.shift)
|
||||||
path = ::File.join(self.base, self.theme, "#{event}.wav")
|
path = ::File.join(self.base, self.theme, "#{event}.mp3")
|
||||||
if(::File.exists?(path))
|
if(::File.exists?(path))
|
||||||
Rex::Compat.play_sound(path)
|
Rex::Compat.play_sound(path)
|
||||||
else
|
else
|
||||||
|
@ -71,9 +73,20 @@ class Plugin::EventSounds < Msf::Plugin
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def init_sound_paths
|
||||||
|
@try_harder = 'try_harder'
|
||||||
|
@excellent = 'excellent'
|
||||||
|
@got_a_shell = 'got_a_shell'
|
||||||
|
@exploit_worked = 'exploit_worked'
|
||||||
|
@wonderful = 'wonderful'
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def initialize(framework, opts)
|
def initialize(framework, opts)
|
||||||
super
|
super
|
||||||
|
|
||||||
|
init_sound_paths
|
||||||
|
|
||||||
self.queue = []
|
self.queue = []
|
||||||
self.theme = opts['theme'] || 'default'
|
self.theme = opts['theme'] || 'default'
|
||||||
self.base = File.join(Msf::Config.data_directory, "sounds")
|
self.base = File.join(Msf::Config.data_directory, "sounds")
|
||||||
|
|
Loading…
Reference in New Issue