|
发表于 2024-1-31 14:28:28
|
显示全部楼层
DNS泄露测试:
- GET请求100次 "https://" + new Date().getTime() + "-" + Math.floor(Math.random() * Number.MAX_SAFE_INTEGER) + ".leak.ping0.cc" , 权威dns服务器记录DNS请求来源IP,该来源IP可作为用户所在地区粗略参考
复制代码
IP 泄漏测试:
- let peer = new window.RTCPeerConnection({
- iceServers: [{
- urls: "stun:ping0.cc:3478",
- }]
- });
- peer.onicecandidate = (s) => {
- if (s.candidate) {
- const _ip = s.candidate.candidate.split(" ")[4];
- // 判断是否是有效IP
- if (_ip.indexOf("local") === -1 && !(_ip.substr(0, 3) === "10." || _ip.substr(0, 4) === "100." || _ip.substr(0, 4) === "127." || _ip.substr(0, 4) === "172." || _ip.substr(0, 4) === "192.")) {
- // 用户本地IP
- console.log("Local IP: ", _ip);
- }
- }
- };
- peer.createOffer({
- offerToReceiveAudio: true,
- }).then((o) => peer.setLocalDescription(o));
复制代码 |
|