Intro to mobile carrier lookup cell phone triangulation and location tracking

0 / 2151
Mobile phones have become an integral part of our lives. They even have surpassed, PC/laptop usage. This blog will talk about how we can lookup mobile phone carrier/service provider and use cell phone triangulation techniques to track its location.  

Cell phone triangulation

Cell phone triangulation is very much similar to geolocation tracking using GPS. Cell phone triangulation uses the signal and tower info to track down the location, against GPS, which works by lookup of IP/mac address of the device/modem/router. In triangulation, geolocation tracking is achieved by acquiring the below four variables pertaining to the cell phone to be tracked:-
LAC (Location area code):- area code of the cell tower location, the cell phone is active in (available to only who owns the phone)
CID (Cell ID):- A unique ID to identify the base station, the phone talks to. LAC and CID can be obtained from an app like netmonitor installed on the designated mobile phone to be tracked.  
MCC (Mobile country code):- A 3 digit decimal number used to identify the carrier/country  
MNC(Mobile network code):- 2 or 3 digit decimal number used to identify the carrier/country
Once you have the above four variables, you can calculate the approximate geolocation of a given cell phone at any given point of time. 
This is how, Big G (Google) is calculating your location even when your GPS location tracking is off in your cell phone.
Out of the above 4 parameters, MCC and MNC can be obtained remotely for any mobile, LAC and CID are known only to the mobile carrier and to the owner of the cell phone, but can be obtained by the police or higher authorities in case if there is some criminal investigation against the owner of the cell phone.
Someone using an IMSI catcher can also get an access to the LAC and CID, but it’s illegal to possess one if you are not authorized to do so.
In this blog, I will show you how to obtain the mobile operator name and the variables, viz. MCC, MNC, LAC & CID and hence location of the cell phone, programmatically.
There are heaps of third party services available to query mobile operator name, MCC and MNC. I will show you how to obtain these variables using Twilio API and later use them as input to another third party service (unwiredlabs) for triangulation.
You can signup for Twilio/Unwiredlabs using the below links
Twilio:- Signup
Unwiredlabs:- Signup
You will need nodejs installed on your machine for this. Download and install nodejs from here
Once node is installed, install twilio using the command npm install twilio, in the directory where your code for the cell phone triangulation resides.
After signing up with Twilio, use the below code to get MCC,MNC and mobile operator
 Run the above from command line using node <filename> to fetch all the info.
Signup with unwiredlabs and use the below code for obtaining the cell triangulation data
The above code will give approximate location of the cell phone you want to track. There is an error of about 1 km though. If you want more accurate location, then it’s advisable to pass the bssid (mac) array of all access points of the wifi that you are connected to.  
This array can be obtained from your wifi connection data using nodejs module node-wifiscanner
For below code to work, module, node-wifiscanner is to be installed using npm by the command npm install node-wifiscanner
Run the above from command line using node <filename> to fetch all the info.
Note that, the bssid array is optional, but will be helpful if you need more accuracy in location tracking.
Once you obtain the bssid array using the above code snippet, pass it to the unwiredlabs API as below
All the above code can be put together where all the node.js scripts can reside on the server and can be called from the client (browser) using Stay tuned for more hacks and interesting stuff.



An avid reader, responsible for generating creative content ideas for His interests include algorithms and programming languages. Blogging is a hobby and passion.