【轉】禁用chrome firefox 的 WebRTC功能防止真實IP泄漏


無論是使用VPN還是其它代理方式,很多時候我們不希望暴露自己的真實IP,且一直以來我們認為VPN是安全的,所有流量都會走VPN。 
但最近暴露出一個WebRTC特性,會暴露我們的真實IP。適用瀏覽器:chrome,firefox. safari則沒有問題。

只需要一段js代碼就可以獲取我們的真實IP。一旦被想時時監控別人的人知道並使用此方法釣魚,便可直接獲得原始IP。這簡直太恐怖了。

看來以后如果重裝系統,第一件事兒把cnnic證書刪除后,第二件事兒就是禁用WebRTC.

有一個插件可以方便的禁用WebRTC, 插件下載

Firefox可在瀏覽器上輸入:about:config。之后搜索:media.peerconnection.enabled。找到它后雙擊,將其改成 false 即可。

原理可以參考一下這里: https://github.com/diafygi/webrtc-ips

或者直接把下面這段代碼放在chrome的console里運行一下,就知道自己的真實IP了。


//get the IP addresses associated with an account 
function getIPs(callback){ 
var ip_dups = {};

//compatibility for firefox and chrome 
var RTCPeerConnection = window.RTCPeerConnection 
|| window.mozRTCPeerConnection 
|| window.webkitRTCPeerConnection; 
var mediaConstraints = { 
optional: [{RtpDataChannels: true}] 
};

//firefox already has a default stun server in about:config 
// media.peerconnection.default_iceservers = 
// [{"url": "stun:stun.services.mozilla.com"}] 
var servers = undefined;

//add same stun server for chrome 
if(window.webkitRTCPeerConnection) 
servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};

//construct a new RTCPeerConnection 
var pc = new RTCPeerConnection(servers, mediaConstraints);

//listen for candidate events 
pc.onicecandidate = function(ice){

//skip non-candidate events 
if(ice.candidate){

//match just the IP address 
var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/ 
var ip_addr = ip_regex.exec(ice.candidate.candidate)[1];

//remove duplicates 
if(ip_dups[ip_addr] === undefined) 
callback(ip_addr);

ip_dups[ip_addr] = true; 

};

//create a bogus data channel 
pc.createDataChannel("");

//create an offer sdp 
pc.createOffer(function(result){

//trigger the stun server request 
pc.setLocalDescription(result, function(){}, function(){});

}, function(){}); 
}

//Test: Print the IP addresses into the console 
getIPs(function(ip){console.log(ip);}); 

from:http://ju.outofmemory.cn/entry/333116


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM