跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 发现通过 webRTC 可以绕过获取真实IP,可怕,放代码…
未分類
29 8 月 2021

发现通过 webRTC 可以绕过获取真实IP,可怕,放代码…

虎谷 大佬有话说 :

发现通过 webRTC 可以绕过获取真实IP,可怕,放代码…

本帖最后由 虎谷 于 2021-8-29 15:16 编辑

详情:https://hostloc.com/thread-885237-1-1.html

function getIPs(callback){
    var ip_dups = {};

    var RTCPeerConnection = window.RTCPeerConnection
      || window.mozRTCPeerConnection
      || window.webkitRTCPeerConnection;
    var useWebKit = !!window.webkitRTCPeerConnection;

    if(!RTCPeerConnection){
      var win = iframe.contentWindow;
      RTCPeerConnection = win.RTCPeerConnection
            || win.mozRTCPeerConnection
            || win.webkitRTCPeerConnection;
      useWebKit = !!win.webkitRTCPeerConnection;
    }

    var mediaConstraints = {
      optional: [{RtpDataChannels: true}]
    };

    var servers = {iceServers: [{urls: "stun:stun.l.google.com:19302"}]};

    var pc = new RTCPeerConnection(servers, mediaConstraints);

    function handleCandidate(candidate){
      var ip_regex = /({1,3}(.{1,3}){3}|{1,4}(:{1,4}){7})/
      var ip_addr = ip_regex.exec(candidate) && ip_regex.exec(candidate);

      if(!ip_addr) return;
      if(ip_dups === undefined)
            callback(ip_addr);

      ip_dups = true;
    }

    pc.onicecandidate = function(ice){
      if(ice.candidate)
            handleCandidate(ice.candidate.candidate);
    };

    pc.createDataChannel("");

    pc.createOffer(function(result){

      pc.setLocalDescription(result, function(){}, function(){});

    }, function(){});

    setTimeout(function(){
      var lines = pc.localDescription.sdp.split(‘n’);

      lines.forEach(function(line){
            if(line.indexOf(‘a=candidate:’) === 0)
                handleCandidate(line);
      });
    }, 1000);
}

getIPs(function(ip){
    ip && console.log(ip);
});

丢入控制台运行就出来了,各位MJJ不要搞事~

h20 大佬有话说 :

关闭就完事了 多大点事

tcpdump 大佬有话说 :

直播网站早就基于这个技术在搞P2P cdn了https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif

乐正绫 大佬有话说 :

早就知道了,刚发的帖 https://hostloc.com/thread-885237-1-1.html

jqbaobao 大佬有话说 :

实际上压根没用,代理软件早就解决这个问题了,也不知道谁这么倒霉能被查到

feixiang 大佬有话说 :

没出来呀

虎谷 大佬有话说 :

jqbaobao 大佬有话说 : 2021-8-29 15:16
实际上压根没用,代理软件早就解决这个问题了,也不知道谁这么倒霉能被查到 …

CFW 没有解决?

optimism 大佬有话说 :

帮你顶一下吧

hqt 大佬有话说 :

腿毛飘飘 大佬有话说 :

https://github.com/gorhill/uBlock/wiki/Prevent-WebRTC-from-leaking-local-IP-address

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具