• About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
Skip to content
May 25, 2026
  • Linkedin
  • Twitter
  • Facebook
  • Youtube

Daily CyberSecurity

Zero-hour alerts. Unmatched analysis.

Primary Menu
  • Home
  • CVE Watchtower
  • Cyber Criminals
  • Data Leak
  • Linux
  • Malware
  • Vulnerability
  • Submit Press Release
  • Vulnerability Report
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

Ddos 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 this article:

Facebook Post LinkedIn Telegram

Related posts:

  1. Last Mile Reassembly Attacks Bypass Leading Secure Web Gateways
  2. DTLS “ClientHello” Race Condition: A New Threat to WebRTC Security
  3. Firefox Alert: Zero-Interaction Exploit in libvpx Allows Arbitrary Code Execution
  4. Fantasy Hub RAT MaaS Uncovered: Russian Spyware Uses Telegram Bot and WebRTC to Hijack Android Devices
  5. Exploit Code Publicly Released: Critical Firefox WebRTC Flaw Allows RCE (CVSS 9.8)
Tags: WebRTC

Search

Translation

CVE WATCHTOWER
🚨

Receive alerts for vulnerabilities being exploited in the wild.

⚑

Get notified instantly when a Proof of Concept (PoC) exploit is published.

πŸ”

Access critical info on vulnerabilities even when marked as "RESERVED".

🧠

Insights powered by decades of expertise and global intelligence sources.

🎯

Customize alerts with up to 10 keywords for your specific tech stack.

πŸ“Š

Export the raw CVE database for SIEM integration and reporting.

Upgrade Package

πŸ”΄ Live Critical Threats

  • CVE-2026-9458CVSS 9.8
    A vulnerability was identified in Totolink A8000RU 7.1cu.643_b20200521. The impacted element is...
  • CVE-2026-9457CVSS 9.8
    A vulnerability was determined in Totolink A8000RU 7.1cu.643_b20200521. The affected element is...
  • CVE-2026-9456CVSS 9.8
    A vulnerability was found in Totolink A8000RU 7.1cu.643_b20200521. Impacted is the function...
  • CVE-2026-9455CVSS 9.8
    A vulnerability has been found in Totolink A8000RU 7.1cu.643_b20200521. This issue affects...
  • CVE-2026-9454CVSS 9.8
    A flaw has been found in Totolink A8000RU 7.1cu.643_b20200521. This vulnerability affects...
  • CVE-2026-9436CVSS 9.8
    A flaw has been found in Totolink A8000RU 7.1cu.643_b20200521. The impacted element...
  • CVE-2026-9435CVSS 9.8
    A vulnerability was detected in Totolink A8000RU 7.1cu.643_b20200521. The affected element is...
  • CVE-2026-9434CVSS 9.8
    A security vulnerability has been detected in Totolink A8000RU 7.1cu.643_b20200521. Impacted is...
  • CVE-2026-9433CVSS 9.8
    A weakness has been identified in Totolink A8000RU 7.1cu.643_b20200521. This issue affects...
  • CVE-2026-2651CVSS 9.0
    A vulnerability in MLflow versions
Powered by CVE WATCHTOWER

Recent Zero-Day Vulnerabilities

  • Exploited in the Wild: Critical OWA Spoofing Flaw (CVE-2026-42897) Hits On-Premises Exchange Servers
  • Exploited in the Wild: Maximum CVSS 10 SD-WAN Flaw (CVE-2026-20182) Grants Admin Control
  • Exploited in the Wild: Critical 9.8 CVSS RCE Hits Canon GUARDIANWALL MailSuite
  • Exploit Code Released: Public PoC Dumps for Windows BitLocker Bypass and SYSTEM Elevation Zero-Days
  • Exploited in the Wild: “Dirty Frag” Linux Vulnerability Grants Instant Root Access
  • Under Active Attack: Ivanti EPMM Zero-Day Exploited in the Wild via Harvested Admin Credentials
Our Websites
  • Penetration Testing Tools
  • The Daily Information Technology
  • Daily CyberSecurity

    • About SecurityOnline.info
    • Advertise with us
    • Announcement
    • Contact
    • Contributor Register
    • Login
    • 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

    • Disclaimer
    • Privacy Policy
    • DMCA NOTICE
    • Linkedin
    • Twitter
    • Facebook
    • Youtube
    Copyright Daily CyberSecurity Β© All rights reserved.