Skip to content

Commit d62f0cf

Browse files
committed
Add the mic stop command
1 parent 40ce03b commit d62f0cf

File tree

3 files changed

+8
-34
lines changed

3 files changed

+8
-34
lines changed

lib/rex/post/meterpreter/extensions/stdapi/mic/mic.rb

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ def mic_list
3333
names << tlv.value
3434
end
3535
names
36-
# response = client.send_request(Packet.create_request('webcam_list'))
37-
# names = []
38-
# response.get_tlvs(TLV_TYPE_WEBCAM_NAME).each do |tlv|
39-
# names << tlv.value
40-
# end
41-
# names
4236
end
4337

4438
# Starts recording video from video source of index +cam+
@@ -61,31 +55,6 @@ def mic_stop
6155
true
6256
end
6357

64-
# # Starts streaming from audio source of index
65-
# def mic_start
66-
# request = Packet.create_request('audio_interface_start')
67-
#
68-
# response = client.send_request(request)
69-
# channel_id = response.get_tlv_value(TLV_TYPE_CHANNEL_ID)
70-
#
71-
# if(channel_id)
72-
# # audio_channel = Rex::Post::Meterpreter::Channels::Pools::StreamPool.new(
73-
# # client,
74-
# # channel_id,
75-
# # "stdapi_net_mic_broadcast",
76-
# # CHANNEL_FLAG_SYNCHRONOUS
77-
# # )
78-
# audio_channel = Rex::Post::Meterpreter::Channels::Pools::Audio.open(self.client)
79-
# end
80-
#
81-
# return response, audio_channel
82-
# end
83-
84-
# def mic_stop
85-
# client.send_request(Packet.create_request('mic_stop'))
86-
# true
87-
# end
88-
8958
attr_accessor :client
9059
end
9160
end

lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def shutdown
5252
client.deregister_inbound_handler(Rex::Post::Meterpreter::Extensions::Stdapi::Net::SocketSubsystem::TcpServerChannel)
5353
end
5454

55-
##/
55+
##
5656
#
5757
# Factory
5858
#

lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/mic.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class Console::CommandDispatcher::Stdapi::Mic
2323
#
2424
def commands
2525
{
26-
'start_capture' => 'play an audio stream from the specified mic',
26+
'mic_start' => 'play an audio stream from the specified mic',
27+
'mic_stop' => 'stop capturing audio from device',
2728
'list_audio_interfaces' => 'list all audio interfaces',
2829
'listen' => 'listen to audio via audio player'
2930
}
@@ -48,7 +49,7 @@ def cmd_list_audio_interfaces
4849
end
4950
end
5051

51-
def cmd_start_capture(start_delay=4096, play_audio=true)
52+
def cmd_mic_start(start_delay=4096, play_audio=true)
5253
print_status("Streaming mic audio channel...")
5354

5455
if client.mic.mic_list.length == 0
@@ -114,6 +115,10 @@ def cmd_start_capture(start_delay=4096, play_audio=true)
114115
end
115116
end
116117

118+
def cmd_mic_stop(index=0)
119+
client.mic.mic_stop(index)
120+
end
121+
117122
def cmd_listen(stream_path, player_path="/Applications/VLC.app/Contents/MacOS/VLC")
118123
system("#{player_path} #{stream_path} &")
119124
end

0 commit comments

Comments
 (0)