Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
webrtc-ips — Demo: https://diafygi.github.io/webrtc-ips/ | Kitploit
도구/GitHubGitHub/diafygi/webrtc-ips
OSINT (Open Source Intelligence)Web SecurityPrivacyLearning & Education
GitHubdiafygi/webrtc-ips

webrtc-ips

Demo: https://diafygi.github.io/webrtc-ips/

저장소 보기
3.5k5882년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

WebRTC를 위한 STUN IP 주소 요청

데모: https://diafygi.github.io/webrtc-ips/

이 기능의 용도

Firefox와 Chrome은 사용자의 로컬 및 공용 IP 주소를 반환하는 STUN 서버 요청을 허용하는 WebRTC를 구현했습니다. 이러한 요청 결과는 javascript에서 사용할 수 있으므로 이제 javascript에서 사용자의 로컬 및 공용 IP 주소를 얻을 수 있습니다. 이 데모는 그 구현 예시입니다.

추가적으로, 이러한 STUN 요청은 일반적인 XMLHttpRequest 절차 외부에서 이루어지므로 개발자 콘솔에 표시되지 않으며 AdBlockPlus나 Ghostery와 같은 플러그인으로 차단할 수도 없습니다. 이는 광고주가 와일드카드 도메인으로 STUN 서버를 설정할 경우 이러한 유형의 요청을 온라인 추적에 사용할 수 있게 만듭니다.

코드

다음은 STUN 요청을 수행하는 주석이 달린 데모 함수입니다. 이를 Firefox 또는 Chrome 개발자 콘솔에 복사하여 붙여넣고 테스트를 실행할 수 있습니다.

root@kitploit:~
//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 useWebKit = !!window.webkitRTCPeerConnection;

    //bypass naive webrtc blocking using an iframe
    if(!RTCPeerConnection){
        //NOTE: you need to have an iframe in the page right above the script tag
        //
        //
        //<script>...getIPs called in here...
        //
        var win = iframe.contentWindow;
        RTCPeerConnection = win.RTCPeerConnection
            || win.mozRTCPeerConnection
            || win.webkitRTCPeerConnection;
        useWebKit = !!win.webkitRTCPeerConnection;
    }

    //minimal requirements for data connection
    var mediaConstraints = {
        optional: [{RtpDataChannels: true}]
    };

    var servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};

    //construct a new RTCPeerConnection
    var pc = new RTCPeerConnection(servers, mediaConstraints);

    function handleCandidate(candidate){
        //match just the IP address
        var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/
        var ip_addr = ip_regex.exec(candidate)[1];

        //remove duplicates
        if(ip_dups[ip_addr] === undefined)
            callback(ip_addr);

        ip_dups[ip_addr] = true;
    }

    //listen for candidate events
    pc.onicecandidate = function(ice){

        //skip non-candidate events
        if(ice.candidate)
            handleCandidate(ice.candidate.candidate);
    };

    //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(){});

    }, function(){});

    //wait for a while to let everything done
    setTimeout(function(){
        //read candidate info from local description
        var lines = pc.localDescription.sdp.split('\n');

        lines.forEach(function(line){
            if(line.indexOf('a=candidate:') === 0)
                handleCandidate(line);
        });
    }, 1000);
}

//Test: Print the IP addresses into the console
getIPs(function(ip){console.log(ip);});
도구 다운로드