Metasploit provide some commands to extend the usage of meterpreter. We will describe here under the usage of webcam, webcam_list, webcam_snap  and record_mic.
First of all you require a valid meterpreter session on a Windows box to use these extensions.

  • webcam_list :

This stdapi command provide you a list of all webcams on the target system. Each webcam will have an index number.

Metasploit stdapi webcam_list

Metasploit stdapi webcam_list

  • webcam_snap :

This stdapi command take a snapshot for the specified webcam, by default number 1 and will try without argument precision to open the saved snapshot.

Metasploit stdapi webcam_snap default

Metasploit stdapi webcam_snap default

webcam_snap could have arguments :

-h : to display the help banner.

-i : The index number of the webcam to use.

-p : The JPEG image file path. By default $HOME/[randomname].jpeg

-q : The JPEG image quality, by default ’50’.

-v : Automatically view the JPEG image, by default ‘true’.

Metasploit stdapi webcam_snap extended

Metasploit stdapi webcam_snap extended

  • record_mic

This stdapi command record audio, by default 1 second, from the default microphone and will try without argument precision to play the captured audio wav file.

Metasploit stdapi record_mic basic

Metasploit stdapi record_mic basic

record_mic could have arguments :

-h : to display the help banner.

-d : Number of seconds to record, by default 1 second (useless).

-f : The wav file path. By default $HOME/[randomname].wav

-p : Automatically play the captured audio, by default ‘true’.

Metasploit stdapi record_mic advanced

Metasploit stdapi record_mic advanced

  • (bg)run webcam

Same as the stdapi webcam_snap command, but with loop delay interval to refresh the displayed jpeg snap. A refreshed HTML file, “webcam.htm”, will provide you each x milliseconds a new snapshot. You can invoke the webcam script with run or bgrun meterpreter command.

The possible arguments to begin a recording are :

-h : to display the help banner.

-d : Loop delay interval in milliseconds, by default 1000.

-f : Just grab a single frame.

-g : Send to the GUI instead of writing file.

-i : The index of the webcam to use, by default 1.

-l : Keep capturing in a loop, by default (useless).

-p : The path to the folder images will be saved in, by default current working directory.

-q : The JPEG quality, by default ’50’.

Metasploit Meterpreter run webcam ruby script

Metasploit Meterpreter run webcam ruby script

To stop the webcam recording, just type the following command :

Metasploit Meterpreter stop webcam ruby script

Metasploit Meterpreter stop webcam ruby script