Adapted from Matt Upham's Omegle IP Scraper: https://gist.github.com/mattupham/8db8da9662dca830ec81b43b30eb8a6d
Earliest version found by kaaaxcreators and released under GNU General Public License v3.0: https://github.com/kaaaxcreators/omegleip
Adapted from Matt Upham's Omegle IP Scraper: https://gist.github.com/mattupham/8db8da9662dca830ec81b43b30eb8a6d
Earliest version found by kaaaxcreators and released under GNU General Public License v3.0: https://github.com/kaaaxcreators/omegleip
// Userscript Extension: https://greasyfork.org/en/scripts/435913-webrtc-ip-tracker | |
// | |
// Steps: | |
// 1. Copy the below code | |
// 2. Go to https://www.omegle.com/ | |
// 3. Open the javascript console while on omegle.com | |
// Windows: shift+ctrl+j | |
// Mac: shift+cmd+j | |
// 4. Paste the below code and hit enter | |
// 5. Navigate to the video chat page | |
// 6. ??? | |
// 7. Profit | |
// | |
// NOTES: | |
// * You MUST open the js console from omegle.com. The js console only works | |
// for the page it was opened from. | |
// * If you enter the code while currently in a video chat, it won't show the | |
// IP info for that person. It only shows IP info for new connections, i.e. | |
// the next person you connect to. | |
// | |
// START COPYING FROM HERE... | |
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(" "); | |
console.log(iceCandidate.candidate); | |
const ip = fields[4]; | |
if (fields[7] === "srflx") { | |
getLocation(ip); | |
} | |
return pc.oaddIceCandidate(iceCandidate, ...rest); | |
}; | |
return pc; | |
}; | |
let getLocation = async (ip) => { | |
let url = `https://ipwhois.app/json/${ip}`; | |
console.log("...fetching", url); | |
await fetch(url, {referrer: ""}).then((response) => | |
response.json().then((json) => { | |
let header = `- ${ip} `.padEnd(20, "-"); | |
let localTime = (new Date()).toLocaleString([], {timeZone: json.timezone}) | |
let output = ` | |
${header} | |
Country: ${json.country} | |
Region: ${json.region} | |
City: ${json.city} | |
Coords: (${json.latitude}, ${json.longitude}) | |
Timezone: ${json.timezone} (${json.timezone_gmt}) | |
Time: ${localTime} | |
ISP: ${json.isp} | |
-------------------- | |
` | |
console.log(output); | |
}) | |
); | |
} | |
// ...TO HERE |
A simple bit of javascript that shows the IP address of any WebRTC connection (a direct connection between you and another person's computer).
shift
+ctrl
+j
shift
+cmd
+j
note you have to open the js console from omegle.com. the js console will only work for the page it was opened on
This will work on any website that creates a WebRTC connection (a direct connection between your computer and someone else's). Unfortunately, most websites do not implement this, so it won't work on most websites.
That said, you can install the Userscript extension which will alert you (only once per page) any time you're on a website that uses WebRTC and someone's IP information is available.
No. You only get the IP addresses of a device you connect to. That's why you can get the other person's IP address with this script--you're connecting directly to their deivce. Since, on most communication websites, the only device you connect to is the website's server, that's the only IP address you get--the website's IP address. To get other users' IP addresses on those websites would require hacking the website. Neither this script nor I will help you with that :P
No. This version uses ipwhois.io which requires no API key as long as you make 10,000 requests per month or fewer.
While I have your attention, I just want to point out two things:
Want this to load automatically on any page with a WebRTC connection? Install it as a userscript here. Requires having TamperMonkey installed first. If any website creates a WebRTC connection in the background, an alert will popup letting you know to check the JS console for the details (it will never create more than 1 alert per page).