Skip to content
October 10, 2026
  • Bluesky
  • Facebook
  • Linkedin
  • Mastodon
  • RSS
  • Twitter
  • Youtube

Daily CyberSecurity

Zero-hour alerts. Unmatched analysis.

Primary Menu
  • Home
  • CVE Data
    • CVE Watchtower
    • Top Exploited CVEs
    • CVE Stats by Vendor
    • Q2 2026 Report
    • CVE Alerts
    • CVE Alert Settings
    • Pricing
  • Cyber Criminals
  • Data Leak
  • Free Tools
    • CVSS 3.1 Calculator
    • Certificate Viewer
    • DNS Lookup
    • Encoder & Hash Generator
    • IP / Subnet Calculator
    • Whois Lookup
  • Linux
  • Malware
  • Vulnerability
  • Submit Press Release
  • Weekly Recap
Light/Dark Button
  • Home
  • Technique
  • How to use WebRTC to get viewer’s IP address
  • Technique

How to use WebRTC to get viewer’s IP address

Do Son September 18, 2017 4 minutes read
WebRTC bug

What is WebRTC?

In the conventional video communication, people often need to use a third-party server as a transit, such as B and B want to communicate through the video, then they need to establish a channel with the third-party server, A and the server to establish a channel, B, and the server to establish a channel. As a result, both sides of the video fluency will be and third-party server channel bandwidth between the restrictions, when multiplayer video, the communication efficiency will be greatly limited. People want to have a third-party server without a point-to-point direct transmission of video data protocol, so with the WebRTC. WebRTC, an abbreviation derived from web real-time communication, is an API that supports web browsers for real-time voice conversations or video conversations. It was opened on June 1, 2011, and was included in the W3C Recommendation of the World Wide Web Consortium under the auspices of Google, the Mozilla Foundation, and Opera. WebRTC has the following components

  1. Video Engine (VideoEngine)
  2. Audio Engine (VoiceEngine)
  3. Conference Management
  4. iSAC: Audio compression
  5. VP8: Video codec for Google’s own WebM project
  6. APIs (Native C ++ API, Web API)

Explore WebRTC

WebRTC mainly implements three categories of interfaces:

  • MediaStream: Through the MediaStream API through the device’s camera and microphone to get video, audio synchronization stream
  • RTCPeerConnection: RTCPeerConnection is a component of WebRTC used to build stable and efficient streaming between point-to-point
  • RTCDataChannel: RTCDataChannel enables a high-throughput, low-latency channel between browsers (point-to-point) to transfer arbitrary data

These three types of interfaces are responsible for three main directions: – MediaStreamResponsible for obtaining the audio and video streams of the unit – RTCPeerConnectionresponsible for establishing an effective and stable point-to-point connection – RTCDataChannelresponsible for transmitting data

To create a WebRTC connection, you need to complete the above three steps, the following look at the specific implementation steps.

MediaStream

To access the native camera and microphone, you need to get the native MediaStream

var streamToAttach;
navigator.webkitGetUserMedia({ audio: true, video: true }, function (stream) {
video.src = webkitURL.createObjectURL(stream);
streamToAttach = stream;
}, function(error) {
alert(error);
});

Firefox interface name is different:

code code=”javascript”>
var streamToAttach;
navigator.mozGetUserMedia({ audio: true, video: true }, function (stream) {
video.mozSrcObject = stream;
video.play();
streamToAttach = stream;
}, function(error) {
alert(error);
});
</code>

PeerConnection

WebRTC uses the PeerConnection interface to create a point-to-point connection. Let’s start by creating a Peer

var peerConnection = new webkitRTCPeerConnection(
{ “iceServers”: [{ “url”: “stun:stun.l.google.com:19302” }] }
);

We can use Google’s STUN server: stun:stun.l.google.com:19302Firefox use mozRTCPeerConnectionand then set the peer object event handler:

peerConnection.onicecandidate = onicecandidate;
peerConnection.onaddstream = onaddstream;
peerConnection.addStream (streamToAttach);

As a video request originator, issue a video request:

<pre>

peerConnection.createOffer(function (sessionDescription) { peerConnection.setLocalDescription(sessionDescription);</p><pre><code>

}, function(error) { alert(error); }, { ‘mandatory’: { ‘OfferToReceiveAudio’: true, ‘OfferToReceiveVideo’: true } });

As a responder, you need to process the requestor’s SDP and send its own response to SDP:

peerConnection.setRemoteDescription(new RTCSessionDescription(offerSDP));

 Create a response SDP:

peerConnection.createAnswer(function (sessionDescription) { peerConnection.setLocalDescription(sessionDescription);

}, function(error) { alert(error); }, { ‘mandatory’: { ‘OfferToReceiveAudio’: true, ‘OfferToReceiveVideo’: true } });

After the requester receives the response SDP:

peerConnection.setRemoteDescription(new RTCSessionDescription(answerSDP));
&lt;/pre>&lt;/p>

&lt;p>&lt;p></code></p>

<h3>RTCDataChannel</h3>

<p>RTCDataChannel<code>DataChannel</code><code>PeerConnection</code> You can create a RTCDataChannel with the createDataCHannel method on the peer object</p>

<pre><code code=”javascript”>
channel = pc.createDataCHannel(“someLabel”);

DataChannel uses almost the same way as WebSocket, with several events:
  • onopen
  • onclose
  • onmessage
  • onerror

At the same time it has several states that can be obtained by readyState:

  • connecting: The browser is trying to create a channel
  • open: build success, you can use the send method to send data
  • closing: The browser is a closing channel
  • closed: the channel has been closed

Two exposed methods:

  • close(): used to close the channel
  • send (): used to send data to the other party via channel

run code

Since WebRTC will send a local address SDP to each other during the connection process, it can access the visitor’s IP by accessing the SDP:

&lt;html>
&lt;body>
Local description:
&lt;div id=”localdescription”>
&lt;/body>
&lt;/html

After the visit as shown in Figure:

red box that is the current network ip.

Reference: webrtc

SHARE
Share on FacebookShare on XShare on LinkedInShare on TelegramShare on BlueskyShare on Mastodon
Tags: WebRTC

Search

Translation

CVE ALERTS
📈

EPSS Spike Alerts
Catch risk spikes before they make headlines.

🎯

Custom EPSS/CVSS
Set score thresholds to effectively filter noise.

🛡️

Exploit Intel
Real-world exploit signals beyond the KEV catalog.

🐙

GitHub Issues
Auto-create alert tickets without duplication.

📬

Weekly Digest
Clean summaries, eliminating email spam.

🏷️

Watchlist Groups
Tag vulnerabilities by team (Infra/AppSec/SOC).

🔀

Smart Routing
Route chat channels based on severity levels.

🚨

RBP Tracker
Early warning detection and tracking system.

Subscribe – $7/mo or try free for 14 days →

🚨 Active Exploits in the Wild

  • CVE-2026-102255CVSS 10.0
    A Pre-authentication SSRF vulnerability exists in the SMA1000 Appliance Work Place interface due to an unintended alternate access...
    Admin intel📅 Updated: Oct 9, 2026
  • CVE-2026-105133CVSS 6.9
    A vulnerability was detected in Ahsay AhsayCBS up to 10.3.2. This affects the function checkSysPwd of the file...
    Admin intel📅 Updated: Oct 9, 2026
  • CVE-2023-22894CVSS 4.9
    Strapi through 4.5.5 allows attackers (with access to the admin panel) to discover sensitive user details by exploiting...
    CISA KEV📅 Added to KEV: Oct 8, 2026
  • CVE-2016-3081CVSS 8.1
    Apache Struts 2.3.19 to 2.3.20.2, 2.3.21 to 2.3.24.1, and 2.3.25 to 2.3.28, when Dynamic Method Invocation is enabled,...
    CISA KEV📅 Added to KEV: Oct 8, 2026
  • CVE-2015-3306CVSS 10.0
    The mod_copy module in ProFTPD 1.3.5 allows remote attackers to read and write to arbitrary files via the...
    CISA KEV📅 Added to KEV: Oct 8, 2026
  • CVE-2015-5477CVSS 7.5
    named in ISC BIND 9.x before 9.9.7-P2 and 9.10.x before 9.10.2-P3 allows remote attackers to cause a denial...
    CISA KEV📅 Added to KEV: Oct 8, 2026
  • CVE-2021-3199CVSS 9.8
    Directory traversal with remote code execution can occur in /upload in ONLYOFFICE Document Server before 5.6.3, when JWT...
    CISA KEV📅 Added to KEV: Oct 8, 2026
  • CVE-2026-94504CVSS 7.2
    Ninja Forms 3.15.3 stores an anonymous non-RTE textarea value and renders it without safe HTML encoding in the...
    Admin intel📅 Updated: Oct 7, 2026
Powered by CVE Watchtower

Critical Vulnerabilities

  • CVE-2026-96327CVSS 9.3
    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in VibeThemes WPLMS wplms_plugin allows...
    📅 Updated: Oct 9, 2026
  • CVE-2026-108261CVSS 9.3
    Tina is a headless content management system. Prior to tinacms 3.14.0 and @tinacms/app 2.5.14, the /~/* admin preview...
    📅 Updated: Oct 9, 2026
  • CVE-2026-108264CVSS 9.1
    Wizarr is an advanced user invitation and management system for Jellyfin, Plex, Emby, and other media servers. Prior...
    📅 Updated: Oct 9, 2026
  • CVE-2026-108263CVSS 9.9
    Astron Agent is an agentic workflow platform for building and running AI agents. Prior to 1.1.2, the default...
    📅 Updated: Oct 9, 2026
  • CVE-2026-108269CVSS 9.1
    Remote Attestation TLS Clients provides multi-language utilities for verifying attested TLS connections. Prior to 0.5.0, the Rust and...
    📅 Updated: Oct 9, 2026
  • CVE-2026-108268CVSS 9.1
    Enclave OS Virtual runs container workloads inside confidential virtual machines with end-to-end attestation. Prior to tdx-v0.2.43 and tdx-gpu-v0.6.27,...
    📅 Updated: Oct 9, 2026
  • CVE-2026-108267CVSS 9.1
    Privasys Go is a maintained fork of the Go programming language that adds RA-TLS support to crypto/tls. Prior...
    📅 Updated: Oct 9, 2026
  • CVE-2026-108266CVSS 9.1
    Privasys rustls is a maintained fork of the rustls TLS library that adds RA-TLS challenge and channel-binding support....
    📅 Updated: Oct 9, 2026
Powered by CVE Watchtower

Daily CyberSecurity

  • About SecurityOnline.info
  • Advertise with us
  • Announcement
  • Contact
  • Contributor Register
  • Login
  • Disclaimer
  • DCMA
  • Privacy Policy
  • About SecurityOnline.info
  • Advertise on SecurityOnline.info
  • Contact Us

When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works

  • CVE Watchtower
  • CVE Statistics by Vendor 2026
  • Q2 2026 Report
  • Top Exploited CVEs
  • Bluesky
  • Facebook
  • Linkedin
  • Mastodon
  • RSS
  • Twitter
  • Youtube
© 2017 - 2026 Daily CyberSecurity. All Rights Reserved.