{"id":530138,"date":"2021-08-29T21:59:20","date_gmt":"2021-08-29T13:59:20","guid":{"rendered":"http:\/\/4563.org\/?p=530138"},"modified":"2021-08-29T21:59:20","modified_gmt":"2021-08-29T13:59:20","slug":"%e5%8f%91%e7%8e%b0%e9%80%9a%e8%bf%87-webrtc-%e5%8f%af%e4%bb%a5%e7%bb%95%e8%bf%87%e8%8e%b7%e5%8f%96%e7%9c%9f%e5%ae%9eip%ef%bc%8c%e5%8f%af%e6%80%95%ef%bc%8c%e6%94%be%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=530138","title":{"rendered":"\u53d1\u73b0\u901a\u8fc7 webRTC \u53ef\u4ee5\u7ed5\u8fc7\u83b7\u53d6\u771f\u5b9eIP\uff0c\u53ef\u6015\uff0c\u653e\u4ee3\u7801&#8230;"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u864e\u8c37<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u53d1\u73b0\u901a\u8fc7 webRTC \u53ef\u4ee5\u7ed5\u8fc7\u83b7\u53d6\u771f\u5b9eIP\uff0c\u53ef\u6015\uff0c\u653e\u4ee3\u7801&#8230;<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 \u864e\u8c37 \u4e8e 2021-8-29 15:16 \u7f16\u8f91 <\/p>\n<p> \u8be6\u60c5\uff1ahttps:\/\/hostloc.com\/thread-885237-1-1.html<\/p>\n<p>  function getIPs(callback){<br \/>  &nbsp; &nbsp; var ip_dups = {};<\/p>\n<p>  &nbsp; &nbsp; var RTCPeerConnection = window.RTCPeerConnection<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;|| window.mozRTCPeerConnection<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;|| window.webkitRTCPeerConnection;<br \/>  &nbsp; &nbsp; var useWebKit = !!window.webkitRTCPeerConnection;<\/p>\n<p>  &nbsp; &nbsp; if(!RTCPeerConnection){<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;var win = iframe.contentWindow;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;RTCPeerConnection = win.RTCPeerConnection<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|| win.mozRTCPeerConnection<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|| win.webkitRTCPeerConnection;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;useWebKit = !!win.webkitRTCPeerConnection;<br \/>  &nbsp; &nbsp; }<\/p>\n<p>  &nbsp; &nbsp; var mediaConstraints = {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;optional: [{RtpDataChannels: true}]<br \/>  &nbsp; &nbsp; };<\/p>\n<p>  &nbsp; &nbsp; var servers = {iceServers: [{urls: &quot;stun:stun.l.google.com:19302&quot;}]};<\/p>\n<p>  &nbsp; &nbsp; var pc = new RTCPeerConnection(servers, mediaConstraints);<\/p>\n<p>  &nbsp; &nbsp; function handleCandidate(candidate){<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;var ip_regex = \/({1,3}(.{1,3}){3}|{1,4}(:{1,4}){7})\/<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;var ip_addr = ip_regex.exec(candidate) &amp;&amp; ip_regex.exec(candidate);<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;if(!ip_addr) return;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;if(ip_dups === undefined)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;callback(ip_addr);<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;ip_dups = true;<br \/>  &nbsp; &nbsp; }<\/p>\n<p>  &nbsp; &nbsp; pc.onicecandidate = function(ice){<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;if(ice.candidate)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;handleCandidate(ice.candidate.candidate);<br \/>  &nbsp; &nbsp; };<\/p>\n<p>  &nbsp; &nbsp; pc.createDataChannel(&quot;&quot;);<\/p>\n<p>  &nbsp; &nbsp; pc.createOffer(function(result){<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;pc.setLocalDescription(result, function(){}, function(){});<\/p>\n<p>  &nbsp; &nbsp; }, function(){});<\/p>\n<p>  &nbsp; &nbsp; setTimeout(function(){<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;var lines = pc.localDescription.sdp.split(&#8216;n&#8217;);<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;lines.forEach(function(line){<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if(line.indexOf(&#8216;a=candidate:&#8217;) === 0)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; handleCandidate(line);<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;});<br \/>  &nbsp; &nbsp; }, 1000);<br \/>  }<\/p>\n<p>  getIPs(function(ip){<br \/>  &nbsp; &nbsp; ip &amp;&amp; console.log(ip);<br \/>  });<\/p>\n<p>  \u4e22\u5165\u63a7\u5236\u53f0\u8fd0\u884c\u5c31\u51fa\u6765\u4e86\uff0c\u5404\u4f4dMJJ\u4e0d\u8981\u641e\u4e8b~\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>h20<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5173\u95ed\u5c31\u5b8c\u4e8b\u4e86 \u591a\u5927\u70b9\u4e8b\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>tcpdump<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u76f4\u64ad\u7f51\u7ad9\u65e9\u5c31\u57fa\u4e8e\u8fd9\u4e2a\u6280\u672f\u5728\u641eP2P cdn\u4e86https:\/\/cdn.jsdelivr.net\/gh\/master-of-forums\/master-of-forums\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e50\u6b63\u7eeb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u65e9\u5c31\u77e5\u9053\u4e86\uff0c\u521a\u53d1\u7684\u5e16 https:\/\/hostloc.com\/thread-885237-1-1.html  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>jqbaobao<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5b9e\u9645\u4e0a\u538b\u6839\u6ca1\u7528\uff0c\u4ee3\u7406\u8f6f\u4ef6\u65e9\u5c31\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u4e86\uff0c\u4e5f\u4e0d\u77e5\u9053\u8c01\u8fd9\u4e48\u5012\u9709\u80fd\u88ab\u67e5\u5230\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>feixiang<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6ca1\u51fa\u6765\u5440\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u864e\u8c37<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tjqbaobao \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-8-29 15:16<br \/>  \u5b9e\u9645\u4e0a\u538b\u6839\u6ca1\u7528\uff0c\u4ee3\u7406\u8f6f\u4ef6\u65e9\u5c31\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u4e86\uff0c\u4e5f\u4e0d\u77e5\u9053\u8c01\u8fd9\u4e48\u5012\u9709\u80fd\u88ab\u67e5\u5230 &#8230;<\/p>\n<p> CFW \u6ca1\u6709\u89e3\u51b3\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>optimism<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5e2e\u4f60\u9876\u4e00\u4e0b\u5427\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hqt<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<p>  \t\t\t\t\t<strong>\u817f\u6bdb\u98d8\u98d8<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\thttps:\/\/github.com\/gorhill\/uBlock\/wiki\/Prevent-WebRTC-from-leaking-local-IP-address\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u864e\u8c37 \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u53d1\u73b0\u901a\u8fc7 w&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/530138"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=530138"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/530138\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=530138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=530138"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=530138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}