provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. >> that’s correct, it’s right in your browser!
• Signaling server: • Loads client-side context (JS code) • Mediates control messages and meta-meta between endpoints • Signaling protocol is not specified (BIY)
for setting the media path up: • Exchange of media parameters (SDP) • Exchange of network parameters • UDP hole punching • STUN (Session Traversal Utilities for NAT) • TURN (Traversal Using Relays around NAT) • ICE (Interactive Connectivity Establishment)
symmetric NATs) Browser A Browser B NAT / Firewall NAT / Firewall Public server (S) N:P2 M:P4 1. A à N à M : A:P1 ⇄ N:P2 2. B à M à N : B:P3 ⇄ M:P4 3. N:P2, M:P4 à S 4. A:P1, B:P3 ⇄ S (P2, P4) 5. A:P1 à M:P4 à B B:P3 à N:P2 à A A ⇄ B A:P1 B:P3
your local network setup (local IPs, local subnets, NAT configuration…) • TURN • To relay your media connection if P2P fails • ICE • Bundles all STUN/TURN info for exchange via the signaling channel and probing until pair works
record audio and video • RTCPeerConnection: stream audio and video between users • RTCDataChannel: stream data between users “Be skeptical of reports that a platform 'supports WebRTC'. Often this actually just means that getUserMedia is supported, but not any of the other RTC components”
of each P2P connection and encapsulates all the connection setup, management, and state within a single easy-to-use interface • Connection initiation: SDP description exchange • After it is established: sending of real-time audio and video data as a bitstream var conn = new RTCPeerConnection(conf); conn.onaddstream = function(stream) { // use stream here };
with low latency and high throughput • Features: • Leveraging of RTCPeerConnection session setup • Multiple simultaneous channels, with prioritization • Reliable and unreliable delivery semantics • Built-in security (DTLS) and congestion control • Ability to use with or without audio or video Try my* bear: https://www.cubeslam.com/dcegjx
(still experimental) • Sample recording functionality: • mediaRecorder.start() • mediaRecorder.stop() • mediaRecorder.ondataavailable à recordedBlobs.push(event.data) • … and then make it available for play/download • Example of recorded video object link: blob:https://webrtc.github.io/4d25f90a-244b-4e1c-9495-e5f21074aab9
part of it, not a plugin • Frequent updates • Permissions (explicit user consent*) • Enforced encryption • RTP is explicitly forbidden • End-to-end encryption between peers • Mandatory HTTPS + DTLS / SRTP
the effects of JavaScript/HTML injection? • Can we steal WebRTC credentials? • Can we steal privileged information about a client? • What are the effects of taking over a signaling server? • Can we crash the server, or render it unresponsive? • What information can be extracted? • Can we cause a client to connect to a rogue network?
in chat • … might equal to a complete takeover of the victim’s context in case of XSS • ... as well as leads to obtaining internal addresses of your counterparts (more soon) • ... and facilitates direct transfers of malware • Additional considerations: • Poor registration mechanisms ~ access and abuse • Poor session termination ~ session reuse
capture private info about the user • Data storage • Malicious app could steal data from WebRTC-powered app • Network interception • Credentials could be sent over HTTP beforehand • UI phishing / malware
via fake user or creation of “invisible” one? ;) • Or simply crashing it and bringing chaos • Registration hijacking • Capture/change IP addresses to forward calls to attacker’s server • DoS against user’s device • Race conditions (overriding legitimate REGISTER requests) • Replay attacks
and it should be possible to perform authentication independently Identity Providers (Facebook Login, BrowserID, OAuth) provide auth for users without participation of the signaling server
using WebRTC – sonar.js • Enumerate hosts on internal network • Fingerprint devices using onload() events and known CSS/images • Using pre-set DB of exploits for devices, launch them against detected one https://thehackerblog.com/sonar-a-framework-for-scanning-and-exploiting-internal-hosts-with-a-webpage/
apps require only a user's ID to perform a call, so it might be a good idea to have pre-registration or authentication to prevent from untrusted parties. Another best practice is to consistently monitor the number of peers in communication vs total number on the signaling server (no spies, please!)
the page what permissions the application will ask for, as often users will agree to permission requests or similar dialogs without consciously reading the message
confirmed the call is compromised by unauth party, it should be within the power of Web Application server rendering the WebRTC capable page to cut off the call