import React, { useState } from 'react'; import { X, Cpu, Layers, RefreshCw, AlertTriangle, CheckCircle2, ShieldCheck } from 'lucide-react'; interface WebRtcLiveProbeModalProps { isOpen: boolean; onClose: () => void; } export const WebRtcLiveProbeModal: React.FC = ({ isOpen, onClose, }) => { const [isProbing, setIsProbing] = useState(false); const [candidates, setCandidates] = useState>([]); const [errorNote, setErrorNote] = useState(null); if (!isOpen) return null; const startLiveStunProbe = async () => { setIsProbing(true); setCandidates([]); setErrorNote(null); try { // Create standard RTCPeerConnection with Google Public STUN const pc = new RTCPeerConnection({ iceServers: [ { urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun1.l.google.com:19302' }, ], }); // Create data channel to trigger ICE candidate gathering pc.createDataChannel('sentinel-ice-probe'); pc.onicecandidate = (event) => { if (event.candidate) { const cand = event.candidate; const parts = cand.candidate.split(' '); const ip = parts[4] || cand.address || 'unknown'; const port = parseInt(parts[5] || '0', 10); const type = parts[7] || cand.type || 'host'; const proto = parts[2] || cand.protocol || 'udp'; setCandidates((prev) => { if (prev.some((c) => c.address === ip && c.port === port)) return prev; return [...prev, { type, address: ip, port, proto }]; }); } }; const offer = await pc.createOffer(); await pc.setLocalDescription(offer); // Stop gathering after 3 seconds setTimeout(() => { pc.close(); setIsProbing(false); }, 3000); } catch (err: any) { setErrorNote(err.message || 'Browser WebRTC ICE gathering blocked or restricted.'); setIsProbing(false); } }; return (
{/* Header */}

WEBRTC ICE CANDIDATE / STUN INTERFACE PROBE

{/* Body */}
FORENSIC VECTOR:

Standard operating system VPN tunnels often fail to encapsulate peer-to-peer WebRTC UDP socket requests. A STUN server reflection forces the browser network stack to reveal its true physical interface IP.

Resolver: stun.l.google.com:19302
{/* Candidates Display */}
DISCOVERED ICE CANDIDATES ({candidates.length}) RFC 8445 / STUN
{candidates.length === 0 ? (
{isProbing ? 'Probing STUN servers for local and reflexive interfaces...' : 'Click "Start Live STUN Probe" to test client network interfaces.'}
) : (
{candidates.map((c, i) => (
{c.type.toUpperCase()} {c.address}:{c.port}
{c.proto.toUpperCase()}
))}
)}
{errorNote && (
{errorNote}
)}
{/* Footer */}
); };