zoukankan      html  css  js  c++  java
  • 浏览器唯一标识

    微信提供的浏览器指纹:fbaa833f9f71edf80f23d205b75e1f2c

    通过canvas生成指纹:1681af93

    微信的,修改部分UA即可伪造指纹

    <script src="https://wx.gtimg.com/wxpay_h5/fingerprint2.min.1.5.1.js"></script>
    <script>
    var fp=new Fingerprint2();
    fp.get(function(result){
        //result即为获取到的浏览器指纹值
        document.getElementById("wxb").innerHTML=result;
     });
    </script>

    canvas,太短,在大量数据下出现重复

    <script>
    function bin2hex(s) {
      var 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;
    }
    function getUUID(domain) {
        var canvas = document.createElement('canvas');
        var ctx = canvas.getContext("2d");
        var txt = domain;
        ctx.textBaseline = "top";
        ctx.font = "14px 'Arial'";
        ctx.textBaseline = "tencent";
        ctx.fillStyle = "#f60";
        ctx.fillRect(125,1,62,20);
        ctx.fillStyle = "#069";
        ctx.fillText(txt, 2, 15);
        ctx.fillStyle = "rgba(102, 204, 0, 0.7)";
        ctx.fillText(txt, 4, 17);
        var b64 = canvas.toDataURL().replace("data:image/png;base64,","");
        var bin = atob(b64);
        var crc = bin2hex(bin.slice(-16,-12));
        return crc;
    }
    </script>

    完整示例:

    <meta charset="utf-8">
    <title>浏览器唯一标识</title>
    <script src="https://wx.gtimg.com/wxpay_h5/fingerprint2.min.1.5.1.js"></script>
    <script>
    var fp=new Fingerprint2();
    
    fp.get(function(result){
    
        //result即为获取到的浏览器指纹值
        //document.write("浏览器指纹:"+result+ca);
        document.getElementById("wxb").innerHTML=result;
        document.getElementById("cab").innerHTML=getUUID("https://www.unique-liu.com/");
     });
    </script>
    <script>
    function bin2hex(s) {
      var 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;
    }
    
    function getUUID(domain) {
        var canvas = document.createElement('canvas');
        var ctx = canvas.getContext("2d");
        var txt = domain;
        ctx.textBaseline = "top";
        ctx.font = "14px 'Arial'";
        ctx.textBaseline = "tencent";
        ctx.fillStyle = "#f60";
        ctx.fillRect(125,1,62,20);
        ctx.fillStyle = "#069";
        ctx.fillText(txt, 2, 15);
        ctx.fillStyle = "rgba(102, 204, 0, 0.7)";
        ctx.fillText(txt, 4, 17);
    
        var b64 = canvas.toDataURL().replace("data:image/png;base64,","");
        var bin = atob(b64);
        var crc = bin2hex(bin.slice(-16,-12));
        return crc;
    }
    
    </script>
    
    <p>微信提供的浏览器指纹:<span id="wxb"></span></p>
    <p>通过canvas生成指纹:<span id="cab"></span></p>
    <br /><br />
    微信的,修改部分UA即可伪造指纹
    <br /><br />
    canvas,太短,在大量数据下出现重复
    
    <script>
    
    </script>
    View Code
  • 相关阅读:
    Android配置Charles实现Https调试
    python crontab 编码问题无法输出中文
    python 实现生产者 消费者案例
    Nginx日志分析- AWK命令快速分析日志【访问最多请求最多的ip、最频繁、恶意访问】
    HTTP常见状态码(14种)
    python之gevent 协程操作
    mongo分片集群生产环境操作步骤&&mongo注意事项
    记录一次supervisor在生产环境中遇到的坑minfds参数
    nginx负载均衡分类&&优先级配置
    SpringBoot整合富文本编辑器(UEditor)
  • 原文地址:https://www.cnblogs.com/7qin/p/14230626.html
Copyright © 2011-2022 走看看