国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

JS繞過代理、VPN獲取真實(shí)IP及內(nèi)網(wǎng)IP,逆向追蹤的實(shí)現(xiàn)方法

2019-11-20 09:02:53
字體:
供稿:網(wǎng)友

Firefox 跟 Chrome支持WebRTC可以向STUN服務(wù)器請求,返回內(nèi)外網(wǎng)IP,不同于XMLHttpRequest請求,STUN請求開發(fā)者工具當(dāng)中看不到網(wǎng)絡(luò)請求的。

//get the IP addresses associated with an accountfunction 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(){});}//Test: Print the IP addresses into the consolegetIPs(function(ip){console.log(ip);});

以上這篇JS繞過代理、VPN獲取真實(shí)IP及內(nèi)網(wǎng)IP,逆向追蹤的實(shí)現(xiàn)方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持武林網(wǎng)。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 西安市| 稻城县| 北碚区| 鹤峰县| 扎鲁特旗| 朝阳区| 政和县| 长葛市| 营山县| 广东省| 丰都县| 子长县| 林州市| 临沭县| 肥城市| 灵丘县| 富蕴县| 湖口县| 遵义县| 沿河| 邵东县| 准格尔旗| 托克托县| 云南省| 滨海县| 翁源县| 鄂尔多斯市| 南华县| 西宁市| 札达县| 德昌县| 长沙县| 正蓝旗| 岳阳县| 黄骅市| 平武县| 师宗县| 株洲市| 宜君县| 太康县| 吉安县|