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.

- 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.

webcam_snap could have arguments :
-h : to display the help banner.
-i
-p
-q
-v

- 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.

record_mic could have arguments :
-h : to display the help banner.
-d
-f
-p

- (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
-f : Just grab a single frame.
-g : Send to the GUI instead of writing file.
-i
-l : Keep capturing in a loop, by default (useless).
-p
-q

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

Nice Toturials and nice commands