HTML5 & canvas fingerprinting
HTML5 & canvas fingerprinting

demo
https://codepen.io/xgqfrms/full/BaoMWMp

window.addEventListener(`load`, () => {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext("2d");
ctx.font = "30px Arial";
ctx.fillText("Hello World",10,50);
ctx.moveTo(0,60);
ctx.lineTo(200,60);
ctx.stroke();
const b64 = canvas.toDataURL().replace("data:image/png;base64,","");
// console.log(b64);
const len = b64.length;
const header = b64.slice(0, 7);
const footer = b64.slice(len - 7);
const html = `<span class="keyword">${header}</span>...<span class="keyword">${footer}</span>`;
const pre = document.querySelector(`[data-uid="pre"]`);
// pre.value = b64;
// pre.innerText = b64;
pre.innerHTML = b64;
const dom = document.querySelector(`[data-uid="dom"]`);
// dom.innerText = b64;
dom.insertAdjacentHTML(`afterbegin`, html);
});
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
h1, [data-uid="dom"] {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
[data-uid="pre"] {
// display: flex;
// justify-content: center;
// align-items: center;
text-align: left;
max-width: 80vw;
overflow-x: hidden;
overflow-y: auto;
background: #000;
color: green;
min-height: 50vh;
height: 70vh;
// height: auto;
font-size: 16px;
line-height: 1.5em;
word-break: break-word;
white-space: normal;
// overflow-wrap: break-word;
padding: 10px;
}
footer {
position: fixed;
bottom: 10px;
left: 0;
right: 0;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
color: lightgreen;
font-size: 16px;
line-height: 1.5em;
padding: 10px;
}
canvas 指纹, UUID
canvas fingerprinting
https://browserleaks.com/canvas
https://blog.allenchou.cc/canvas-fingerprinting/
/*
http://phpjs.org/functions/bin2hex/
http://kevin.vanzonneveld.net
http://phpjs.org/functions/bin2hex:361#comment_177616
*/
function bin2hex(s) {
let i, l, o = '', n;
s += '';
for (i = 0, l = s.length; i < l; i++) {
n = s.charCodeAt(i)
.toString(16);
o += n.length < 2 ? '0' + n : n;
}
return o;
}
const getUUID = (domain = ``) => {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext(2d);
ctx.textBaseline = top;
ctx.font = 14px 'Arial';
ctx.textBaseline = tencent;
ctx.fillStyle = #f60;
ctx.fillRect(125,1,62,20);
ctx.fillStyle = #069;
ctx.fillText(domain, 2, 15);
ctx.fillStyle = rgba(102, 204, 0, 0.7);
ctx.fillText(txt, 4, 17);
const b64 = canvas.toDataURL().replace(data:image/png;base64,,);
const bin = atob(b64);
const crc = bin2hex(bin.slice(-16,-12));
return crc;
}
const log = console.log;
const uuid = getUUID(`https://www.xgqfrms.xyz/`);
log(`canvas uuid`, uuid );
反 canvas 指纹追踪
覆写 canvas 的原型方法,添加随机干扰项
incognito 隐身模式, 亲测不好使
https://juejin.im/post/5d97fb5ef265da5ba12cdea9
https://blog.csdn.net/Revivedsun/article/details/103534149
https://security.tencent.com/index.php/blog/msg/59
https://www.freebuf.com/news/40745.html
https://thehackernews.com/2014/07/html5-canvas-fingerprint-widely-used.html
http://docs.multilogin.com/l/zh/article/7gNVYHcFKG-canvas
https://www.cnblogs.com/leijing0607/p/8044218.html
fingerprint
https://github.com/Valve/fingerprintJS
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
HTML5 & canvas fingerprinting的更多相关文章
- HTML5 + JS 网站追踪技术:帆布指纹识别 Canvas FingerPrinting Universally Unique Identifier,简称UUID
1 1 1 HTML5 + JS 网站追踪技术:帆布指纹识别 Canvas FingerPrinting 1 一般情况下,网站或者广告联盟都会非常想要一种技术方式可以在网络上精确定位到每一个个体,这 ...
- 帆布指纹识别(canvas fingerprinting)
广告联盟或许网站运营者都希望能够精准定位并标识每一个个体,通过对用户行为的分析(浏览了哪些页面?搜索了哪些关键字?对什么感兴趣?点了哪些按钮?用了哪些功能?看了哪些商品?把哪些放入了购物车等等),为用 ...
- HTML5 程序设计 - 使用HTML5 Canvas API
请你跟着本篇示例代码实现每个示例,30分钟后,你会高喊:“HTML5 Canvas?!在哥面前,那都不是事儿!” 呵呵.不要被滚动条吓到,很多都是代码和图片.我没有分开写,不过上面给大家提供了目录,方 ...
- 赠书:HTML5 Canvas 2d 编程必读的两本经典
赠书:HTML5 Canvas 2d 编程必读的两本经典 这两年多一直在和HTML5 Canvas 打交道,也带领团队开发了世界首款基于HTML5 Canvas 的演示文档工具---AxeSlide( ...
- 如何开发一个简单的HTML5 Canvas 小游戏
原文:How to make a simple HTML5 Canvas game 想要快速上手HTML5 Canvas小游戏开发?下面通过一个例子来进行手把手教学.(如果你怀疑我的资历, A Wiz ...
- html5 canvas常用api总结(一)
1.监听浏览器加载事件. window.addEventListener("load",eventWindowLoaded,false); load事件在html页面加载结束时发生 ...
- HTML5 Canvas绘制转盘抽奖
新项目:完整的Canvas转盘抽奖代码 https://github.com/givebest/GB-canvas-turntable 演示 http://blog.givebest.cn/GB-ca ...
- html5 canvas首屏自适应背景动画循环效果代码
模板描述:html5 canvas首屏自适应背景动画循环效果代码 由于动态图太大,怕以后服务器受不了,所以现在都改为静态图了,大家点击演示地址一样的,希望大家喜欢,你们的支持就是小海的动力!! 欢迎大 ...
- 自己写的HTML5 Canvas + Javascript五子棋
看到一些曾经只会灌水的网友,在学习了前端之后,已经能写出下载量几千几万的脚本.样式,帮助大众,成为受欢迎的人,感觉满羡慕的.我也想学会前端技术,变得受欢迎呀.于是心血来潮,开始学习前端知识,并写下了这 ...
随机推荐
- 一站式入口服务|爱奇艺微服务平台 API 网关实战 原创 弹性计算团队 爱奇艺技术产品团队
一站式入口服务|爱奇艺微服务平台 API 网关实战 原创 弹性计算团队 爱奇艺技术产品团队
- jvm 三种编译
https://blog.csdn.net/fuxiaoxiaoyue/article/details/93497558 https://blog.csdn.net/tjiyu/article/det ...
- OAuth2.0与前端无感知token刷新实现
前言 OAuth是一个关于授权(authorization)的开放网络标准,在全世界得到广泛的应用.Facebook.Twitter和Google等各种在线服务都提供了基于OAuth规范的认证机制. ...
- SpringMVC听课笔记(二:SpringMVC的 HelloWorld)
1.如何建Maven web项目,请看http://how2j.cn/k/maven/maven-eclipse-web-project/1334.html 2.Maven项目,pom文件中的jar包 ...
- C#9.0:Records
概述 在C#9.0下,record是一个关键字,微软官方目前暂时将它翻译为记录类型. 传统面向对象的编程的核心思想是一个对象有着唯一标识,封装着随时可变的状态.C#也是一直这样设计和工作的.但是一些时 ...
- Excel 快速填充:填充柄+数据验证
鼠标左键拖拽填充或者双击填充 右键拖拽填充: 可以填充等比数列.工作日等等 数据验证: 通过下拉箭头快速选择数据: 选择单元格区域-[数据]-[数据验证]-序列 数据科学交流群,群号:18915878 ...
- Spark——DataFrames,RDD,DataSets、广播变量与累加器
Spark--DataFrames,RDD,DataSets 一.弹性数据集(RDD) 创建RDD 1.1RDD的宽依赖和窄依赖 二.DataFrames 三.DataSets 四.什么时候使用Dat ...
- 4. Linux工作目录切换和文本文件编辑命令
1.pwd:显示用户当前所处的工作目录 举例:[root@Centos ~]# pwd /root 2.cd:切换工作路径 "cd -"命令返回到上一次所处的目录 " ...
- NOIP组合数选题
前言: "所有的组合数问题都是好题" ----清华某高材生zhx 组合数问题在近几年的NOIP的考试中多次露面,感觉有必要好好学一学 组合数的常见公式: C ( ...
- Codeforces Global Round 7 D2. Prefix-Suffix Palindrome (Hard version)(Manacher算法)
题意: 取一字符串不相交的前缀和后缀(可为空)构成最长回文串. 思路: 先从两边取对称的前后缀,之后再取余下字符串较长的回文前缀或后缀. #include <bits/stdc++.h> ...