Fixing java support by separating Oracle deployement toolkit in a separate file. #786
This commit is contained in:
@@ -1298,7 +1298,14 @@ beef.browser = {
|
||||
* @example: if(beef.browser.javaEnabled()) { ... }
|
||||
*/
|
||||
javaEnabled:function () {
|
||||
return false;
|
||||
//Use of deployJava defined in deployJava.js (Oracle java deployment toolkit)
|
||||
versionJRE = deployJava.getJREs();
|
||||
|
||||
if(versionJRE != '')
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1342,33 +1349,35 @@ beef.browser = {
|
||||
*/
|
||||
hasJava:function () {
|
||||
|
||||
// Check if Java is enabled
|
||||
if (!beef.browser.javaEnabled()) {
|
||||
return false;
|
||||
}
|
||||
return beef.browser.javaEnabled();
|
||||
|
||||
// This is a temporary fix as this does not work on Safari and Chrome
|
||||
// Chrome requires manual user intervention even with unsigned applets.
|
||||
// Safari requires a few seconds to load the applet.
|
||||
if (beef.browser.isC() || beef.browser.isS()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Inject an unsigned java applet to double check if the Java
|
||||
// plugin is working fine.
|
||||
try {
|
||||
var applet_archive = 'http://' + beef.net.host + ':' + beef.net.port + '/demos/checkJava.jar';
|
||||
var applet_id = 'checkJava';
|
||||
var applet_name = 'checkJava';
|
||||
var output;
|
||||
beef.dom.attachApplet(applet_id, 'Microsoft_Corporation', 'checkJava',
|
||||
null, applet_archive, null);
|
||||
output = document.Microsoft_Corporation.getInfo();
|
||||
beef.dom.detachApplet('checkJava');
|
||||
return output = 1;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
// // Check if Java is enabled
|
||||
// if (!beef.browser.javaEnabled()) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// // This is a temporary fix as this does not work on Safari and Chrome
|
||||
// // Chrome requires manual user intervention even with unsigned applets.
|
||||
// // Safari requires a few seconds to load the applet.
|
||||
// if (beef.browser.isC() || beef.browser.isS()) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// // Inject an unsigned java applet to double check if the Java
|
||||
// // plugin is working fine.
|
||||
// try {
|
||||
// var applet_archive = 'http://' + beef.net.host + ':' + beef.net.port + '/demos/checkJava.jar';
|
||||
// var applet_id = 'checkJava';
|
||||
// var applet_name = 'checkJava';
|
||||
// var output;
|
||||
// beef.dom.attachApplet(applet_id, 'Microsoft_Corporation', 'checkJava',
|
||||
// null, applet_archive, null);
|
||||
// output = document.Microsoft_Corporation.getInfo();
|
||||
// beef.dom.detachApplet('checkJava');
|
||||
// return output = 1;
|
||||
// } catch (e) {
|
||||
// return false;
|
||||
// }
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
1301
core/main/client/lib/deployJava.js
Normal file
1301
core/main/client/lib/deployJava.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@ module BeEF
|
||||
beef_js_path = "#{$root_dir}/core/main/client/"
|
||||
|
||||
# @note External libraries (like jQuery) that are not evaluated with Eruby and possibly not obfuscated
|
||||
ext_js_sub_files = %w(lib/jquery-1.5.2.min.js lib/evercookie.js lib/json2.js lib/jools.min.js lib/mdetect.js)
|
||||
ext_js_sub_files = %w(lib/jquery-1.5.2.min.js lib/evercookie.js lib/json2.js lib/jools.min.js lib/mdetect.js lib/deployJava.js)
|
||||
|
||||
# @note BeEF libraries: need Eruby evaluation and obfuscation
|
||||
beef_js_sub_files = %w(beef.js browser.js browser/cookie.js browser/popup.js session.js os.js hardware.js dom.js logger.js net.js updater.js encode/base64.js encode/json.js net/local.js init.js mitb.js net/dns.js net/cors.js are.js)
|
||||
|
||||
Reference in New Issue
Block a user