Guest User

vidara anti fraud

a guest
Feb 12th, 2026
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.23 KB | None | 0 0
  1. const visitorData = {
  2. file_id: 148201,
  3. viewport_size: `${window.innerWidth}x${window.innerHeight}`,
  4. referer: "http:\/\/vidara.so",
  5. timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
  6. gpu: null,
  7. cpu: null,
  8. browser: null,
  9. platform: navigator.platform,
  10. plugins_count: navigator.plugins ? navigator.plugins.length : 0,
  11. permissions_api: void 0 !== navigator.permissions,
  12. notification_api: "undefined" != typeof Notification,
  13. page_duration: 0,
  14. watch_time: 0,
  15. tab_visibility_changes: 0,
  16. focus_changes: 0,
  17. mouse_movements: [],
  18. click_positions: []
  19. };
  20. let startTime = Date.now(),
  21. hasSentData = !1;
  22. const ENCRYPTION_KEY = "7k9mP2nQ8vR4xT6yU3wZ1aS5dF0gH7jL";
  23.  
  24. function compressAndEncrypt(t) {
  25. try {
  26. let e = JSON.stringify(t),
  27. i = pako.gzip(e),
  28. n = btoa(String.fromCharCode.apply(null, i)),
  29. o = CryptoJS.AES.encrypt(n, "7k9mP2nQ8vR4xT6yU3wZ1aS5dF0gH7jL").toString();
  30. return o
  31. } catch (a) {
  32. return console.error("Compression/Encryption error:", a), null
  33. }
  34. }
  35. let heartbeatInterval = null,
  36. sessionId = null;
  37.  
  38. function generateSessionId() {
  39. return `${Date.now()}-${Math.random().toString(36).substr(2,9)}`
  40. }
  41.  
  42. function sendHeartbeat() {
  43. let t = {
  44. file_id: visitorData.file_id,
  45. session_id: sessionId
  46. };
  47. fetch("/api/heartbeat", {
  48. method: "POST",
  49. headers: {
  50. "Content-Type": "application/json"
  51. },
  52. body: JSON.stringify(t),
  53. keepalive: !0
  54. }).catch(() => {})
  55. }
  56.  
  57. function startHeartbeat() {
  58. heartbeatInterval || (sessionId || (sessionId = generateSessionId()), sendHeartbeat(), heartbeatInterval = setInterval(() => {
  59. sendHeartbeat()
  60. }, 15e3))
  61. }
  62.  
  63. function stopHeartbeat() {
  64. heartbeatInterval && (clearInterval(heartbeatInterval), heartbeatInterval = null)
  65. }
  66.  
  67. function detectBrowser() {
  68. let t = navigator.userAgent,
  69. e = navigator.vendor;
  70. return navigator.brave && "function" == typeof navigator.brave.isBrave ? "Brave" : t.indexOf("Edg/") > -1 || t.indexOf("Edge/") > -1 ? "Edge" : window.opr || window.opera || t.indexOf("OPR/") > -1 ? "Opera" : t.indexOf("Vivaldi") > -1 ? "Vivaldi" : t.indexOf("YaBrowser") > -1 ? "Yandex" : t.indexOf("UCBrowser") > -1 ? "UC Browser" : t.indexOf("SamsungBrowser") > -1 ? "Samsung Internet" : t.indexOf("Firefox") > -1 || t.indexOf("FxiOS") > -1 ? "Firefox" : t.indexOf("Safari") > -1 && -1 === t.indexOf("Chrome") && e.indexOf("Apple") > -1 ? "Safari" : t.indexOf("Chrome") > -1 && e.indexOf("Google") > -1 ? "Chrome" : t.indexOf("MSIE") > -1 || t.indexOf("Trident/") > -1 ? "Internet Explorer" : "Unknown"
  71. }
  72.  
  73. function getCPU() {
  74. return navigator.hardwareConcurrency ? `${navigator.hardwareConcurrency} cores` : "Unknown"
  75. }
  76.  
  77. function getGPU() {
  78. try {
  79. let t = document.createElement("canvas"),
  80. e = t.getContext("webgl") || t.getContext("experimental-webgl");
  81. if (!e) return null;
  82. let i = e.getExtension("WEBGL_debug_renderer_info");
  83. if (i) return e.getParameter(i.UNMASKED_RENDERER_WEBGL);
  84. return "Unknown"
  85. } catch (n) {
  86. return null
  87. }
  88. }
  89. document.addEventListener("visibilitychange", () => {
  90. document.hidden && visitorData.tab_visibility_changes++
  91. }), window.addEventListener("focus", () => {
  92. visitorData.focus_changes++
  93. }), window.addEventListener("blur", () => {
  94. visitorData.focus_changes++
  95. }), window.addEventListener("load", () => {
  96. startHeartbeat()
  97. }), ("complete" === document.readyState || "interactive" === document.readyState) && startHeartbeat(), window.addEventListener("beforeunload", () => {
  98. stopHeartbeat()
  99. });
  100. let mouseMoveCount = 0;
  101.  
  102. function calculateMouseEntropy() {
  103. if (visitorData.mouse_movements.length < 10) return 0;
  104. let t = [];
  105. for (let e = 1; e < visitorData.mouse_movements.length; e++) {
  106. let i = visitorData.mouse_movements[e - 1],
  107. n = visitorData.mouse_movements[e],
  108. o = n.x - i.x,
  109. a = n.y - i.y,
  110. r = Math.sqrt(o * o + a * a);
  111. t.push(r)
  112. }
  113. let s = t.reduce((t, e) => t + e, 0) / t.length,
  114. l = t.reduce((t, e) => t + Math.pow(e - s, 2), 0) / t.length;
  115. return Math.sqrt(l)
  116. }
  117.  
  118. function detectStraightLineMovements() {
  119. if (visitorData.mouse_movements.length < 3) return 0;
  120. let t = 0;
  121. for (let e = 2; e < visitorData.mouse_movements.length; e++) {
  122. let i = visitorData.mouse_movements[e - 2],
  123. n = visitorData.mouse_movements[e - 1],
  124. o = visitorData.mouse_movements[e],
  125. a = Math.abs((n.x - i.x) * (o.y - i.y) - (o.x - i.x) * (n.y - i.y));
  126. a < 5 && t++
  127. }
  128. return t / visitorData.mouse_movements.length
  129. }
  130.  
  131. function sendVisitorData() {
  132. if (hasSentData) return;
  133. hasSentData = !0, visitorData.page_duration = Math.round((Date.now() - startTime) / 1e3), visitorData.watch_time = void 0 !== totalWatchTime ? Math.round(totalWatchTime) : 0, visitorData.session_id = sessionId, visitorData.behavioral_analysis = {
  134. mouse_entropy: calculateMouseEntropy(),
  135. straight_line_ratio: detectStraightLineMovements(),
  136. has_mouse_movement: visitorData.mouse_movements.length > 0
  137. };
  138. let t = compressAndEncrypt(visitorData);
  139. if (!t) {
  140. console.error("Failed to encrypt data");
  141. return
  142. }
  143. fetch("/api/count", {
  144. method: "POST",
  145. headers: {
  146. "Content-Type": "application/json"
  147. },
  148. body: JSON.stringify({
  149. data: t
  150. }),
  151. keepalive: !0
  152. }).then(t => t.json()).then(t => {}).catch(t => {}), stopHeartbeat()
  153. }
  154. document.addEventListener("mousemove", t => {
  155. ++mouseMoveCount % 10 == 0 && (visitorData.mouse_movements.push({
  156. x: t.pageX,
  157. y: t.pageY,
  158. t: Date.now() - startTime
  159. }), visitorData.mouse_movements.length > 50 && visitorData.mouse_movements.shift())
  160. }), document.addEventListener("click", t => {
  161. visitorData.click_positions.push({
  162. x: t.pageX,
  163. y: t.pageY,
  164. t: Date.now() - startTime,
  165. button: t.button
  166. }), visitorData.click_positions.length > 20 && visitorData.click_positions.shift()
  167. }), visitorData.browser = detectBrowser(), visitorData.gpu = getGPU(), visitorData.cpu = getCPU(), setInterval(() => {
  168. void 0 !== totalWatchTime && !hasSentData && Math.floor(totalWatchTime) >= 36 && sendVisitorData()
  169. }, 500);
  170.  
  171. </script>
  172.  
Advertisement
Add Comment
Please, Sign In to add comment