bypass CyberGhost WebRTC-Leak protection

This commit is contained in:
Daniel Roesler 2015-02-26 12:48:38 -08:00
parent d0b47fcfe9
commit 97685cbdca
2 changed files with 23 additions and 4 deletions

View file

@ -25,10 +25,20 @@ function getIPs(callback){
//bypass naive webrtc blocking
if(!RTCPeerConnection){
//create an iframe node
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
//invalidate content script
iframe.sandbox = 'allow-same-origin';
iframe.style.display = 'none';
//insert a listener to cutoff any attempts to
//disable webrtc when inserting to the DOM
iframe.addEventListener("DOMNodeInserted", function(e){
e.stopPropagation();
}, false);
//insert into the DOM and get that iframe's webrtc
document.body.appendChild(iframe);
var win = iframe.contentWindow;
RTCPeerConnection = win.RTCPeerConnection
@ -91,9 +101,8 @@ function getIPs(callback){
var lines = pc.localDescription.sdp.split('\n');
lines.forEach(function(line){
if(line.indexOf('a=candidate:') === 0){
if(line.indexOf('a=candidate:') === 0)
handleCandidate(line);
}
});
}, 1000);
}

View file

@ -32,10 +32,20 @@
//bypass naive webrtc blocking
if(!RTCPeerConnection){
//create an iframe node
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
//invalidate content script
iframe.sandbox = 'allow-same-origin';
iframe.style.display = 'none';
//insert a listener to cutoff any attempts to
//disable webrtc when inserting to the DOM
iframe.addEventListener("DOMNodeInserted", function(e){
e.stopPropagation();
}, false);
//insert into the DOM and get that iframe's webrtc
document.body.appendChild(iframe);
var win = iframe.contentWindow;
RTCPeerConnection = win.RTCPeerConnection