Auto-switch-fingerprint

change fingerprint

  1. // ==UserScript==
  2. // @name Auto-switch-fingerprint
  3. // @namespace http://tampermonkey.net
  4. // @version 1.0
  5. // @description change fingerprint
  6. // @license MIT
  7. // @author eooce
  8. // @match *://*/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=tencent.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function fakeActiveVRDisplays() { return "Not Spoofed"; }
  17. function fakeAppCodeName() {
  18. return "Mozilla";
  19. }
  20. function fakeAppName() {
  21. return "Netscape";
  22. }
  23.  
  24. function fakeAppVersion() {
  25. return "5.0 (Windows)";
  26. }
  27. function fakeBattery() { return "Not Spoofed"; }
  28. function fakeConnection() { return "Not Spoofed"; }
  29. function fakeGeoLocation() { return "Not Spoofed"; }
  30. function fakeHardwareConcurrency() {
  31. return 1;
  32. }
  33. function fakeJavaEnabled() {
  34. return false;
  35. }
  36. function fakeLanguage() {
  37. return "en-US";
  38. }
  39. function fakeLanguages() {
  40. return "en-US,en";
  41. }
  42. function fakeMimeTypes() { return "Not Spoofed"; }
  43. function fakeOnLine() {
  44. return true;
  45. }
  46. function fakeOscpu() {
  47. return "Windows NT 6.1";
  48. }
  49. function fakePermissions() { return "Not Spoofed"; }
  50. function fakePlatform() {
  51. return "Win32";
  52. }
  53. function fakePlugins() {
  54. return window.navigator.plugins;
  55. }
  56. function fakeProduct() {
  57. return "Gecko";
  58. }
  59. function fakeServiceWorker() { return "Not Spoofed"; }
  60. function fakeStorage() { return "Not Spoofed"; }
  61. function fakeUserAgent() {
  62. return "Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0";
  63. }
  64. function fakeBuildID() {
  65. return "20100101";
  66. }
  67.  
  68. const fakeActiveVRDisplaysValue = fakeActiveVRDisplays();
  69. const fakeAppCodeNameValue = fakeAppCodeName();
  70. const fakeAppNameValue = fakeAppName();
  71. const fakeAppVersionValue = fakeAppVersion();
  72. const fakeBatteryValue = fakeBattery();
  73. const fakeConnectionValue = fakeConnection();
  74. const fakeGeoLocationValue = fakeGeoLocation();
  75. const fakeHardwareConcurrencyValue = fakeHardwareConcurrency();
  76. const fakeJavaEnabledValue = fakeJavaEnabled();
  77. const fakeLanguageValue = fakeLanguage();
  78. const fakeLanguagesValue = fakeLanguages();
  79. const fakeMimeTypesValue = fakeMimeTypes();
  80. const fakeOnLineValue = fakeOnLine();
  81. const fakeOscpuValue = fakeOscpu();
  82. const fakePermissionsValue = fakePermissions();
  83. const fakePlatformValue = fakePlatform();
  84. const fakePluginsValue = fakePlugins();
  85. const fakeProductValue = fakeProduct();
  86. const fakeServiceWorkerValue = fakeServiceWorker();
  87. const fakeStorageValue = fakeStorage();
  88. const fakeUserAgentValue = fakeUserAgent();
  89. const fakeBuildIDValue = fakeBuildID();
  90.  
  91. Object.defineProperties(window.navigator, {
  92. appCodeName: {
  93. configurable: true,
  94. enumerable: true,
  95. get: function getAppCodeName() {
  96. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.appCodeName");
  97.  
  98. return fakeAppCodeNameValue;
  99. }
  100. },
  101. appName: {
  102. configurable: true,
  103. enumerable: true,
  104. get: function getAppName() {
  105. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.appName");
  106.  
  107. return fakeAppNameValue;
  108. }
  109. },
  110. appVersion: {
  111. configurable: true,
  112. enumerable: true,
  113. get: function getAppVersion() {
  114. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.appVersion");
  115.  
  116. return fakeAppVersionValue;
  117. }
  118. },
  119. hardwareConcurrency: {
  120. configurable: true,
  121. enumerable: true,
  122. get: function getHardwareConcurrency() {
  123. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.hardwareConcurrency");
  124.  
  125. return fakeHardwareConcurrencyValue;
  126. }
  127. },
  128. language: {
  129. configurable: true,
  130. enumerable: true,
  131. get: function getLanguage() {
  132. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.language");
  133.  
  134. return fakeLanguageValue;
  135. }
  136. },
  137. languages: {
  138. configurable: true,
  139. enumerable: true,
  140. get: function getLanguages() {
  141. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.languages");
  142.  
  143. return fakeLanguagesValue;
  144. }
  145. },
  146. onLine: {
  147. configurable: true,
  148. enumerable: true,
  149. get: function getOnLine() {
  150. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.onLine");
  151.  
  152. return fakeOnLineValue;
  153. }
  154. },
  155. oscpu: {
  156. configurable: true,
  157. enumerable: true,
  158. get: function getOscpu() {
  159. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.oscpu");
  160.  
  161. return fakeOscpuValue;
  162. }
  163. },
  164. platform: {
  165. configurable: true,
  166. enumerable: true,
  167. get: function getPlatform() {
  168. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.platform");
  169.  
  170. return fakePlatformValue;
  171. }
  172. },
  173. product: {
  174. configurable: true,
  175. enumerable: true,
  176. get: function getProduct() {
  177. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.product");
  178.  
  179. return fakeProductValue;
  180. }
  181. },
  182. userAgent: {
  183. configurable: true,
  184. enumerable: true,
  185. get: function getUserAgent() {
  186. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.userAgent");
  187.  
  188. return fakeUserAgentValue;
  189. }
  190. },
  191. buildID: {
  192. configurable: true,
  193. enumerable: true,
  194. get: function getBuildID() {
  195. console.log("[ALERT] " + window.location.hostname + " accessed property Navigator.buildID");
  196.  
  197. return fakeBuildIDValue;
  198. }
  199. }
  200. });
  201. })();