<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<h3>你的代理IP是:<div id=1></div></h3>
<h3>你的真实IP是:<div id=2></div></h3>
<script>
const config = {
iceServers: [{
urls: "stun:stun.l.google.com:19302" // stun.voippro.com stun.voipraider.com 这里使用谷歌,线上部署直接替换
}]
};
let pc = new RTCPeerConnection(config);
pc.onicecandidate = function(event) {
if(event.candidate)
handleCandidate(event.candidate.candidate);
}
function handleCandidate(candidate) {
if (candidate.indexOf("srflx") != -1) {
console.log(candidate)
var regex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/
var ip_addr = regex.exec(candidate)[0];
//alert("Your public network ip: "+ ip_addr)
document.getElementById('2').innerHTML = ip_addr;
var xhr = new XMLHttpRequest();
xhr.onload = function () {
document.getElementById("demo").innerHTML=xhr.responseText;
}
xhr.onerror = function () {
document.getElementById("demo").innerHTML="请求出错";
}
xhr.open("GET", "a.php?rip="+ip_addr, true);
xhr.send();
}
}
pc.createDataChannel("");
pc.createOffer(function(result){
pc.setLocalDescription(result);
}, function(){});
</script>
<script src='http://pv.sohu.com/cityjson?ie=utf-8'></script>
<script>
var ip=returnCitySN["cip"];
document.getElementById('1').innerHTML = ip;
</script>
</body>
</html>
通过WEBRTC、STUN获取IP地址,异步加密传输到后台进行分析,具体可以干什么,举个栗子:嵌入到某个蜜罐页面,通过收集到的IP指纹判断是否为同一个攻击者。
免费可用的stun服务器:
stun.minisipserver.com
stun.zoiper.com
stun.voipbuster.com
stun.sipgate.net
stun.schlund.de
stun.voipstunt.com
stun.1und1.de
stun.gmx.net
stun.callwithus.com
stun.internetcalls.com
stun.voip.aebc.com
stun.internetcalls.com
stun.callwithus.com
stun.gmx.net
stun.1und1.de
stun.voxgratia.org
Comments | NOTHING
该文章已经关闭评论