fpscanner 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/fpScanner.cjs.js +2 -2
- package/dist/fpScanner.es.js +31 -28
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/scripts/build-custom.js +84 -24
- package/src/index.ts +11 -0
package/README.md
CHANGED
|
@@ -124,7 +124,8 @@ fetch('/api/fingerprint', {
|
|
|
124
124
|
|
|
125
125
|
```javascript
|
|
126
126
|
// Decrypt and validate the fingerprint
|
|
127
|
-
|
|
127
|
+
// Use the same key you provided when building: npx fpscanner build --key=your-key
|
|
128
|
+
const key = 'your-secret-key'; // Your custom key
|
|
128
129
|
|
|
129
130
|
function decryptFingerprint(ciphertext, key) {
|
|
130
131
|
const encrypted = Buffer.from(ciphertext, 'base64');
|
|
@@ -440,7 +441,7 @@ See the [`examples/`](./examples/) folder for complete Node.js and Python server
|
|
|
440
441
|
|
|
441
442
|
## Advanced: Custom Builds
|
|
442
443
|
|
|
443
|
-
By default, fpscanner uses a placeholder key
|
|
444
|
+
By default, fpscanner uses a placeholder key that gets replaced when you run the build command. For production, you should use your own encryption key and enable obfuscation to make it harder for attackers to forge payloads.
|
|
444
445
|
|
|
445
446
|
### Bring Your Own Encryption/Obfuscation
|
|
446
447
|
|
package/dist/fpScanner.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function te(){return navigator.webdriver}function re(){return navigator.userAgent}function ne(){return navigator.platform}const l="ERROR",r="INIT",s="NA",p="SKIPPED",h="high",ie="low",ae="medium";function d(t){let e=0;for(let n=0,a=t.length;n<a;n++){let i=t.charCodeAt(n);e=(e<<5)-e+i,e|=0}return e.toString(16).padStart(8,"0")}function g(t,e){for(const n in t)t[n]=e}function oe(){return navigator.buildID==="20181001000000"}function se(){try{let t=!1;const e=Error.prepareStackTrace;Error.prepareStackTrace=function(){return t=!0,e};const n=new Error("");return console.log(n),t}catch{return l}}function ce(){const t={vendor:r,renderer:r};if(oe())return g(t,s),t;try{var e=document.createElement("canvas"),n=e.getContext("webgl")||e.getContext("experimental-webgl");n.getSupportedExtensions().indexOf("WEBGL_debug_renderer_info")>=0?(t.vendor=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_VENDOR_WEBGL),t.renderer=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)):g(t,s)}catch{g(t,l)}return t}function le(){return"__pwInitScripts"in window||"__playwright__binding__"in window}function ue(){return navigator.hardwareConcurrency||s}function de(){const t=[],e=.123456789;return["E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"].forEach(function(i){try{t.push(Math[i])}catch{t.push(-1)}}),["tan","sin","exp","atan","acosh","asinh","atanh","expm1","log1p","sinh"].forEach(function(i){try{t.push(Math[i](e))}catch{t.push(-1)}}),d(t.map(String).join(","))}function ge(){return navigator.deviceMemory||s}function he(){return eval.toString().length}function me(){const t={timezone:r,localeLanguage:r};try{if(typeof Intl<"u"&&typeof Intl.DateTimeFormat<"u"){const e=Intl.DateTimeFormat().resolvedOptions();t.timezone=e.timeZone,t.localeLanguage=e.locale}else t.timezone=s,t.localeLanguage=s}catch{t.timezone=l,t.localeLanguage=l}return t}function pe(){return{width:window.screen.width,height:window.screen.height,pixelDepth:window.screen.pixelDepth,colorDepth:window.screen.colorDepth,availableWidth:window.screen.availWidth,availableHeight:window.screen.availHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight,hasMultipleDisplays:typeof screen.isExtended<"u"?screen.isExtended:s}}function fe(){return{languages:navigator.languages,language:navigator.language}}async function ve(){const t={vendor:r,architecture:r,device:r,description:r};if("gpu"in navigator)try{const e=await navigator.gpu.requestAdapter();e&&(t.vendor=e.info.vendor,t.architecture=e.info.architecture,t.device=e.info.device,t.description=e.info.description)}catch{g(t,l)}else g(t,s);return t}function ye(){const t=["__driver_evaluate","__webdriver_evaluate","__selenium_evaluate","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__selenium_unwrapped","__fxdriver_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium","$cdc_asdjflasutopfhvcZLmcfl_","$chrome_asyncScriptInfo","__$webdriverAsyncExecutor","webdriver","__webdriverFunc","domAutomation","domAutomationController","__lastWatirAlert","__lastWatirConfirm","__lastWatirPrompt","__webdriver_script_fn","_WEBDRIVER_ELEM_CACHE"];let e=!1;for(let n=0;n<t.length;n++)if(t[n]in window){e=!0;break}return e=e||!!document.__webdriver_script_fn||!!window.domAutomation||!!window.domAutomationController,e}function we(){try{const t="webdriver",e=window.navigator;if(!e[t]&&!e.hasOwnProperty(t)){e[t]=1;const n=e[t]===1;return delete e[t],n}return!0}catch{return!1}}async function be(){const t=window.navigator,e={architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r};if("userAgentData"in t)try{const n=await t.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion"]);e.architecture=n.architecture,e.bitness=n.bitness,e.brands=n.brands,e.mobile=n.mobile,e.model=n.model,e.platform=n.platform,e.platformVersion=n.platformVersion,e.uaFullVersion=n.uaFullVersion}catch{g(e,l)}else g(e,s);return e}function Se(){if(!navigator.plugins)return!1;const t=typeof navigator.plugins.toString=="function"?navigator.plugins.toString():navigator.plugins.constructor&&typeof navigator.plugins.constructor.toString=="function"?navigator.plugins.constructor.toString():typeof navigator.plugins;return t==="[object PluginArray]"||t==="[object MSPluginsCollection]"||t==="[object HTMLPluginsCollection]"}function Ce(){if(!navigator.plugins)return s;const t=[];for(let e=0;e<navigator.plugins.length;e++)t.push(navigator.plugins[e].name);return d(t.join(","))}function We(){return navigator.plugins?navigator.plugins.length:s}function ke(){if(!navigator.plugins)return s;try{return navigator.plugins[0]===navigator.plugins[0][0].enabledPlugin}catch{return l}}function
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function te(){return navigator.webdriver}function re(){return navigator.userAgent}function ne(){return navigator.platform}const l="ERROR",r="INIT",s="NA",p="SKIPPED",h="high",ie="low",ae="medium";function d(t){let e=0;for(let n=0,a=t.length;n<a;n++){let i=t.charCodeAt(n);e=(e<<5)-e+i,e|=0}return e.toString(16).padStart(8,"0")}function g(t,e){for(const n in t)t[n]=e}function oe(){return navigator.buildID==="20181001000000"}function se(){try{let t=!1;const e=Error.prepareStackTrace;Error.prepareStackTrace=function(){return t=!0,e};const n=new Error("");return console.log(n),t}catch{return l}}function ce(){const t={vendor:r,renderer:r};if(oe())return g(t,s),t;try{var e=document.createElement("canvas"),n=e.getContext("webgl")||e.getContext("experimental-webgl");n.getSupportedExtensions().indexOf("WEBGL_debug_renderer_info")>=0?(t.vendor=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_VENDOR_WEBGL),t.renderer=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)):g(t,s)}catch{g(t,l)}return t}function le(){return"__pwInitScripts"in window||"__playwright__binding__"in window}function ue(){return navigator.hardwareConcurrency||s}function de(){const t=[],e=.123456789;return["E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"].forEach(function(i){try{t.push(Math[i])}catch{t.push(-1)}}),["tan","sin","exp","atan","acosh","asinh","atanh","expm1","log1p","sinh"].forEach(function(i){try{t.push(Math[i](e))}catch{t.push(-1)}}),d(t.map(String).join(","))}function ge(){return navigator.deviceMemory||s}function he(){return eval.toString().length}function me(){const t={timezone:r,localeLanguage:r};try{if(typeof Intl<"u"&&typeof Intl.DateTimeFormat<"u"){const e=Intl.DateTimeFormat().resolvedOptions();t.timezone=e.timeZone,t.localeLanguage=e.locale}else t.timezone=s,t.localeLanguage=s}catch{t.timezone=l,t.localeLanguage=l}return t}function pe(){return{width:window.screen.width,height:window.screen.height,pixelDepth:window.screen.pixelDepth,colorDepth:window.screen.colorDepth,availableWidth:window.screen.availWidth,availableHeight:window.screen.availHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight,hasMultipleDisplays:typeof screen.isExtended<"u"?screen.isExtended:s}}function fe(){return{languages:navigator.languages,language:navigator.language}}async function ve(){const t={vendor:r,architecture:r,device:r,description:r};if("gpu"in navigator)try{const e=await navigator.gpu.requestAdapter();e&&(t.vendor=e.info.vendor,t.architecture=e.info.architecture,t.device=e.info.device,t.description=e.info.description)}catch{g(t,l)}else g(t,s);return t}function ye(){const t=["__driver_evaluate","__webdriver_evaluate","__selenium_evaluate","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__selenium_unwrapped","__fxdriver_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium","$cdc_asdjflasutopfhvcZLmcfl_","$chrome_asyncScriptInfo","__$webdriverAsyncExecutor","webdriver","__webdriverFunc","domAutomation","domAutomationController","__lastWatirAlert","__lastWatirConfirm","__lastWatirPrompt","__webdriver_script_fn","_WEBDRIVER_ELEM_CACHE"];let e=!1;for(let n=0;n<t.length;n++)if(t[n]in window){e=!0;break}return e=e||!!document.__webdriver_script_fn||!!window.domAutomation||!!window.domAutomationController,e}function we(){try{const t="webdriver",e=window.navigator;if(!e[t]&&!e.hasOwnProperty(t)){e[t]=1;const n=e[t]===1;return delete e[t],n}return!0}catch{return!1}}async function be(){const t=window.navigator,e={architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r};if("userAgentData"in t)try{const n=await t.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion"]);e.architecture=n.architecture,e.bitness=n.bitness,e.brands=n.brands,e.mobile=n.mobile,e.model=n.model,e.platform=n.platform,e.platformVersion=n.platformVersion,e.uaFullVersion=n.uaFullVersion}catch{g(e,l)}else g(e,s);return e}function Se(){if(!navigator.plugins)return!1;const t=typeof navigator.plugins.toString=="function"?navigator.plugins.toString():navigator.plugins.constructor&&typeof navigator.plugins.constructor.toString=="function"?navigator.plugins.constructor.toString():typeof navigator.plugins;return t==="[object PluginArray]"||t==="[object MSPluginsCollection]"||t==="[object HTMLPluginsCollection]"}function Ce(){if(!navigator.plugins)return s;const t=[];for(let e=0;e<navigator.plugins.length;e++)t.push(navigator.plugins[e].name);return d(t.join(","))}function We(){return navigator.plugins?navigator.plugins.length:s}function ke(){if(!navigator.plugins)return s;try{return navigator.plugins[0]===navigator.plugins[0][0].enabledPlugin}catch{return l}}function Ae(){if(!navigator.plugins)return s;try{return navigator.plugins.item(4294967296)!==navigator.plugins[0]}catch{return l}}function Ee(){const t={isValidPluginArray:r,pluginCount:r,pluginNamesHash:r,pluginConsistency1:r,pluginOverflow:r};try{t.isValidPluginArray=Se(),t.pluginCount=We(),t.pluginNamesHash=Ce(),t.pluginConsistency1=ke(),t.pluginOverflow=Ae()}catch{g(t,l)}return t}async function xe(){return new Promise(async function(t){var e={audiooutput:0,audioinput:0,videoinput:0};if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices){const i=await navigator.mediaDevices.enumerateDevices();if(typeof i<"u"){for(var n=0;n<i.length;n++){var a=i[n].kind;e[a]=e[a]+1}return t({speakers:e.audiooutput,microphones:e.audioinput,webcams:e.videoinput})}else return g(e,s),t(e)}else return g(e,s),t(e)})}function Pe(){const t={webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r},e=document.createElement("iframe");try{e.style.display="none",e.src="about:blank",document.body.appendChild(e);const n=e.contentWindow?.navigator;t.webdriver=n.webdriver??!1,t.userAgent=n.userAgent??s,t.platform=n.platform??s,t.memory=n.deviceMemory??s,t.cpuCount=n.hardwareConcurrency??s,t.language=n.language??s}catch{g(t,l)}finally{document.body.removeChild(e)}return t}async function De(){return new Promise(t=>{const e={vendor:r,renderer:r,userAgent:r,language:r,platform:r,memory:r,cpuCount:r};try{const n=`try {
|
|
2
2
|
var fingerprintWorker = {};
|
|
3
3
|
|
|
4
4
|
fingerprintWorker.userAgent = navigator.userAgent;
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
self.postMessage(fingerprintWorker);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
self.postMessage(fingerprintWorker);
|
|
31
|
-
}`,a=new Blob([n],{type:"application/javascript"}),i=URL.createObjectURL(a),m=new Worker(i);m.onmessage=function(u){try{return e.vendor=u.data.vendor,e.renderer=u.data.renderer,e.userAgent=u.data.userAgent,e.language=u.data.language,e.platform=u.data.platform,e.memory=u.data.memory,e.cpuCount=u.data.cpuCount,t(e)}catch{return g(e,l),t(e)}}}catch{return g(e,l),t(e)}})}function De(){const t={toSourceError:r,hasToSource:!1};try{null.usdfsh}catch(e){t.toSourceError=e.toString()}try{throw"xyz"}catch(e){try{e.toSource(),t.hasToSource=!0}catch{t.hasToSource=!1}}return t}const w=['audio/mp4; codecs="mp4a.40.2"',"audio/mpeg;",'audio/webm; codecs="vorbis"','audio/ogg; codecs="vorbis"','audio/wav; codecs="1"','audio/ogg; codecs="speex"','audio/ogg; codecs="flac"','audio/3gpp; codecs="samr"'],b=['video/mp4; codecs="avc1.42E01E, mp4a.40.2"','video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc1.58A01E"','video/mp4; codecs="avc1.4D401E"','video/mp4; codecs="avc1.64001E"','video/mp4; codecs="mp4v.20.8"','video/mp4; codecs="mp4v.20.240"','video/webm; codecs="vp8"','video/ogg; codecs="theora"','video/ogg; codecs="dirac"','video/3gpp; codecs="mp4v.20.8"','video/x-matroska; codecs="theora"'];function S(t,e){const n={};try{const a=document.createElement(e);for(const i of t)try{n[i]=a.canPlayType(i)||null}catch{n[i]=null}}catch{for(const a of t)n[a]=null}return n}function C(t){const e={},n=window.MediaSource;if(!n||typeof n.isTypeSupported!="function"){for(const a of t)e[a]=null;return e}for(const a of t)try{e[a]=n.isTypeSupported(a)}catch{e[a]=null}return e}function W(t){try{const e=window.RTCRtpReceiver;if(e&&typeof e.getCapabilities=="function"){const n=e.getCapabilities(t);return d(JSON.stringify(n))}return s}catch{return l}}function _e(){const t={audioCanPlayTypeHash:s,videoCanPlayTypeHash:s,audioMediaSourceHash:s,videoMediaSourceHash:s,rtcAudioCapabilitiesHash:s,rtcVideoCapabilitiesHash:s,hasMediaSource:!1};try{t.hasMediaSource=!!window.MediaSource;const e=S(w,"audio"),n=S(b,"video");t.audioCanPlayTypeHash=d(JSON.stringify(e)),t.videoCanPlayTypeHash=d(JSON.stringify(n));const a=C(w),i=C(b);t.audioMediaSourceHash=d(JSON.stringify(a)),t.videoMediaSourceHash=d(JSON.stringify(i)),t.rtcAudioCapabilitiesHash=W("audio"),t.rtcVideoCapabilitiesHash=W("video")}catch{g(t,l)}return t}async function Re(){return new Promise(t=>{try{const e=new Image,n=document.createElement("canvas").getContext("2d");e.onload=()=>{n.drawImage(e,0,0),t(n.getImageData(0,0,1,1).data.filter(a=>a===0).length!=4)},e.onerror=()=>{t(l)},e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}catch{t(l)}})}function Ie(){var t=document.createElement("canvas");t.width=400,t.height=200,t.style.display="inline";var e=t.getContext("2d");try{return e.rect(0,0,10,10),e.rect(2,2,6,6),e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.font="11pt no-real-font-123",e.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),e.globalCompositeOperation="multiply",e.fillStyle="rgb(255,0,255)",e.beginPath(),e.arc(50,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(0,255,255)",e.beginPath(),e.arc(100,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,255,0)",e.beginPath(),e.arc(75,100,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,0,255)",e.arc(75,75,75,0,2*Math.PI,!0),e.arc(75,75,25,0,2*Math.PI,!0),e.fill("evenodd"),d(t.toDataURL())}catch{return l}}async function Te(){const t={hasModifiedCanvas:r,canvasFingerprint:r};return t.hasModifiedCanvas=await Re(),t.canvasFingerprint=Ie(),t}function He(){const t=["deviceMemory","hardwareConcurrency","language","languages","platform"],e=[];for(const n of t){const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator),n);a&&a.value?e.push("1"):e.push("0")}return e.join("")}function Oe(){return Math.random().toString(36).substring(2,15)}function Le(){return new Date().getTime()}function Ve(){return window.location.href}function k(t,e){const n=t.signals;return e==="iframe"?n.contexts.iframe.webdriver!==n.automation.webdriver||n.contexts.iframe.userAgent!==n.browser.userAgent||n.contexts.iframe.platform!==n.device.platform||n.contexts.iframe.memory!==n.device.memory||n.contexts.iframe.cpuCount!==n.device.cpuCount:n.contexts.webWorker.webdriver!==n.automation.webdriver||n.contexts.webWorker.userAgent!==n.browser.userAgent||n.contexts.webWorker.platform!==n.device.platform||n.contexts.webWorker.memory!==n.device.memory||n.contexts.webWorker.cpuCount!==n.device.cpuCount}function je(){const t={bitmask:r,extensions:[]},e=document.body.hasAttribute("data-gr-ext-installed"),n=typeof window.ethereum<"u",a=document.getElementById("coupon-birds-drop-div")!==null,i=document.querySelector("deepl-input-controller")!==null,m=document.getElementById("monica-content-root")!==null,u=document.querySelector("chatgpt-sidebar")!==null,v=typeof window.__REQUESTLY__<"u",o=Array.from(document.querySelectorAll("*")).filter(f=>f.tagName.toLowerCase().startsWith("veepn-")).length>0;return t.bitmask=[e?"1":"0",n?"1":"0",a?"1":"0",i?"1":"0",m?"1":"0",u?"1":"0",v?"1":"0",o?"1":"0"].join(""),e&&t.extensions.push("grammarly"),n&&t.extensions.push("metamask"),a&&t.extensions.push("coupon-birds"),i&&t.extensions.push("deepl"),m&&t.extensions.push("monica-ai"),u&&t.extensions.push("sider-ai"),v&&t.extensions.push("requestly"),o&&t.extensions.push("veepn"),t}function Ge(){const t={bitmask:r,chrome:"chrome"in window,brave:"brave"in navigator,applePaySupport:"ApplePaySetup"in window,opera:typeof window.opr<"u"||typeof window.onoperadetachedviewchange=="object",serial:window.navigator.serial!==void 0,attachShadow:!!Element.prototype.attachShadow,caches:!!window.caches,webAssembly:!!window.WebAssembly&&!!window.WebAssembly.instantiate,buffer:"Buffer"in window,showModalDialog:"showModalDialog"in window},e=Object.keys(t).filter(n=>n!=="bitmask").map(n=>t[n]?"1":"0").join("");return t.bitmask=e,t}function Be(){const t={prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r};try{window.matchMedia("(prefers-color-scheme: dark)").matches?t.prefersColorScheme="dark":window.matchMedia("(prefers-color-scheme: light)").matches?t.prefersColorScheme="light":t.prefersColorScheme=null,t.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,t.prefersReducedTransparency=window.matchMedia("(prefers-reduced-transparency: reduce)").matches,window.matchMedia("(color-gamut: rec2020)").matches?t.colorGamut="rec2020":window.matchMedia("(color-gamut: p3)").matches?t.colorGamut="p3":window.matchMedia("(color-gamut: srgb)").matches?t.colorGamut="srgb":t.colorGamut=null,window.matchMedia("(pointer: fine)").matches?t.pointer="fine":window.matchMedia("(pointer: coarse)").matches?t.pointer="coarse":window.matchMedia("(pointer: none)").matches?t.pointer="none":t.pointer=null,window.matchMedia("(any-pointer: fine)").matches?t.anyPointer="fine":window.matchMedia("(any-pointer: coarse)").matches?t.anyPointer="coarse":window.matchMedia("(any-pointer: none)").matches?t.anyPointer="none":t.anyPointer=null,t.hover=window.matchMedia("(hover: hover)").matches,t.anyHover=window.matchMedia("(any-hover: hover)").matches;let e=0;for(let n=0;n<=16;n++)window.matchMedia(`(color: ${n})`).matches&&(e=n);t.colorDepth=e}catch{g(t,l)}return t}function Ne(t){const e=t.signals.device.screenResolution;return typeof e.width!="number"||typeof e.height!="number"?!1:e.width===600&&e.height===800||e.availableWidth===600&&e.availableHeight===800||e.innerWidth===600&&e.innerHeight===800}function ze(t){return t.signals.automation.webdriver===!0}function Fe(t){return!!t.signals.automation.selenium}function Ue(t){return t.signals.automation.cdp===!0}function $e(t){return t.signals.automation.playwright===!0}function Qe(t){return typeof t.signals.device.memory!="number"?!1:t.signals.device.memory>8||t.signals.device.memory<.25}function qe(t){return typeof t.signals.device.cpuCount!="number"?!1:t.signals.device.cpuCount>70}function Je(t){const e=t.signals.browser.userAgent;return t.signals.browser.features.chrome===!1&&typeof e=="string"&&e.includes("Chrome")}function Ke(t){return t.signals.contexts.iframe.webdriver===!0}function Ye(t){return t.signals.contexts.webWorker.webdriver===!0}function Ze(t){const e=t.signals.contexts.webWorker,n=t.signals.graphics.webGL;return e.vendor===l||e.renderer===l||n.vendor===s||n.renderer===s||e.vendor===p?!1:e.vendor!==n.vendor||e.renderer!==n.renderer}function Xe(t){return t.signals.contexts.webWorker.platform===s||t.signals.contexts.webWorker.platform===l||t.signals.contexts.webWorker.platform===p?!1:t.signals.device.platform!==t.signals.contexts.webWorker.platform}function et(t){return t.signals.contexts.iframe.platform===s||t.signals.contexts.iframe.platform===l?!1:t.signals.device.platform!==t.signals.contexts.iframe.platform}function tt(t){return t.signals.automation.webdriverWritable===!0}function rt(t){return t.signals.graphics.webGL.renderer.includes("SwiftShader")}function nt(t){return t.signals.locale.internationalization.timezone==="UTC"}async function it(t,e){const n=new TextEncoder().encode(e),a=new TextEncoder().encode(t),i=new Uint8Array(a.length);for(let u=0;u<a.length;u++)i[u]=a[u]^n[u%n.length];const m=String.fromCharCode(...i);return btoa(m)}class at{constructor(){this.fingerprint={signals:{automation:{webdriver:r,webdriverWritable:r,selenium:r,cdp:r,playwright:r,navigatorPropertyDescriptors:r},device:{cpuCount:r,memory:r,platform:r,screenResolution:{width:r,height:r,pixelDepth:r,colorDepth:r,availableWidth:r,availableHeight:r,innerWidth:r,innerHeight:r,hasMultipleDisplays:r},multimediaDevices:{speakers:r,microphones:r,webcams:r},mediaQueries:{prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r}},browser:{userAgent:r,features:{bitmask:r,chrome:r,brave:r,applePaySupport:r,opera:r,serial:r,attachShadow:r,caches:r,webAssembly:r,buffer:r,showModalDialog:r},plugins:{isValidPluginArray:r,pluginCount:r,pluginNamesHash:r,pluginConsistency1:r,pluginOverflow:r},extensions:{bitmask:r,extensions:r},highEntropyValues:{architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r},etsl:r,maths:r,toSourceError:{toSourceError:r,hasToSource:r}},graphics:{webGL:{vendor:r,renderer:r},webgpu:{vendor:r,architecture:r,device:r,description:r},canvas:{hasModifiedCanvas:r,canvasFingerprint:r}},codecs:{audioCanPlayTypeHash:r,videoCanPlayTypeHash:r,audioMediaSourceHash:r,videoMediaSourceHash:r,rtcAudioCapabilitiesHash:r,rtcVideoCapabilitiesHash:r,hasMediaSource:r},locale:{internationalization:{timezone:r,localeLanguage:r},languages:{languages:r,language:r}},contexts:{iframe:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r},webWorker:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r,vendor:r,renderer:r}}},fsid:r,nonce:r,time:r,url:r,fastBotDetection:!1,fastBotDetectionDetails:{headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}}}}async collectSignal(e){try{return await e()}catch{return l}}generateFingerprintScannerId(){try{const e=this.fingerprint.signals,n=this.fingerprint.fastBotDetectionDetails,a="FS1",m=[n.headlessChromeScreenResolution.detected,n.hasWebdriver.detected,n.hasWebdriverWritable.detected,n.hasSeleniumProperty.detected,n.hasCDP.detected,n.hasPlaywright.detected,n.hasImpossibleDeviceMemory.detected,n.hasHighCPUCount.detected,n.hasMissingChromeObject.detected,n.hasWebdriverIframe.detected,n.hasWebdriverWorker.detected,n.hasMismatchWebGLInWorker.detected,n.hasMismatchPlatformIframe.detected,n.hasMismatchPlatformWorker.detected,n.hasSwiftshaderRenderer.detected,n.hasUTCTimezone.detected].map(c=>c?"1":"0").join(""),u=[e.automation.webdriver===!0,e.automation.webdriverWritable===!0,e.automation.selenium===!0,e.automation.cdp===!0,e.automation.playwright===!0].map(c=>c?"1":"0").join(""),v=d(String(e.automation.navigatorPropertyDescriptors)).slice(0,4),o=`${u}h${v}`,f=typeof e.device.screenResolution.width=="number"?e.device.screenResolution.width:0,y=typeof e.device.screenResolution.height=="number"?e.device.screenResolution.height:0,E=typeof e.device.cpuCount=="number"?String(e.device.cpuCount).padStart(2,"0"):"00",A=typeof e.device.memory=="number"?String(Math.round(e.device.memory)).padStart(2,"0"):"00",P=[e.device.screenResolution.hasMultipleDisplays===!0,e.device.mediaQueries.prefersReducedMotion===!0,e.device.mediaQueries.prefersReducedTransparency===!0,e.device.mediaQueries.hover===!0,e.device.mediaQueries.anyHover===!0].map(c=>c?"1":"0").join(""),x=[e.device.platform,e.device.screenResolution.pixelDepth,e.device.screenResolution.colorDepth,e.device.multimediaDevices.speakers,e.device.multimediaDevices.microphones,e.device.multimediaDevices.webcams,e.device.mediaQueries.prefersColorScheme,e.device.mediaQueries.colorGamut,e.device.mediaQueries.pointer,e.device.mediaQueries.anyPointer,e.device.mediaQueries.colorDepth].map(c=>String(c)).join("|"),M=d(x).slice(0,6),D=`${f}x${y}c${E}m${A}b${P}h${M}`,_=typeof e.browser.features.bitmask=="string"?e.browser.features.bitmask:"0000000000",R=typeof e.browser.extensions.bitmask=="string"?e.browser.extensions.bitmask:"00000000",I=[e.browser.plugins.isValidPluginArray===!0,e.browser.plugins.pluginConsistency1===!0,e.browser.plugins.pluginOverflow===!0,e.browser.toSourceError.hasToSource===!0].map(c=>c?"1":"0").join(""),T=[e.browser.userAgent,e.browser.etsl,e.browser.maths,e.browser.plugins.pluginCount,e.browser.plugins.pluginNamesHash,e.browser.toSourceError.toSourceError,e.browser.highEntropyValues.architecture,e.browser.highEntropyValues.bitness,e.browser.highEntropyValues.platform,e.browser.highEntropyValues.platformVersion,e.browser.highEntropyValues.uaFullVersion,e.browser.highEntropyValues.mobile].map(c=>String(c)).join("|"),H=d(T).slice(0,6),O=`f${_}e${R}p${I}h${H}`,L=[e.graphics.canvas.hasModifiedCanvas===!0].map(c=>c?"1":"0").join(""),V=[e.graphics.webGL.vendor,e.graphics.webGL.renderer,e.graphics.webgpu.vendor,e.graphics.webgpu.architecture,e.graphics.webgpu.device,e.graphics.webgpu.description,e.graphics.canvas.canvasFingerprint].map(c=>String(c)).join("|"),j=d(V).slice(0,6),G=`${L}h${j}`,B=[e.codecs.hasMediaSource===!0].map(c=>c?"1":"0").join(""),N=[e.codecs.audioCanPlayTypeHash,e.codecs.videoCanPlayTypeHash,e.codecs.audioMediaSourceHash,e.codecs.videoMediaSourceHash,e.codecs.rtcAudioCapabilitiesHash,e.codecs.rtcVideoCapabilitiesHash].map(c=>String(c)).join("|"),z=d(N).slice(0,6),F=`${B}h${z}`,U=typeof e.locale.languages.language=="string"?e.locale.languages.language.slice(0,2).toLowerCase():"xx",$=Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.length:0,Q=(typeof e.locale.internationalization.timezone=="string"?e.locale.internationalization.timezone:"unknown").replace(/[\/\s]/g,"-"),q=[e.locale.internationalization.timezone,e.locale.internationalization.localeLanguage,Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.join(","):e.locale.languages.languages,e.locale.languages.language].map(c=>String(c)).join("|"),J=d(q).slice(0,4),K=`${U}${$}t${Q}_h${J}`,Y=[k(this.fingerprint,"iframe"),k(this.fingerprint,"worker"),e.contexts.iframe.webdriver===!0,e.contexts.webWorker.webdriver===!0].map(c=>c?"1":"0").join(""),Z=[e.contexts.iframe.userAgent,e.contexts.iframe.platform,e.contexts.iframe.memory,e.contexts.iframe.cpuCount,e.contexts.iframe.language,e.contexts.webWorker.userAgent,e.contexts.webWorker.platform,e.contexts.webWorker.memory,e.contexts.webWorker.cpuCount,e.contexts.webWorker.language,e.contexts.webWorker.vendor,e.contexts.webWorker.renderer].map(c=>String(c)).join("|"),X=d(Z).slice(0,6),ee=`${Y}h${X}`;return[a,m,o,D,O,G,F,K,ee].join("_")}catch(e){return console.error("Error generating fingerprint scanner id",e),l}}async encryptFingerprint(e){return await it(JSON.stringify(e),"dev-key")}getDetectionRules(){return[{name:"headlessChromeScreenResolution",severity:h,test:Ne},{name:"hasWebdriver",severity:h,test:ze},{name:"hasWebdriverWritable",severity:h,test:tt},{name:"hasSeleniumProperty",severity:h,test:Fe},{name:"hasCDP",severity:h,test:Ue},{name:"hasPlaywright",severity:h,test:$e},{name:"hasImpossibleDeviceMemory",severity:h,test:Qe},{name:"hasHighCPUCount",severity:h,test:qe},{name:"hasMissingChromeObject",severity:h,test:Je},{name:"hasWebdriverIframe",severity:h,test:Ke},{name:"hasWebdriverWorker",severity:h,test:Ye},{name:"hasMismatchWebGLInWorker",severity:h,test:Ze},{name:"hasMismatchPlatformIframe",severity:h,test:et},{name:"hasMismatchPlatformWorker",severity:h,test:Xe},{name:"hasSwiftshaderRenderer",severity:ie,test:rt},{name:"hasUTCTimezone",severity:ae,test:nt}]}runDetectionRules(){const e=this.getDetectionRules(),n={headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}};for(const a of e)try{const i=a.test(this.fingerprint);n[a.name]={detected:i,severity:a.severity}}catch{n[a.name]={detected:!1,severity:a.severity}}return n}async collectFingerprint(e={encrypt:!0}){const{encrypt:n=!0,skipWorker:a=!1}=e,i=this.fingerprint.signals,m={webdriver:this.collectSignal(te),webdriverWritable:this.collectSignal(we),selenium:this.collectSignal(ye),cdp:this.collectSignal(se),playwright:this.collectSignal(le),navigatorPropertyDescriptors:this.collectSignal(He),cpuCount:this.collectSignal(ue),memory:this.collectSignal(ge),platform:this.collectSignal(ne),screenResolution:this.collectSignal(pe),multimediaDevices:this.collectSignal(Pe),mediaQueries:this.collectSignal(Be),userAgent:this.collectSignal(re),browserFeatures:this.collectSignal(Ge),plugins:this.collectSignal(Ae),browserExtensions:this.collectSignal(je),highEntropyValues:this.collectSignal(be),etsl:this.collectSignal(he),maths:this.collectSignal(de),toSourceError:this.collectSignal(De),webGL:this.collectSignal(ce),webgpu:this.collectSignal(ve),canvas:this.collectSignal(Te),mediaCodecs:this.collectSignal(_e),internationalization:this.collectSignal(me),languages:this.collectSignal(fe),iframe:this.collectSignal(xe),webWorker:a?Promise.resolve({webdriver:p,userAgent:p,platform:p,memory:p,cpuCount:p,language:p,vendor:p,renderer:p}):this.collectSignal(Me),nonce:this.collectSignal(Oe),time:this.collectSignal(Le),url:this.collectSignal(Ve)},u=Object.keys(m),v=await Promise.all(Object.values(m)),o=Object.fromEntries(u.map((f,y)=>[f,v[y]]));return i.automation.webdriver=o.webdriver,i.automation.webdriverWritable=o.webdriverWritable,i.automation.selenium=o.selenium,i.automation.cdp=o.cdp,i.automation.playwright=o.playwright,i.automation.navigatorPropertyDescriptors=o.navigatorPropertyDescriptors,i.device.cpuCount=o.cpuCount,i.device.memory=o.memory,i.device.platform=o.platform,i.device.screenResolution=o.screenResolution,i.device.multimediaDevices=o.multimediaDevices,i.device.mediaQueries=o.mediaQueries,i.browser.userAgent=o.userAgent,i.browser.features=o.browserFeatures,i.browser.plugins=o.plugins,i.browser.extensions=o.browserExtensions,i.browser.highEntropyValues=o.highEntropyValues,i.browser.etsl=o.etsl,i.browser.maths=o.maths,i.browser.toSourceError=o.toSourceError,i.graphics.webGL=o.webGL,i.graphics.webgpu=o.webgpu,i.graphics.canvas=o.canvas,i.codecs=o.mediaCodecs,i.locale.internationalization=o.internationalization,i.locale.languages=o.languages,i.contexts.iframe=o.iframe,i.contexts.webWorker=o.webWorker,this.fingerprint.nonce=o.nonce,this.fingerprint.time=o.time,this.fingerprint.url=o.url,this.fingerprint.fastBotDetectionDetails=this.runDetectionRules(),this.fingerprint.fastBotDetection=Object.values(this.fingerprint.fastBotDetectionDetails).some(f=>f.detected),this.fingerprint.fsid=this.generateFingerprintScannerId(),n?await this.encryptFingerprint(JSON.stringify(this.fingerprint)):this.fingerprint}}exports.default=at;
|
|
31
|
+
}`,a=new Blob([n],{type:"application/javascript"}),i=URL.createObjectURL(a),m=new Worker(i);m.onmessage=function(u){try{return e.vendor=u.data.vendor,e.renderer=u.data.renderer,e.userAgent=u.data.userAgent,e.language=u.data.language,e.platform=u.data.platform,e.memory=u.data.memory,e.cpuCount=u.data.cpuCount,t(e)}catch{return g(e,l),t(e)}}}catch{return g(e,l),t(e)}})}function Me(){const t={toSourceError:r,hasToSource:!1};try{null.usdfsh}catch(e){t.toSourceError=e.toString()}try{throw"xyz"}catch(e){try{e.toSource(),t.hasToSource=!0}catch{t.hasToSource=!1}}return t}const w=['audio/mp4; codecs="mp4a.40.2"',"audio/mpeg;",'audio/webm; codecs="vorbis"','audio/ogg; codecs="vorbis"','audio/wav; codecs="1"','audio/ogg; codecs="speex"','audio/ogg; codecs="flac"','audio/3gpp; codecs="samr"'],b=['video/mp4; codecs="avc1.42E01E, mp4a.40.2"','video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc1.58A01E"','video/mp4; codecs="avc1.4D401E"','video/mp4; codecs="avc1.64001E"','video/mp4; codecs="mp4v.20.8"','video/mp4; codecs="mp4v.20.240"','video/webm; codecs="vp8"','video/ogg; codecs="theora"','video/ogg; codecs="dirac"','video/3gpp; codecs="mp4v.20.8"','video/x-matroska; codecs="theora"'];function S(t,e){const n={};try{const a=document.createElement(e);for(const i of t)try{n[i]=a.canPlayType(i)||null}catch{n[i]=null}}catch{for(const a of t)n[a]=null}return n}function C(t){const e={},n=window.MediaSource;if(!n||typeof n.isTypeSupported!="function"){for(const a of t)e[a]=null;return e}for(const a of t)try{e[a]=n.isTypeSupported(a)}catch{e[a]=null}return e}function W(t){try{const e=window.RTCRtpReceiver;if(e&&typeof e.getCapabilities=="function"){const n=e.getCapabilities(t);return d(JSON.stringify(n))}return s}catch{return l}}function _e(){const t={audioCanPlayTypeHash:s,videoCanPlayTypeHash:s,audioMediaSourceHash:s,videoMediaSourceHash:s,rtcAudioCapabilitiesHash:s,rtcVideoCapabilitiesHash:s,hasMediaSource:!1};try{t.hasMediaSource=!!window.MediaSource;const e=S(w,"audio"),n=S(b,"video");t.audioCanPlayTypeHash=d(JSON.stringify(e)),t.videoCanPlayTypeHash=d(JSON.stringify(n));const a=C(w),i=C(b);t.audioMediaSourceHash=d(JSON.stringify(a)),t.videoMediaSourceHash=d(JSON.stringify(i)),t.rtcAudioCapabilitiesHash=W("audio"),t.rtcVideoCapabilitiesHash=W("video")}catch{g(t,l)}return t}async function Re(){return new Promise(t=>{try{const e=new Image,n=document.createElement("canvas").getContext("2d");e.onload=()=>{n.drawImage(e,0,0),t(n.getImageData(0,0,1,1).data.filter(a=>a===0).length!=4)},e.onerror=()=>{t(l)},e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}catch{t(l)}})}function Ie(){var t=document.createElement("canvas");t.width=400,t.height=200,t.style.display="inline";var e=t.getContext("2d");try{return e.rect(0,0,10,10),e.rect(2,2,6,6),e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.font="11pt no-real-font-123",e.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),e.globalCompositeOperation="multiply",e.fillStyle="rgb(255,0,255)",e.beginPath(),e.arc(50,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(0,255,255)",e.beginPath(),e.arc(100,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,255,0)",e.beginPath(),e.arc(75,100,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,0,255)",e.arc(75,75,75,0,2*Math.PI,!0),e.arc(75,75,25,0,2*Math.PI,!0),e.fill("evenodd"),d(t.toDataURL())}catch{return l}}async function Te(){const t={hasModifiedCanvas:r,canvasFingerprint:r};return t.hasModifiedCanvas=await Re(),t.canvasFingerprint=Ie(),t}function He(){const t=["deviceMemory","hardwareConcurrency","language","languages","platform"],e=[];for(const n of t){const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator),n);a&&a.value?e.push("1"):e.push("0")}return e.join("")}function Oe(){return Math.random().toString(36).substring(2,15)}function Le(){return new Date().getTime()}function Ve(){return window.location.href}function k(t,e){const n=t.signals;return e==="iframe"?n.contexts.iframe.webdriver!==n.automation.webdriver||n.contexts.iframe.userAgent!==n.browser.userAgent||n.contexts.iframe.platform!==n.device.platform||n.contexts.iframe.memory!==n.device.memory||n.contexts.iframe.cpuCount!==n.device.cpuCount:n.contexts.webWorker.webdriver!==n.automation.webdriver||n.contexts.webWorker.userAgent!==n.browser.userAgent||n.contexts.webWorker.platform!==n.device.platform||n.contexts.webWorker.memory!==n.device.memory||n.contexts.webWorker.cpuCount!==n.device.cpuCount}function je(){const t={bitmask:r,extensions:[]},e=document.body.hasAttribute("data-gr-ext-installed"),n=typeof window.ethereum<"u",a=document.getElementById("coupon-birds-drop-div")!==null,i=document.querySelector("deepl-input-controller")!==null,m=document.getElementById("monica-content-root")!==null,u=document.querySelector("chatgpt-sidebar")!==null,v=typeof window.__REQUESTLY__<"u",o=Array.from(document.querySelectorAll("*")).filter(f=>f.tagName.toLowerCase().startsWith("veepn-")).length>0;return t.bitmask=[e?"1":"0",n?"1":"0",a?"1":"0",i?"1":"0",m?"1":"0",u?"1":"0",v?"1":"0",o?"1":"0"].join(""),e&&t.extensions.push("grammarly"),n&&t.extensions.push("metamask"),a&&t.extensions.push("coupon-birds"),i&&t.extensions.push("deepl"),m&&t.extensions.push("monica-ai"),u&&t.extensions.push("sider-ai"),v&&t.extensions.push("requestly"),o&&t.extensions.push("veepn"),t}function Ne(){const t={bitmask:r,chrome:"chrome"in window,brave:"brave"in navigator,applePaySupport:"ApplePaySetup"in window,opera:typeof window.opr<"u"||typeof window.onoperadetachedviewchange=="object",serial:window.navigator.serial!==void 0,attachShadow:!!Element.prototype.attachShadow,caches:!!window.caches,webAssembly:!!window.WebAssembly&&!!window.WebAssembly.instantiate,buffer:"Buffer"in window,showModalDialog:"showModalDialog"in window},e=Object.keys(t).filter(n=>n!=="bitmask").map(n=>t[n]?"1":"0").join("");return t.bitmask=e,t}function Ge(){const t={prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r};try{window.matchMedia("(prefers-color-scheme: dark)").matches?t.prefersColorScheme="dark":window.matchMedia("(prefers-color-scheme: light)").matches?t.prefersColorScheme="light":t.prefersColorScheme=null,t.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,t.prefersReducedTransparency=window.matchMedia("(prefers-reduced-transparency: reduce)").matches,window.matchMedia("(color-gamut: rec2020)").matches?t.colorGamut="rec2020":window.matchMedia("(color-gamut: p3)").matches?t.colorGamut="p3":window.matchMedia("(color-gamut: srgb)").matches?t.colorGamut="srgb":t.colorGamut=null,window.matchMedia("(pointer: fine)").matches?t.pointer="fine":window.matchMedia("(pointer: coarse)").matches?t.pointer="coarse":window.matchMedia("(pointer: none)").matches?t.pointer="none":t.pointer=null,window.matchMedia("(any-pointer: fine)").matches?t.anyPointer="fine":window.matchMedia("(any-pointer: coarse)").matches?t.anyPointer="coarse":window.matchMedia("(any-pointer: none)").matches?t.anyPointer="none":t.anyPointer=null,t.hover=window.matchMedia("(hover: hover)").matches,t.anyHover=window.matchMedia("(any-hover: hover)").matches;let e=0;for(let n=0;n<=16;n++)window.matchMedia(`(color: ${n})`).matches&&(e=n);t.colorDepth=e}catch{g(t,l)}return t}function Be(t){const e=t.signals.device.screenResolution;return typeof e.width!="number"||typeof e.height!="number"?!1:e.width===600&&e.height===800||e.availableWidth===600&&e.availableHeight===800||e.innerWidth===600&&e.innerHeight===800}function Fe(t){return t.signals.automation.webdriver===!0}function ze(t){return!!t.signals.automation.selenium}function Ue(t){return t.signals.automation.cdp===!0}function $e(t){return t.signals.automation.playwright===!0}function Qe(t){return typeof t.signals.device.memory!="number"?!1:t.signals.device.memory>8||t.signals.device.memory<.25}function qe(t){return typeof t.signals.device.cpuCount!="number"?!1:t.signals.device.cpuCount>70}function Je(t){const e=t.signals.browser.userAgent;return t.signals.browser.features.chrome===!1&&typeof e=="string"&&e.includes("Chrome")}function Ke(t){return t.signals.contexts.iframe.webdriver===!0}function Ye(t){return t.signals.contexts.webWorker.webdriver===!0}function Ze(t){const e=t.signals.contexts.webWorker,n=t.signals.graphics.webGL;return e.vendor===l||e.renderer===l||n.vendor===s||n.renderer===s||e.vendor===p?!1:e.vendor!==n.vendor||e.renderer!==n.renderer}function Xe(t){return t.signals.contexts.webWorker.platform===s||t.signals.contexts.webWorker.platform===l||t.signals.contexts.webWorker.platform===p?!1:t.signals.device.platform!==t.signals.contexts.webWorker.platform}function et(t){return t.signals.contexts.iframe.platform===s||t.signals.contexts.iframe.platform===l?!1:t.signals.device.platform!==t.signals.contexts.iframe.platform}function tt(t){return t.signals.automation.webdriverWritable===!0}function rt(t){return t.signals.graphics.webGL.renderer.includes("SwiftShader")}function nt(t){return t.signals.locale.internationalization.timezone==="UTC"}async function it(t,e){const n=new TextEncoder().encode(e),a=new TextEncoder().encode(t),i=new Uint8Array(a.length);for(let u=0;u<a.length;u++)i[u]=a[u]^n[u%n.length];const m=String.fromCharCode(...i);return btoa(m)}class at{constructor(){this.fingerprint={signals:{automation:{webdriver:r,webdriverWritable:r,selenium:r,cdp:r,playwright:r,navigatorPropertyDescriptors:r},device:{cpuCount:r,memory:r,platform:r,screenResolution:{width:r,height:r,pixelDepth:r,colorDepth:r,availableWidth:r,availableHeight:r,innerWidth:r,innerHeight:r,hasMultipleDisplays:r},multimediaDevices:{speakers:r,microphones:r,webcams:r},mediaQueries:{prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r}},browser:{userAgent:r,features:{bitmask:r,chrome:r,brave:r,applePaySupport:r,opera:r,serial:r,attachShadow:r,caches:r,webAssembly:r,buffer:r,showModalDialog:r},plugins:{isValidPluginArray:r,pluginCount:r,pluginNamesHash:r,pluginConsistency1:r,pluginOverflow:r},extensions:{bitmask:r,extensions:r},highEntropyValues:{architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r},etsl:r,maths:r,toSourceError:{toSourceError:r,hasToSource:r}},graphics:{webGL:{vendor:r,renderer:r},webgpu:{vendor:r,architecture:r,device:r,description:r},canvas:{hasModifiedCanvas:r,canvasFingerprint:r}},codecs:{audioCanPlayTypeHash:r,videoCanPlayTypeHash:r,audioMediaSourceHash:r,videoMediaSourceHash:r,rtcAudioCapabilitiesHash:r,rtcVideoCapabilitiesHash:r,hasMediaSource:r},locale:{internationalization:{timezone:r,localeLanguage:r},languages:{languages:r,language:r}},contexts:{iframe:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r},webWorker:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r,vendor:r,renderer:r}}},fsid:r,nonce:r,time:r,url:r,fastBotDetection:!1,fastBotDetectionDetails:{headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}}}}async collectSignal(e){try{return await e()}catch{return l}}generateFingerprintScannerId(){try{const e=this.fingerprint.signals,n=this.fingerprint.fastBotDetectionDetails,a="FS1",m=[n.headlessChromeScreenResolution.detected,n.hasWebdriver.detected,n.hasWebdriverWritable.detected,n.hasSeleniumProperty.detected,n.hasCDP.detected,n.hasPlaywright.detected,n.hasImpossibleDeviceMemory.detected,n.hasHighCPUCount.detected,n.hasMissingChromeObject.detected,n.hasWebdriverIframe.detected,n.hasWebdriverWorker.detected,n.hasMismatchWebGLInWorker.detected,n.hasMismatchPlatformIframe.detected,n.hasMismatchPlatformWorker.detected,n.hasSwiftshaderRenderer.detected,n.hasUTCTimezone.detected].map(c=>c?"1":"0").join(""),u=[e.automation.webdriver===!0,e.automation.webdriverWritable===!0,e.automation.selenium===!0,e.automation.cdp===!0,e.automation.playwright===!0].map(c=>c?"1":"0").join(""),v=d(String(e.automation.navigatorPropertyDescriptors)).slice(0,4),o=`${u}h${v}`,f=typeof e.device.screenResolution.width=="number"?e.device.screenResolution.width:0,y=typeof e.device.screenResolution.height=="number"?e.device.screenResolution.height:0,A=typeof e.device.cpuCount=="number"?String(e.device.cpuCount).padStart(2,"0"):"00",E=typeof e.device.memory=="number"?String(Math.round(e.device.memory)).padStart(2,"0"):"00",x=[e.device.screenResolution.hasMultipleDisplays===!0,e.device.mediaQueries.prefersReducedMotion===!0,e.device.mediaQueries.prefersReducedTransparency===!0,e.device.mediaQueries.hover===!0,e.device.mediaQueries.anyHover===!0].map(c=>c?"1":"0").join(""),P=[e.device.platform,e.device.screenResolution.pixelDepth,e.device.screenResolution.colorDepth,e.device.multimediaDevices.speakers,e.device.multimediaDevices.microphones,e.device.multimediaDevices.webcams,e.device.mediaQueries.prefersColorScheme,e.device.mediaQueries.colorGamut,e.device.mediaQueries.pointer,e.device.mediaQueries.anyPointer,e.device.mediaQueries.colorDepth].map(c=>String(c)).join("|"),D=d(P).slice(0,6),M=`${f}x${y}c${A}m${E}b${x}h${D}`,_=typeof e.browser.features.bitmask=="string"?e.browser.features.bitmask:"0000000000",R=typeof e.browser.extensions.bitmask=="string"?e.browser.extensions.bitmask:"00000000",I=[e.browser.plugins.isValidPluginArray===!0,e.browser.plugins.pluginConsistency1===!0,e.browser.plugins.pluginOverflow===!0,e.browser.toSourceError.hasToSource===!0].map(c=>c?"1":"0").join(""),T=[e.browser.userAgent,e.browser.etsl,e.browser.maths,e.browser.plugins.pluginCount,e.browser.plugins.pluginNamesHash,e.browser.toSourceError.toSourceError,e.browser.highEntropyValues.architecture,e.browser.highEntropyValues.bitness,e.browser.highEntropyValues.platform,e.browser.highEntropyValues.platformVersion,e.browser.highEntropyValues.uaFullVersion,e.browser.highEntropyValues.mobile].map(c=>String(c)).join("|"),H=d(T).slice(0,6),O=`f${_}e${R}p${I}h${H}`,L=[e.graphics.canvas.hasModifiedCanvas===!0].map(c=>c?"1":"0").join(""),V=[e.graphics.webGL.vendor,e.graphics.webGL.renderer,e.graphics.webgpu.vendor,e.graphics.webgpu.architecture,e.graphics.webgpu.device,e.graphics.webgpu.description,e.graphics.canvas.canvasFingerprint].map(c=>String(c)).join("|"),j=d(V).slice(0,6),N=`${L}h${j}`,G=[e.codecs.hasMediaSource===!0].map(c=>c?"1":"0").join(""),B=[e.codecs.audioCanPlayTypeHash,e.codecs.videoCanPlayTypeHash,e.codecs.audioMediaSourceHash,e.codecs.videoMediaSourceHash,e.codecs.rtcAudioCapabilitiesHash,e.codecs.rtcVideoCapabilitiesHash].map(c=>String(c)).join("|"),F=d(B).slice(0,6),z=`${G}h${F}`,U=typeof e.locale.languages.language=="string"?e.locale.languages.language.slice(0,2).toLowerCase():"xx",$=Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.length:0,Q=(typeof e.locale.internationalization.timezone=="string"?e.locale.internationalization.timezone:"unknown").replace(/[\/\s]/g,"-"),q=[e.locale.internationalization.timezone,e.locale.internationalization.localeLanguage,Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.join(","):e.locale.languages.languages,e.locale.languages.language].map(c=>String(c)).join("|"),J=d(q).slice(0,4),K=`${U}${$}t${Q}_h${J}`,Y=[k(this.fingerprint,"iframe"),k(this.fingerprint,"worker"),e.contexts.iframe.webdriver===!0,e.contexts.webWorker.webdriver===!0].map(c=>c?"1":"0").join(""),Z=[e.contexts.iframe.userAgent,e.contexts.iframe.platform,e.contexts.iframe.memory,e.contexts.iframe.cpuCount,e.contexts.iframe.language,e.contexts.webWorker.userAgent,e.contexts.webWorker.platform,e.contexts.webWorker.memory,e.contexts.webWorker.cpuCount,e.contexts.webWorker.language,e.contexts.webWorker.vendor,e.contexts.webWorker.renderer].map(c=>String(c)).join("|"),X=d(Z).slice(0,6),ee=`${Y}h${X}`;return[a,m,o,M,O,N,z,K,ee].join("_")}catch(e){return console.error("Error generating fingerprint scanner id",e),l}}async encryptFingerprint(e){const n="dev-key";return n.length>20&&n.indexOf("DEFAULT")>0&&n.indexOf("FPSCANNER")>0&&console.warn('[fpscanner] WARNING: Using default encryption key! Run "npx fpscanner build --key=your-secret-key" to inject your own key. See: https://github.com/antoinevastel/fpscanner#advanced-custom-builds'),await it(JSON.stringify(e),n)}getDetectionRules(){return[{name:"headlessChromeScreenResolution",severity:h,test:Be},{name:"hasWebdriver",severity:h,test:Fe},{name:"hasWebdriverWritable",severity:h,test:tt},{name:"hasSeleniumProperty",severity:h,test:ze},{name:"hasCDP",severity:h,test:Ue},{name:"hasPlaywright",severity:h,test:$e},{name:"hasImpossibleDeviceMemory",severity:h,test:Qe},{name:"hasHighCPUCount",severity:h,test:qe},{name:"hasMissingChromeObject",severity:h,test:Je},{name:"hasWebdriverIframe",severity:h,test:Ke},{name:"hasWebdriverWorker",severity:h,test:Ye},{name:"hasMismatchWebGLInWorker",severity:h,test:Ze},{name:"hasMismatchPlatformIframe",severity:h,test:et},{name:"hasMismatchPlatformWorker",severity:h,test:Xe},{name:"hasSwiftshaderRenderer",severity:ie,test:rt},{name:"hasUTCTimezone",severity:ae,test:nt}]}runDetectionRules(){const e=this.getDetectionRules(),n={headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}};for(const a of e)try{const i=a.test(this.fingerprint);n[a.name]={detected:i,severity:a.severity}}catch{n[a.name]={detected:!1,severity:a.severity}}return n}async collectFingerprint(e={encrypt:!0}){const{encrypt:n=!0,skipWorker:a=!1}=e,i=this.fingerprint.signals,m={webdriver:this.collectSignal(te),webdriverWritable:this.collectSignal(we),selenium:this.collectSignal(ye),cdp:this.collectSignal(se),playwright:this.collectSignal(le),navigatorPropertyDescriptors:this.collectSignal(He),cpuCount:this.collectSignal(ue),memory:this.collectSignal(ge),platform:this.collectSignal(ne),screenResolution:this.collectSignal(pe),multimediaDevices:this.collectSignal(xe),mediaQueries:this.collectSignal(Ge),userAgent:this.collectSignal(re),browserFeatures:this.collectSignal(Ne),plugins:this.collectSignal(Ee),browserExtensions:this.collectSignal(je),highEntropyValues:this.collectSignal(be),etsl:this.collectSignal(he),maths:this.collectSignal(de),toSourceError:this.collectSignal(Me),webGL:this.collectSignal(ce),webgpu:this.collectSignal(ve),canvas:this.collectSignal(Te),mediaCodecs:this.collectSignal(_e),internationalization:this.collectSignal(me),languages:this.collectSignal(fe),iframe:this.collectSignal(Pe),webWorker:a?Promise.resolve({webdriver:p,userAgent:p,platform:p,memory:p,cpuCount:p,language:p,vendor:p,renderer:p}):this.collectSignal(De),nonce:this.collectSignal(Oe),time:this.collectSignal(Le),url:this.collectSignal(Ve)},u=Object.keys(m),v=await Promise.all(Object.values(m)),o=Object.fromEntries(u.map((f,y)=>[f,v[y]]));return i.automation.webdriver=o.webdriver,i.automation.webdriverWritable=o.webdriverWritable,i.automation.selenium=o.selenium,i.automation.cdp=o.cdp,i.automation.playwright=o.playwright,i.automation.navigatorPropertyDescriptors=o.navigatorPropertyDescriptors,i.device.cpuCount=o.cpuCount,i.device.memory=o.memory,i.device.platform=o.platform,i.device.screenResolution=o.screenResolution,i.device.multimediaDevices=o.multimediaDevices,i.device.mediaQueries=o.mediaQueries,i.browser.userAgent=o.userAgent,i.browser.features=o.browserFeatures,i.browser.plugins=o.plugins,i.browser.extensions=o.browserExtensions,i.browser.highEntropyValues=o.highEntropyValues,i.browser.etsl=o.etsl,i.browser.maths=o.maths,i.browser.toSourceError=o.toSourceError,i.graphics.webGL=o.webGL,i.graphics.webgpu=o.webgpu,i.graphics.canvas=o.canvas,i.codecs=o.mediaCodecs,i.locale.internationalization=o.internationalization,i.locale.languages=o.languages,i.contexts.iframe=o.iframe,i.contexts.webWorker=o.webWorker,this.fingerprint.nonce=o.nonce,this.fingerprint.time=o.time,this.fingerprint.url=o.url,this.fingerprint.fastBotDetectionDetails=this.runDetectionRules(),this.fingerprint.fastBotDetection=Object.values(this.fingerprint.fastBotDetectionDetails).some(f=>f.detected),this.fingerprint.fsid=this.generateFingerprintScannerId(),n?await this.encryptFingerprint(JSON.stringify(this.fingerprint)):this.fingerprint}}exports.default=at;
|
package/dist/fpScanner.es.js
CHANGED
|
@@ -233,7 +233,7 @@ function ke() {
|
|
|
233
233
|
return l;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function Ae() {
|
|
237
237
|
if (!navigator.plugins) return s;
|
|
238
238
|
try {
|
|
239
239
|
return navigator.plugins.item(4294967296) !== navigator.plugins[0];
|
|
@@ -241,7 +241,7 @@ function Ee() {
|
|
|
241
241
|
return l;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Ee() {
|
|
245
245
|
const t = {
|
|
246
246
|
isValidPluginArray: r,
|
|
247
247
|
pluginCount: r,
|
|
@@ -250,7 +250,7 @@ function Ae() {
|
|
|
250
250
|
pluginOverflow: r
|
|
251
251
|
};
|
|
252
252
|
try {
|
|
253
|
-
t.isValidPluginArray = Se(), t.pluginCount = We(), t.pluginNamesHash = Ce(), t.pluginConsistency1 = ke(), t.pluginOverflow =
|
|
253
|
+
t.isValidPluginArray = Se(), t.pluginCount = We(), t.pluginNamesHash = Ce(), t.pluginConsistency1 = ke(), t.pluginOverflow = Ae();
|
|
254
254
|
} catch {
|
|
255
255
|
h(t, l);
|
|
256
256
|
}
|
|
@@ -488,14 +488,14 @@ function Ie() {
|
|
|
488
488
|
return l;
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
async function
|
|
491
|
+
async function Te() {
|
|
492
492
|
const t = {
|
|
493
493
|
hasModifiedCanvas: r,
|
|
494
494
|
canvasFingerprint: r
|
|
495
495
|
};
|
|
496
496
|
return t.hasModifiedCanvas = await Re(), t.canvasFingerprint = Ie(), t;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function He() {
|
|
499
499
|
const t = ["deviceMemory", "hardwareConcurrency", "language", "languages", "platform"], e = [];
|
|
500
500
|
for (const n of t) {
|
|
501
501
|
const a = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator), n);
|
|
@@ -532,7 +532,7 @@ function je() {
|
|
|
532
532
|
o ? "1" : "0"
|
|
533
533
|
].join(""), e && t.extensions.push("grammarly"), n && t.extensions.push("metamask"), a && t.extensions.push("coupon-birds"), i && t.extensions.push("deepl"), m && t.extensions.push("monica-ai"), u && t.extensions.push("sider-ai"), v && t.extensions.push("requestly"), o && t.extensions.push("veepn"), t;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function Ne() {
|
|
536
536
|
const t = {
|
|
537
537
|
bitmask: r,
|
|
538
538
|
chrome: "chrome" in window,
|
|
@@ -548,7 +548,7 @@ function Ge() {
|
|
|
548
548
|
}, e = Object.keys(t).filter((n) => n !== "bitmask").map((n) => t[n] ? "1" : "0").join("");
|
|
549
549
|
return t.bitmask = e, t;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Ge() {
|
|
552
552
|
const t = {
|
|
553
553
|
prefersColorScheme: r,
|
|
554
554
|
prefersReducedMotion: r,
|
|
@@ -571,14 +571,14 @@ function Be() {
|
|
|
571
571
|
}
|
|
572
572
|
return t;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Be(t) {
|
|
575
575
|
const e = t.signals.device.screenResolution;
|
|
576
576
|
return typeof e.width != "number" || typeof e.height != "number" ? !1 : e.width === 600 && e.height === 800 || e.availableWidth === 600 && e.availableHeight === 800 || e.innerWidth === 600 && e.innerHeight === 800;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Fe(t) {
|
|
579
579
|
return t.signals.automation.webdriver === !0;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function ze(t) {
|
|
582
582
|
return !!t.signals.automation.selenium;
|
|
583
583
|
}
|
|
584
584
|
function Ue(t) {
|
|
@@ -858,7 +858,7 @@ class ot {
|
|
|
858
858
|
e.automation.selenium === !0,
|
|
859
859
|
e.automation.cdp === !0,
|
|
860
860
|
e.automation.playwright === !0
|
|
861
|
-
].map((c) => c ? "1" : "0").join(""), v = d(String(e.automation.navigatorPropertyDescriptors)).slice(0, 4), o = `${u}h${v}`, f = typeof e.device.screenResolution.width == "number" ? e.device.screenResolution.width : 0, y = typeof e.device.screenResolution.height == "number" ? e.device.screenResolution.height : 0,
|
|
861
|
+
].map((c) => c ? "1" : "0").join(""), v = d(String(e.automation.navigatorPropertyDescriptors)).slice(0, 4), o = `${u}h${v}`, f = typeof e.device.screenResolution.width == "number" ? e.device.screenResolution.width : 0, y = typeof e.device.screenResolution.height == "number" ? e.device.screenResolution.height : 0, A = typeof e.device.cpuCount == "number" ? String(e.device.cpuCount).padStart(2, "0") : "00", E = typeof e.device.memory == "number" ? String(Math.round(e.device.memory)).padStart(2, "0") : "00", x = [
|
|
862
862
|
e.device.screenResolution.hasMultipleDisplays === !0,
|
|
863
863
|
e.device.mediaQueries.prefersReducedMotion === !0,
|
|
864
864
|
e.device.mediaQueries.prefersReducedTransparency === !0,
|
|
@@ -876,12 +876,12 @@ class ot {
|
|
|
876
876
|
e.device.mediaQueries.pointer,
|
|
877
877
|
e.device.mediaQueries.anyPointer,
|
|
878
878
|
e.device.mediaQueries.colorDepth
|
|
879
|
-
].map((c) => String(c)).join("|"), D = d(P).slice(0, 6), M = `${f}x${y}c${
|
|
879
|
+
].map((c) => String(c)).join("|"), D = d(P).slice(0, 6), M = `${f}x${y}c${A}m${E}b${x}h${D}`, _ = typeof e.browser.features.bitmask == "string" ? e.browser.features.bitmask : "0000000000", R = typeof e.browser.extensions.bitmask == "string" ? e.browser.extensions.bitmask : "00000000", I = [
|
|
880
880
|
e.browser.plugins.isValidPluginArray === !0,
|
|
881
881
|
e.browser.plugins.pluginConsistency1 === !0,
|
|
882
882
|
e.browser.plugins.pluginOverflow === !0,
|
|
883
883
|
e.browser.toSourceError.hasToSource === !0
|
|
884
|
-
].map((c) => c ? "1" : "0").join(""),
|
|
884
|
+
].map((c) => c ? "1" : "0").join(""), T = [
|
|
885
885
|
e.browser.userAgent,
|
|
886
886
|
e.browser.etsl,
|
|
887
887
|
e.browser.maths,
|
|
@@ -894,7 +894,7 @@ class ot {
|
|
|
894
894
|
e.browser.highEntropyValues.platformVersion,
|
|
895
895
|
e.browser.highEntropyValues.uaFullVersion,
|
|
896
896
|
e.browser.highEntropyValues.mobile
|
|
897
|
-
].map((c) => String(c)).join("|"),
|
|
897
|
+
].map((c) => String(c)).join("|"), H = d(T).slice(0, 6), O = `f${_}e${R}p${I}h${H}`, L = [
|
|
898
898
|
e.graphics.canvas.hasModifiedCanvas === !0
|
|
899
899
|
].map((c) => c ? "1" : "0").join(""), V = [
|
|
900
900
|
e.graphics.webGL.vendor,
|
|
@@ -904,16 +904,16 @@ class ot {
|
|
|
904
904
|
e.graphics.webgpu.device,
|
|
905
905
|
e.graphics.webgpu.description,
|
|
906
906
|
e.graphics.canvas.canvasFingerprint
|
|
907
|
-
].map((c) => String(c)).join("|"), j = d(V).slice(0, 6),
|
|
907
|
+
].map((c) => String(c)).join("|"), j = d(V).slice(0, 6), N = `${L}h${j}`, G = [
|
|
908
908
|
e.codecs.hasMediaSource === !0
|
|
909
|
-
].map((c) => c ? "1" : "0").join(""),
|
|
909
|
+
].map((c) => c ? "1" : "0").join(""), B = [
|
|
910
910
|
e.codecs.audioCanPlayTypeHash,
|
|
911
911
|
e.codecs.videoCanPlayTypeHash,
|
|
912
912
|
e.codecs.audioMediaSourceHash,
|
|
913
913
|
e.codecs.videoMediaSourceHash,
|
|
914
914
|
e.codecs.rtcAudioCapabilitiesHash,
|
|
915
915
|
e.codecs.rtcVideoCapabilitiesHash
|
|
916
|
-
].map((c) => String(c)).join("|"),
|
|
916
|
+
].map((c) => String(c)).join("|"), F = d(B).slice(0, 6), z = `${G}h${F}`, U = typeof e.locale.languages.language == "string" ? e.locale.languages.language.slice(0, 2).toLowerCase() : "xx", $ = Array.isArray(e.locale.languages.languages) ? e.locale.languages.languages.length : 0, Q = (typeof e.locale.internationalization.timezone == "string" ? e.locale.internationalization.timezone : "unknown").replace(/[\/\s]/g, "-"), q = [
|
|
917
917
|
e.locale.internationalization.timezone,
|
|
918
918
|
e.locale.internationalization.localeLanguage,
|
|
919
919
|
Array.isArray(e.locale.languages.languages) ? e.locale.languages.languages.join(",") : e.locale.languages.languages,
|
|
@@ -943,8 +943,8 @@ class ot {
|
|
|
943
943
|
o,
|
|
944
944
|
M,
|
|
945
945
|
O,
|
|
946
|
-
|
|
947
|
-
|
|
946
|
+
N,
|
|
947
|
+
z,
|
|
948
948
|
K,
|
|
949
949
|
ee
|
|
950
950
|
].join("_");
|
|
@@ -953,7 +953,10 @@ class ot {
|
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
async encryptFingerprint(e) {
|
|
956
|
-
|
|
956
|
+
const n = "dev-key";
|
|
957
|
+
return n.length > 20 && n.indexOf("DEFAULT") > 0 && n.indexOf("FPSCANNER") > 0 && console.warn(
|
|
958
|
+
'[fpscanner] WARNING: Using default encryption key! Run "npx fpscanner build --key=your-secret-key" to inject your own key. See: https://github.com/antoinevastel/fpscanner#advanced-custom-builds'
|
|
959
|
+
), await it(JSON.stringify(e), n);
|
|
957
960
|
}
|
|
958
961
|
/**
|
|
959
962
|
* Detection rules with name and severity.
|
|
@@ -961,10 +964,10 @@ class ot {
|
|
|
961
964
|
*/
|
|
962
965
|
getDetectionRules() {
|
|
963
966
|
return [
|
|
964
|
-
{ name: "headlessChromeScreenResolution", severity: g, test:
|
|
965
|
-
{ name: "hasWebdriver", severity: g, test:
|
|
967
|
+
{ name: "headlessChromeScreenResolution", severity: g, test: Be },
|
|
968
|
+
{ name: "hasWebdriver", severity: g, test: Fe },
|
|
966
969
|
{ name: "hasWebdriverWritable", severity: g, test: tt },
|
|
967
|
-
{ name: "hasSeleniumProperty", severity: g, test:
|
|
970
|
+
{ name: "hasSeleniumProperty", severity: g, test: ze },
|
|
968
971
|
{ name: "hasCDP", severity: g, test: Ue },
|
|
969
972
|
{ name: "hasPlaywright", severity: g, test: $e },
|
|
970
973
|
{ name: "hasImpossibleDeviceMemory", severity: g, test: Qe },
|
|
@@ -1015,18 +1018,18 @@ class ot {
|
|
|
1015
1018
|
selenium: this.collectSignal(ye),
|
|
1016
1019
|
cdp: this.collectSignal(se),
|
|
1017
1020
|
playwright: this.collectSignal(le),
|
|
1018
|
-
navigatorPropertyDescriptors: this.collectSignal(
|
|
1021
|
+
navigatorPropertyDescriptors: this.collectSignal(He),
|
|
1019
1022
|
// Device signals
|
|
1020
1023
|
cpuCount: this.collectSignal(ue),
|
|
1021
1024
|
memory: this.collectSignal(he),
|
|
1022
1025
|
platform: this.collectSignal(ne),
|
|
1023
1026
|
screenResolution: this.collectSignal(pe),
|
|
1024
1027
|
multimediaDevices: this.collectSignal(xe),
|
|
1025
|
-
mediaQueries: this.collectSignal(
|
|
1028
|
+
mediaQueries: this.collectSignal(Ge),
|
|
1026
1029
|
// Browser signals
|
|
1027
1030
|
userAgent: this.collectSignal(re),
|
|
1028
|
-
browserFeatures: this.collectSignal(
|
|
1029
|
-
plugins: this.collectSignal(
|
|
1031
|
+
browserFeatures: this.collectSignal(Ne),
|
|
1032
|
+
plugins: this.collectSignal(Ee),
|
|
1030
1033
|
browserExtensions: this.collectSignal(je),
|
|
1031
1034
|
highEntropyValues: this.collectSignal(be),
|
|
1032
1035
|
etsl: this.collectSignal(ge),
|
|
@@ -1035,7 +1038,7 @@ class ot {
|
|
|
1035
1038
|
// Graphics signals
|
|
1036
1039
|
webGL: this.collectSignal(ce),
|
|
1037
1040
|
webgpu: this.collectSignal(ve),
|
|
1038
|
-
canvas: this.collectSignal(
|
|
1041
|
+
canvas: this.collectSignal(Te),
|
|
1039
1042
|
// Codecs
|
|
1040
1043
|
mediaCodecs: this.collectSignal(_e),
|
|
1041
1044
|
// Locale signals
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAE,WAAW,EAA0C,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGzG,cAAM,kBAAkB;IACpB,OAAO,CAAC,WAAW,CAAc;;YAiLnB,aAAa;IAQ3B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,4BAA4B;YA2LtB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAE,WAAW,EAA0C,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGzG,cAAM,kBAAkB;IACpB,OAAO,CAAC,WAAW,CAAc;;YAiLnB,aAAa;IAQ3B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,4BAA4B;YA2LtB,kBAAkB;IAoBhC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,iBAAiB;IAiCnB,kBAAkB,CAAC,OAAO,GAAE,yBAA6C;CA0HlF;AAED,eAAe,kBAAkB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fpscanner",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "A lightweight browser fingerprinting and bot detection library with encryption, obfuscation, and cross-context validation",
|
|
5
5
|
"main": "dist/fpScanner.cjs.js",
|
|
6
6
|
"module": "dist/fpScanner.es.js",
|
|
@@ -57,7 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/antoinevastel/fpscanner",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"ua-parser-js": "^0.7.18"
|
|
60
|
+
"ua-parser-js": "^0.7.18",
|
|
61
|
+
"javascript-obfuscator": "^5.1.0",
|
|
62
|
+
"terser": "^5.46.0"
|
|
61
63
|
},
|
|
62
64
|
"devDependencies": {
|
|
63
65
|
"@playwright/test": "^1.57.0",
|
|
@@ -65,10 +67,8 @@
|
|
|
65
67
|
"chai": "^4.2.0",
|
|
66
68
|
"concurrently": "^9.2.1",
|
|
67
69
|
"fpcollect": "^1.0.4",
|
|
68
|
-
"javascript-obfuscator": "^5.1.0",
|
|
69
70
|
"mocha": "^5.2.0",
|
|
70
71
|
"puppeteer": "^1.9.0",
|
|
71
|
-
"terser": "^5.46.0",
|
|
72
72
|
"typescript": "^5.9.3",
|
|
73
73
|
"vite": "^7.3.0",
|
|
74
74
|
"vitest": "^4.0.16"
|
package/scripts/build-custom.js
CHANGED
|
@@ -29,6 +29,8 @@ module.exports = async function build(args) {
|
|
|
29
29
|
: path.dirname(__dirname);
|
|
30
30
|
|
|
31
31
|
const distDir = path.join(packageDir, 'dist');
|
|
32
|
+
const files = ['fpScanner.es.js', 'fpScanner.cjs.js'];
|
|
33
|
+
const sentinel = '__DEFAULT_FPSCANNER_KEY__';
|
|
32
34
|
|
|
33
35
|
console.log('');
|
|
34
36
|
console.log('🔨 Building fpscanner with custom key...');
|
|
@@ -37,33 +39,88 @@ module.exports = async function build(args) {
|
|
|
37
39
|
console.log(` Obfuscation: ${skipObfuscation ? 'disabled' : 'enabled'}`);
|
|
38
40
|
console.log('');
|
|
39
41
|
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
// Check if we can build from source (more reliable than string replacement)
|
|
43
|
+
const viteConfigPath = path.join(packageDir, 'vite.config.ts');
|
|
44
|
+
const canBuildFromSource = fs.existsSync(viteConfigPath);
|
|
45
|
+
|
|
46
|
+
if (canBuildFromSource) {
|
|
47
|
+
// Preferred method: Build from source with key injected via environment variable
|
|
48
|
+
// This is more reliable as Vite's define properly replaces the key during the build
|
|
49
|
+
console.log('📦 Step 0/5: Building from source with injected key...');
|
|
50
|
+
console.log(' (This is more reliable than post-build string replacement)');
|
|
51
|
+
try {
|
|
52
|
+
execSync('npm run build:vite', {
|
|
53
|
+
cwd: packageDir,
|
|
54
|
+
stdio: 'inherit',
|
|
55
|
+
env: {
|
|
56
|
+
...process.env,
|
|
57
|
+
FP_ENCRYPTION_KEY: key,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
console.log('');
|
|
61
|
+
console.log('📝 Generating TypeScript declarations...');
|
|
62
|
+
execSync('npx tsc --emitDeclarationOnly', {
|
|
63
|
+
cwd: packageDir,
|
|
64
|
+
stdio: 'inherit',
|
|
65
|
+
});
|
|
66
|
+
console.log('');
|
|
67
|
+
console.log('📦 Step 1/5: Key injected during build ✓');
|
|
68
|
+
} catch (err) {
|
|
69
|
+
throw new Error('Build from source failed. Make sure vite is installed (npm install)');
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
// Fallback method: String replacement in pre-built dist files
|
|
73
|
+
// Used when vite.config.ts is not available (npm consumers without dev dependencies)
|
|
74
|
+
console.log('📦 Step 1/5: Injecting encryption key via string replacement...');
|
|
75
|
+
console.log(' (Fallback method - vite.config.ts not found)');
|
|
76
|
+
|
|
77
|
+
let keyInjected = false;
|
|
78
|
+
for (const file of files) {
|
|
79
|
+
const filePath = path.join(distDir, file);
|
|
80
|
+
|
|
81
|
+
if (!fs.existsSync(filePath)) {
|
|
82
|
+
console.log(` ⚠️ ${file} not found, skipping`);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
87
|
+
|
|
88
|
+
// Check if sentinel exists
|
|
89
|
+
if (!code.includes(sentinel)) {
|
|
90
|
+
console.log(` ⚠️ ${file} does not contain the default key sentinel`);
|
|
91
|
+
console.log(` Key may have already been replaced, or dist needs to be rebuilt`);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Replace all occurrences of the sentinel with the actual key
|
|
96
|
+
const escapedSentinel = sentinel.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
97
|
+
const newCode = code.replace(new RegExp(`"${escapedSentinel}"`, 'g'), JSON.stringify(key));
|
|
98
|
+
|
|
99
|
+
// Verify the replacement worked
|
|
100
|
+
if (newCode === code) {
|
|
101
|
+
console.log(` ⚠️ ${file} - replacement had no effect`);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (newCode.includes(sentinel)) {
|
|
106
|
+
console.log(` ⚠️ ${file} - sentinel still present after replacement`);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
fs.writeFileSync(filePath, newCode);
|
|
111
|
+
keyInjected = true;
|
|
112
|
+
console.log(` ✓ ${file}`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!keyInjected) {
|
|
116
|
+
console.log(' ⚠️ Warning: No files were updated');
|
|
117
|
+
console.log(' The key may have already been injected, or dist files may need rebuilding');
|
|
118
|
+
}
|
|
53
119
|
}
|
|
54
120
|
|
|
55
|
-
// Step 2:
|
|
121
|
+
// Step 2: Skip TypeScript declarations (already generated)
|
|
56
122
|
console.log('');
|
|
57
|
-
console.log('
|
|
58
|
-
try {
|
|
59
|
-
execSync('npx tsc --emitDeclarationOnly', {
|
|
60
|
-
cwd: packageDir,
|
|
61
|
-
stdio: 'inherit',
|
|
62
|
-
});
|
|
63
|
-
} catch (err) {
|
|
64
|
-
// Non-fatal, declarations might already exist
|
|
65
|
-
console.log(' (skipped or already generated)');
|
|
66
|
-
}
|
|
123
|
+
console.log('⏭️ Step 2/5: TypeScript declarations already present, skipping...');
|
|
67
124
|
|
|
68
125
|
// Step 3: Obfuscate (optional)
|
|
69
126
|
if (!skipObfuscation) {
|
|
@@ -161,6 +218,9 @@ module.exports = async function build(args) {
|
|
|
161
218
|
console.log('🗑️ Step 5/5: Removing source maps...');
|
|
162
219
|
|
|
163
220
|
function deleteMapFiles(dir, prefix = '') {
|
|
221
|
+
if (!fs.existsSync(dir)) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
164
224
|
const files = fs.readdirSync(dir);
|
|
165
225
|
for (const file of files) {
|
|
166
226
|
const fullPath = path.join(dir, file);
|
package/src/index.ts
CHANGED
|
@@ -453,6 +453,17 @@ class FingerprintScanner {
|
|
|
453
453
|
// Key is injected at build time via Vite's define option
|
|
454
454
|
// Customers run: npx fpscanner build --key=their-key
|
|
455
455
|
const key = __FP_ENCRYPTION_KEY__;
|
|
456
|
+
|
|
457
|
+
// Runtime safety check: warn if using the default sentinel key
|
|
458
|
+
// Use a dynamic check that prevents build-time optimization
|
|
459
|
+
if (key.length > 20 && key.indexOf('DEFAULT') > 0 && key.indexOf('FPSCANNER') > 0) {
|
|
460
|
+
console.warn(
|
|
461
|
+
'[fpscanner] WARNING: Using default encryption key! ' +
|
|
462
|
+
'Run "npx fpscanner build --key=your-secret-key" to inject your own key. ' +
|
|
463
|
+
'See: https://github.com/antoinevastel/fpscanner#advanced-custom-builds'
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
456
467
|
const enc = await encryptString(JSON.stringify(fingerprint), key);
|
|
457
468
|
|
|
458
469
|
return enc;
|