2012-05-22 08:03:30 +00:00
|
|
|
##
|
2017-07-24 13:26:21 +00:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2012-05-22 08:03:30 +00:00
|
|
|
##
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Post
|
2012-05-22 08:03:30 +00:00
|
|
|
|
2013-09-05 18:41:25 +00:00
|
|
|
def initialize(info={})
|
|
|
|
super( update_info( info,
|
|
|
|
'Name' => "OS X Text to Speech Utility",
|
|
|
|
'Description' => %q{
|
|
|
|
This module will speak whatever is in the 'TEXT' option on the victim machine.
|
|
|
|
},
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['URL', 'http://www.gabrielserafini.com/blog/2008/08/19/mac-os-x-voices-for-using-with-the-say-command/']
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => [ 'sinn3r'],
|
|
|
|
'Platform' => [ 'osx' ],
|
2015-09-10 20:57:43 +00:00
|
|
|
'SessionTypes' => [ "meterpreter", "shell" ]
|
2013-09-05 18:41:25 +00:00
|
|
|
))
|
2012-05-22 08:03:30 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('TEXT', [true, 'The text to say', "meta-sploit\!"]),
|
|
|
|
OptString.new('VOICE', [true, 'The voice to use', 'alex'])
|
2017-05-03 20:42:21 +00:00
|
|
|
])
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2012-05-22 08:03:30 +00:00
|
|
|
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exec(cmd)
|
|
|
|
tries = 0
|
|
|
|
begin
|
|
|
|
out = cmd_exec(cmd).chomp
|
|
|
|
rescue ::Timeout::Error => e
|
|
|
|
tries += 1
|
|
|
|
if tries < 3
|
|
|
|
vprint_error("#{@peer} - #{e.message} - retrying...")
|
|
|
|
retry
|
|
|
|
end
|
|
|
|
rescue EOFError => e
|
|
|
|
tries += 1
|
|
|
|
if tries < 3
|
|
|
|
vprint_error("#{@peer} - #{e.message} - retrying...")
|
|
|
|
retry
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-05-22 08:03:30 +00:00
|
|
|
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run
|
|
|
|
txt = datastore['TEXT']
|
|
|
|
voice = datastore['VOICE']
|
2012-05-22 08:03:30 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Say the text
|
|
|
|
out = cmd_exec("say -v \"#{voice}\" \"#{txt}\"")
|
|
|
|
if out =~ /command not found/
|
|
|
|
print_error("The remote machine does not have the \'say\' command")
|
|
|
|
elsif not out.empty?
|
|
|
|
print_status(out)
|
|
|
|
end
|
|
|
|
end
|
2013-08-29 18:37:50 +00:00
|
|
|
end
|