added iframe exploit to readme

This commit is contained in:
Daniel Roesler 2015-02-05 11:34:41 -08:00
parent d9da4fdb9c
commit bc5294e7b4
2 changed files with 30 additions and 11 deletions

View file

@ -21,6 +21,22 @@ function getIPs(callback){
var RTCPeerConnection = window.RTCPeerConnection var RTCPeerConnection = window.RTCPeerConnection
|| window.mozRTCPeerConnection || window.mozRTCPeerConnection
|| window.webkitRTCPeerConnection; || window.webkitRTCPeerConnection;
//bypass naive webrtc blocking
if (!RTCPeerConnection) {
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
document.body.appendChild(iframe);
var win = iframe.contentWindow;
window.RTCPeerConnection = win.RTCPeerConnection;
window.mozRTCPeerConnection = win.mozRTCPeerConnection;
window.webkitRTCPeerConnection = win.webkitRTCPeerConnection;
RTCPeerConnection = window.RTCPeerConnection
|| window.mozRTCPeerConnection
|| window.webkitRTCPeerConnection;
}
//minimal requirements for data connection
var mediaConstraints = { var mediaConstraints = {
optional: [{RtpDataChannels: true}] optional: [{RtpDataChannels: true}]
}; };

View file

@ -28,19 +28,22 @@
var RTCPeerConnection = window.RTCPeerConnection var RTCPeerConnection = window.RTCPeerConnection
|| window.mozRTCPeerConnection || window.mozRTCPeerConnection
|| window.webkitRTCPeerConnection; || window.webkitRTCPeerConnection;
//bypass naive webrtc blocking
if (!RTCPeerConnection) { if (!RTCPeerConnection) {
//bypass naive webrtc blocking var iframe = document.createElement('iframe');
var iframe = document.createElement('iframe'); iframe.style.display = 'none';
iframe.style.display = 'none'; document.body.appendChild(iframe);
document.body.appendChild(iframe); var win = iframe.contentWindow;
var win = iframe.contentWindow; window.RTCPeerConnection = win.RTCPeerConnection;
window.RTCPeerConnection = win.RTCPeerConnection; window.mozRTCPeerConnection = win.mozRTCPeerConnection;
window.mozRTCPeerConnection = win.mozRTCPeerConnection; window.webkitRTCPeerConnection = win.webkitRTCPeerConnection;
window.webkitRTCPeerConnection = win.webkitRTCPeerConnection; RTCPeerConnection = window.RTCPeerConnection
RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection
|| window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
|| window.webkitRTCPeerConnection;
} }
//minimal requirements for data connection
var mediaConstraints = { var mediaConstraints = {
optional: [{RtpDataChannels: true}] optional: [{RtpDataChannels: true}]
}; };