Land #6285, excellent new sound plugin scheme

bug/bundler_fix
Brent Cook 2015-11-26 10:41:02 -06:00
commit eb57163db6
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
29 changed files with 36 additions and 13 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
data/sounds/default/excellent.mp3 Executable file

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.

BIN
data/sounds/default/wonderful.mp3 Executable file

Binary file not shown.

View File

@ -155,7 +155,14 @@ class Exploit
# 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
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

View File

@ -37,6 +37,9 @@ module FrameworkEventManager
end
end
def on_session_fail(reason='')
end
#
# Called when a session is closed and removed from the framework.
#

View File

@ -13,8 +13,8 @@ module Msf
class Plugin::EventSounds < Msf::Plugin
attr_accessor :theme, :base, :queue, :queue_thread
attr_reader :try_harder, :excellent, :got_a_shell, :exploit_worked, :wonderful
include Msf::SessionEvent
@ -23,25 +23,27 @@ class Plugin::EventSounds < Msf::Plugin
end
def on_session_open(session)
event = 'session_open_' + session.type
play_sound(event)
sound = [
excellent,
got_a_shell,
exploit_worked,
wonderful
].sample
play_sound(sound)
end
def on_session_close(session, reason='')
sid = session.sid.to_s
play_sound('session')
sid.unpack("C*").each do |c|
play_sound("num" + [c].pack("C"))
end
play_sound('closed')
# Cannot find an audio clip of muts saying something suitable for this.
end
def on_session_fail(reason='')
play_sound(try_harder)
end
def on_plugin_load
play_sound('plugin_load')
end
def on_plugin_unload
play_sound('plugin_unload')
end
def start_sound_queue
@ -49,7 +51,7 @@ class Plugin::EventSounds < Msf::Plugin
begin
while(true)
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))
Rex::Compat.play_sound(path)
else
@ -71,9 +73,20 @@ class Plugin::EventSounds < Msf::Plugin
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)
super
init_sound_paths
self.queue = []
self.theme = opts['theme'] || 'default'
self.base = File.join(Msf::Config.data_directory, "sounds")