查看: 25807|回复: 43

绕过代理获取访客真实IP

[复制链接]
发表于 2015-3-23 15:13:46 | 显示全部楼层 |阅读模式
FROM:http://zone.wooyun.org/content/18274

from:https://github.com/diafygi/webrtc-ips

Firefox 跟 Chrome支持WebRTC可以向STUN服务器请求,返回内外网IP,不同于XMLHttpRequest请求,STUN请求开发者工具当中看不到网络请求的。

演示链接

[AppleScript] 纯文本查看 复制代码
//get the IP addresses associated with an account
function getIPs(callback){
    var ip_dups = {};
 
    //compatibility for firefox and chrome
    var RTCPeerConnection = window.RTCPeerConnection
        || window.mozRTCPeerConnection
        || window.webkitRTCPeerConnection;
    var mediaConstraints = {
        optional: [{RtpDataChannels: true}]
    };
 
    //firefox already has a default stun server in about:config
    //    media.peerconnection.default_iceservers =
    //    [{"url": "stun:stun.services.mozilla.com"}]
    var servers = undefined;
 
    //add same stun server for chrome
    if(window.webkitRTCPeerConnection)
        servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};
 
    //construct a new RTCPeerConnection
    var pc = new RTCPeerConnection(servers, mediaConstraints);
 
    //listen for candidate events
    pc.onicecandidate = function(ice){
 
        //skip non-candidate events
        if(ice.candidate){
 
            //match just the IP address
            var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/
            var ip_addr = ip_regex.exec(ice.candidate.candidate)[1];
 
            //remove duplicates
            if(ip_dups[ip_addr] === undefined)
                callback(ip_addr);
 
            ip_dups[ip_addr] = true;
        }
    };
 
    //create a bogus data channel
    pc.createDataChannel("");
 
    //create an offer sdp
    pc.createOffer(function(result){
 
        //trigger the stun server request
        pc.setLocalDescription(result, function(){});
 
    }, function(){});
}
 
//Test: Print the IP addresses into the console
getIPs(function(ip){console.log(ip);});
回复

使用道具 举报

发表于 2015-3-24 21:38:35 | 显示全部楼层
感谢分享
回复 支持 反对

使用道具 举报

发表于 2015-3-26 16:34:18 | 显示全部楼层
哇哦,是之前鸡鸡说的 开了http代理跟没开一样。原来是这样, 虽然没怎么看懂,收藏 以后慢慢看,。
回复 支持 反对

使用道具 举报

发表于 2015-6-28 10:46:07 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2015-6-29 06:39:02 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2015-6-29 08:43:14 | 显示全部楼层
支持中国红客联盟(ihonker.org)
回复 支持 反对

使用道具 举报

发表于 2015-6-29 18:25:27 | 显示全部楼层
感谢楼主的分享~
回复 支持 反对

使用道具 举报

发表于 2015-7-2 21:21:02 | 显示全部楼层
支持中国红客联盟(ihonker.org)
回复 支持 反对

使用道具 举报

发表于 2015-7-4 04:07:02 | 显示全部楼层
支持,看起来不错呢!
回复 支持 反对

使用道具 举报

发表于 2015-7-7 15:18:20 | 显示全部楼层
感谢楼主的分享~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

指导单位

江苏省公安厅

江苏省通信管理局

浙江省台州刑侦支队

DEFCON GROUP 86025

旗下站点

邮箱系统

应急响应中心

红盟安全

联系我们

官方QQ群:112851260

官方邮箱:security#ihonker.org(#改成@)

官方核心成员

Archiver|手机版|小黑屋| ( 沪ICP备2021026908号 )

GMT+8, 2025-3-10 19:21 , Processed in 0.025956 second(s), 9 queries , Gzip On, MemCache On.

Powered by ihonker.com

Copyright © 2015-现在.

  • 返回顶部