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五子棋
看到一些曾经只会灌水的网友,在学习了前端之后,已经能写出下载量几千几万的脚本.样式,帮助大众,成为受欢迎的人,感觉满羡慕的.我也想学会前端技术,变得受欢迎呀.于是心血来潮,开始学习前端知识,并写下了这 ...
随机推荐
- 干货 | 高耦合场景下,Trip.com如何做支付设计与落地
干货 | 高耦合场景下,Trip.com如何做支付设计与落地 https://mp.weixin.qq.com/s/VR9NTR3RpKVfmUPcwgMABg 原创 Ryann Liu 携程技术 2 ...
- 控制反转 依赖注入 main函数
通过依赖注入.服务定位实现控制反转 Go kit - Frequently asked questions https://gokit.io/faq/ Dependency Injection - W ...
- CAP理论解读
经历过技术面试的小伙伴想必对这个两个概念已经再熟悉不过了! 我当年参加面试的时候,不夸张地说,只要问到分布式相关的内容,面试官几乎是必定会问这两个分布式相关的理论. 并且,这两个理论也可以说是小伙伴们 ...
- Smarty 3.1.34 反序列化POP链(任意文件删除)
Smarty <= 3.1.34,存在任意文件删除的POP链. Exp: <?php class Smarty_Internal_Template { public $smarty = n ...
- Redis常见配置文件详解
Redis常见配置文件详解 # vi redis.conf 1 2 3 daemonize yes #是否以后台进程运行 4 5 pidfile /var/run/redis/redis-server ...
- Java性能优化,操作系统内核性能调优,JYM优化,Tomcat调优
文章目录 Java性能优化 尽量在合适的场合使用单例 尽量避免随意使用静态变量 尽量避免过多过常地创建Java对象 尽量使用final修饰符 尽量使用局部变量 尽量处理好包装类型和基本类型两者的使用场 ...
- 网际互连__TCP/IP三次握手和四次挥手
在TCP/IP协议中,TCP协议提供可靠的连接服务. 位码即tcp标志位,有6种标示: SYN(synchronous建立联机).ACK(acknowledgement 确认).PSH(push传送) ...
- JavaWeb-tomcat安装(Unsupported major.minor version 51.0/startup.bat闪退)
JavaWeb-tomcat安装(Unsupported major.minor version 51.0) 一 启动startup.bat 出错i 今天安装tomcat出错,折腾了一下午,收获了许多 ...
- AtCoder Beginner Contest 179
比赛链接:https://atcoder.jp/contests/abc179/tasks A - Plural Form 题意 给出一个由小写字母组成的单词,如果单词以 $s$ 结尾,在单词的末尾加 ...
- F - Count the Colors(线段树)
Painting some colored segments on a line, some previously painted segments may be covered by some th ...