NOTE: This article is for educational purposes only. This is a long explanation of Mobile Triangulation, you may scroll down to the end to see the actual codes and demo.
When your mobile phone is switched on, your cellular network provider knows your exact location. Some mobile phone still sends a signal to towers even when they are turned off.
Before you will start to build your own Mobile Number Locator, you must have extensive knowledge of how Mobile Phones, Operators, and Cell-sites operate to decide if you want to continue the implementation.
To save you some time, below are some useful terminologies to keep in mind; MCC, MNC IMSI, CID, and LAC.
Mobile country code or MCC and mobile network code or MNC are often used in combination to identify a phone number’s operator in the mobile telephone network.
- The combination of MCC and MNC is called HNI or Home Network Identity
- SIM card identifies with the mobile network using the IMSI, which is made up of the MCC + MNC + IMSI or International Mobile Subscriber Identity.
- Radio cells identify themselves with MCC+ MNC + Location Area Code + CellID
- A Cell ID CID) is a generally unique number used to identify each base transceiver station (BTS) or sector of a BTS within a location area code (LAC) .
- LAC or Location Area Code is given a unique number within the mobile network, the Location Area Code (LAC). This code is used as a unique reference for the location of a mobile subscriber.
There are many API that will return this information to your application upon providing a Mobile Phone number.
How to trace a person’s location using their mobile phone numbers, phone location, or what’s app.
Let’s see how Mobile Phone Triangulation works, how to trace a person’s location using their mobile phone numbers or what’s app.
Take a look at a cell tower below.
It is shaped like a triangle. This is why:
Each side of the triangle is called a sector. These sectors are labeled by the Greek letters alpha, beta, and gamma (a, ß, Y). Within each sector, the tower can see how far away a connected cell phone is. This allows it to “trace” the cell phone: by detecting which sector it is connected to, and how far away the cellphone is.
Above is a sample image of these sectors, with the cell phone tower in the center.
We can assume that our target is connected to sector gamma, and is in the number 4 range. Then we know that the cellphone is somewhere in the yellow marked area, see the below image:
What happens when a cell phone is connected to two towers?
When a cell phone is connected to 2 towers that overlap each other at the same time we can further increase our accuracy in tracing the phone.
For example, the cell phone is connected to the blue tower’s sector alpha and is at the 5’th band (5 miles) in distance, while it is also connected to the orange tower’s gamma sector and is in the 4’th band of distance (4 miles) of the orange tower, we can trace the cell phone really accurately by comparing the 2 results of the 2 towers, as shown below:
The Triangulation occurs when a 3rd tower is brought into action, we get what is called a “triangulation”. In this case, we can trace the cell phone accurately, as shown below:
Now, you can see, that the mobile phone is now within the red circle. If it moves to the left, it enters the green tower’s band 6. If it moves right, it enters the green tower’s band 4. If it moves down, it enters the green tower’s gamma sector and also enters band 4 of the blue tower.
When your mobile phone is switched on, your cellular network provider knows exactly where you are in the world.
Similar technology is used to track down lost aircraft and yachts through their radio beacons. It’s not identical, because most radio beacons use satellites while cell phones use land-based aerial arrays, however, the principle is similar.
Whenever your phone is switched on, whether you’re using it or not, it sends out a check signal (heartbeat/beacons) to cell towers periodically which identifies the location of the phone from the connected cell sites or towers.
Now, that we have a basic knowledge of how cell tower works, it’s possible to use an API to retrieve information about a mobile phone or device and connected cell ids, then compute the distances from those cell ids using the information returned by the API.
This may be accomplished by using the k-nearest neighbors algorithm and distance calculator.
Using the k-nearest neighbor algorithm to find the nearest neighbor of a point k (your phone number), then compute the distances between the nearest index (cell id/location) and the point k.
For example, let’s create a simple demo, using python to generate cell tower locations and find the nearest tower(s) from the cell phone location:
import numpy as np
def find_nearest_neighbors(p, points, k=1):
Find the k nearest neighbors of points and
return the indexes of nearest neighbor k
// Generate cell towers's sample locations or coordinates
CellTowerPositions = np.array([[4,1],[3,2],[2.07,1.3],[2,1.6],[3,3]])
// Generate a sample Mobile Phone's position
MobilePhonePosition = np.array([2.10,1.5])
Out: array([ 2.1, 1.5])
* Find the nearest Cell tower's location from the
* MobilePhonePosition using the generated coordinates (2.1, 1.5).
* and tower coordinates.
* change 1 to 2 for best 2 nearest location(s).
// The code: find a mobile phone position from the nearest pinged cell phone towers.
index = find_nearest_neighbors(MobilePhonePosition, CellTowerPositions, 1) // Compute closest cell phone tower's location to the mobile phone
Out: array([[ 2. , 1.6]])
//Print or display the Mobile Phone Position
Out: array([ 2.1, 1.5])
//Now, calculate distance between the nearest cell Tower and the mobile phone
distances = np.zeros(points.shape)
for i in range(len(distances)):
distances[i] = distance(p, points[i])
index = np.argsort(distances)
def distance(p1, p2):
"""find distance between two points"""
d = np.sqrt(np.sum(np.power(p2-p1,2)))
Also, you can also pass information MMC, MNC, LAC, ID, and API_KEY to an API that will return the Longitude and Latitude location of a Mobile Phone accurately.
Hope it helps.
NB: If you would like to watch Cybersecurity Videos, click Cyber Security Videos or read more about what is cybersecurity, to know how hackers hide their IP Addresses click How do the hackers hide their IP address while hacking?
If you have any questions, don’t forget to join the conversation in the comment section.
I hope this helps.
As the Editor-in-Chief, a Cybersecurity Professional and experienced software engineer, he writes tech news articles, and tutorials relating to software development, computer security, cybersecurity, and network security.
He takes great pride in delivering quality news to readers and looking forward to continuing to share the news that matters to the people of Las Vegas and beyond.