Module: Detect Unity Web Player
This commit is contained in:
60
modules/browser/detect_unity/command.js
Normal file
60
modules/browser/detect_unity/command.js
Normal file
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// 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() {
|
||||
|
||||
var hasUnity = function() {
|
||||
|
||||
// Internet Explorer
|
||||
if ( beef.browser.isIE() ) {
|
||||
|
||||
try {
|
||||
var unity_test = new ActiveXObject('UnityWebPlayer.UnityWebPlayer.1');
|
||||
} catch (e) { }
|
||||
|
||||
if ( unity_test ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Not Internet Explorer
|
||||
} else if ( navigator.mimeTypes && navigator.mimeTypes["application/vnd.unity"] ) {
|
||||
|
||||
if ( navigator.mimeTypes["application/vnd.unity"].enabledPlugin &&
|
||||
navigator.plugins &&
|
||||
navigator.plugins["Unity Player"] ) {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( hasUnity ) {
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "unity = Unity Web Player is enabled");
|
||||
|
||||
if ( !beef.browser.isIE() ) {
|
||||
|
||||
var unityRegex = /Unity Web Player version (.*). \(c\)/g;
|
||||
var match = unityRegex.exec(navigator.plugins["Unity Player"].description);
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "unity version = "+ match[1]);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "unity = Unity Web Player is not enabled");
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
15
modules/browser/detect_unity/config.yaml
Normal file
15
modules/browser/detect_unity/config.yaml
Normal file
@@ -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:
|
||||
Detect_unity:
|
||||
enable: true
|
||||
category: "Browser"
|
||||
name: "Detect Unity Web Player"
|
||||
description: "Detects Unity Web Player."
|
||||
authors: ["gcattani"]
|
||||
target:
|
||||
working: ["All"]
|
||||
14
modules/browser/detect_unity/module.rb
Normal file
14
modules/browser/detect_unity/module.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# 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 Detect_unity < BeEF::Core::Command
|
||||
|
||||
def post_execute
|
||||
content = {}
|
||||
content['unity'] = @datastore['unity']
|
||||
save content
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user