Skip to content

Instantly share code, notes, and snippets.

@voluntas
Last active January 14, 2023 13:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voluntas/ab2bbec278a998945549afc420f7d899 to your computer and use it in GitHub Desktop.
Save voluntas/ab2bbec278a998945549afc420f7d899 to your computer and use it in GitHub Desktop.
えきねっとの WebRTC

えきねっとの WebRTC

経緯

えきねっとで予約しようと思ったとき chrome://webrtc-internals にえきねっとが表示されていた。

注意

これは別に WebRTC を使ってローカルアドレスを取得するのが悪いとかではなく、自分が気持ち悪いという話です。

まとめ

以下の URL にアクセスしたあと、 Chrome で chrome://webrtc-internals/ を開いてみてほしい。

何か表示されていないだろうか?

https://www.eki-net.com/sbbi/?sbbpg=sbbShell&gprid=cs, { iceServers: [], iceTransportPolicy: all, bundlePolicy: balanced, rtcpMuxPolicy: require, iceCandidatePoolSize: 0, sdpSemantics: "plan-b" },

これはえきねっとが WebRTC を利用しているというのがわかる。

SDP も生成されていて、DataChannel が利用されている。

v=0
o=- 3285708308863176244 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE data
a=msid-semantic: WMS
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=ice-ufrag:k6Sj
a=ice-pwd:T8PPpzyJJtab6C6A8bNm5l5g
a=ice-options:trickle
a=fingerprint:sha-256 44:A2:7D:F5:EC:F5:95:11:3E:23:C1:DA:A3:A2:12:45:46:5C:D2:9B:E9:5A:85:33:A0:D9:6E:E3:CD:C4:C4:E1
a=setup:actpass
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024

ただ、 setRemoteDescription がされていないので P2P 通信をするきもない。

<html lang="en"> <head> <title>env</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Expires" content="28FEB2002"> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <meta name="robots" content="noindex, nofollow"> <script type="text/javascript">  var csn='SPSI';function sbbgc(check_name){var start=document.cookie.indexOf(check_name+"=");var oVal='';var len=start+check_name.length+1;if((!start)&&(document.cookie.substring(0,check_name.length)!=check_name)){oVal='';}else if(start==-1){oVal='';}else{var end=document.cookie.indexOf(';',len);if(end==-1)end=document.cookie.length;var oVal=document.cookie.substring(len,end)}return oVal;} </script> </head> <body style="background-color: #FFFFFF;margin-left: 0px;margin-top: 0px;"> <div id="altCnt">nfl</div> <div id='clientCaps' style="behavior:url(#default#clientCaps)"></div> <div id='sbbtsdi' style=''></div> <script type="text/javascript"> window.parent.sbrmp=true; !function(t){try{t.sbbjglv=0;var e=t.RTCPeerConnection||t.webkitRTCPeerConnection||t.mozRTCPeerConnection;if(e){var n=new e({iceServers:[]});if(void 0===n.createDataChannel)return;if(void 0===n.createDataChannel)return;n.createDataChannel("",{reliable:!1}),n.onicecandidate=function(e){e.candidate&&c("a="+e.candidate.candidate)},n.createOffer().then(function(e){c(e.sdp),n.setLocalDescription(e)},function(e){});var a=Object.create(null);function i(e){if("0.0.0.0"!=e){a[e]=!0;var n=Object.keys(a);t.sbbjglv=n}}function c(e){e.split("\r\n").forEach(function(e){if(~e.indexOf("a=candidate")){var n=(t=e.split(" "))[4];"host"===t[7]&&i(n)}else if(~e.indexOf("c=")){var t;i(n=(t=e.split(" "))[2])}})}}else t.sbbjglv=["N"]}catch(e){}}(window); try{parent.lX=0;parent.lY=0;}catch(ex){;}

コードに出てくる a=candidate というのは、ローカル IP アドレスの候補。以下のような値になる。(IP アドレスはドキュメント用アドレスに加工済み)

a=candidate:505434299 1 udp 2113937151 192.0.2.1 54905 typ host generation 0 ufrag XYZ network-cost 999

何をしてるのかよくわからないが、本来の目的と違う理由でローカル IP アドレスを収集していて、気持ち悪い。

追記

2021-04-04

Chrome M89 でえきねっとに接続したところ、 mDNS を利用しており、こういった本来の目的と違う理由でローカル IP アドレスを収集される場合への対策ができている事を確認できた。

704553097 1 udp 2113937151 4984b929-9fc3-4001-97cb-151ba5ec9624.local 50115 typ host generation 0 ufrag NrHA network-cost 999
1011893804 1 udp 2113939711 9d4b51d7-d90d-4b35-a391-f5d5db222f88.local 60136 typ host generation 0 ufrag NrHA network-cost 999

draft-ietf-mmusic-mdns-ice-candidates-01 - Using Multicast DNS to protect privacy when exposing ICE candidates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment