FingerprintJS
FingerprintJS 是一个浏览器指纹库,可查询浏览器属性并从中计算出散列的访问者标识符。与 cookie 和本地存储不同,指纹在隐身/隐私模式下保持不变,即使浏览器数据被清除。
项目地址:https://github.com/fingerprintjs/fingerprintjs
简单使用
通过调用该库,会返回一个hash字符串,标识访问用户的唯一值
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
// Initialize the agent at application startup. const fpPromise = new Promise((resolve, reject) => { const script = document.createElement('script') script.onload = resolve script.onerror = reject script.async = true script.src = 'https://cdn.jsdelivr.net/npm/' + '@fingerprintjs/[email protected]/dist/fp.min.js' document.head.appendChild(script) }) .then(() => FingerprintJS.load()) // Get the visitor identifier when you need it. fpPromise .then(fp => fp.get()) .then(result => { // This is the visitor identifier: const visitorId = result.visitorId console.log(visitorId) }) |
最后效果图
该js放在存在漏洞的页面或者登录后的页面
发布者:糖太宗,转载请注明出处:https://www.qztxs.com/archives/science/technology/11381