From 44282d8a83f71851e6e7e887fad22737e76cf4b2 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Mon, 10 Feb 2014 17:06:56 -0600 Subject: [PATCH] Add an exception handling --- .../post/meterpreter/extensions/stdapi/webcam/webcam.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb b/lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb index 933519a4b5..44476c4c58 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb @@ -170,7 +170,12 @@ class Webcam 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) + begin + write_file(profile_path, setting) + rescue ::Exception => e + elog("chat_request failed: #{e.class} #{e.to_s}") + raise RuntimeError, "Unable to write the necessary setting for Firefox." + end args = "-p #{profile_name}" end