All Projects → zadewg → GS-LOC

zadewg / GS-LOC

Licence: MIT License
Apple geolocation services reverse engineering. Database scraper.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to GS-LOC

AppleWifiNlpBackend
UnifiedNlp Backend that uses Apple's service to resolve wifi locations. Location calculation is done onboard and wifi locations are cached to minimize data usage.
Stars: ✭ 54 (+50%)
Mutual labels:  apple, geolocation
laravel-geoly
Perform fast and efficient radius searches on your Laravel Eloquent models.
Stars: ✭ 25 (-30.56%)
Mutual labels:  geolocation
SampleResearchKit
A sample app for Apple's ResearchKit
Stars: ✭ 14 (-61.11%)
Mutual labels:  apple
WacOS
A Linux distribution that mimics MacOS (modern and classic) iOS, and other Apple operating systems, but is open, customizable, and free to use on non-apple hardware.
Stars: ✭ 18 (-50%)
Mutual labels:  apple
decimation.github.io
Cydia repo
Stars: ✭ 18 (-50%)
Mutual labels:  apple
IchnaeaNlpBackend
Backend for UnifiedNlp that uses Mozilla Location Service for geolocation.
Stars: ✭ 68 (+88.89%)
Mutual labels:  geolocation
uvmac
µvMac - cleaned up fork of the Macintosh emulator Mini vMac
Stars: ✭ 28 (-22.22%)
Mutual labels:  apple
health kit reporter
A Flutter wrapper for the HealthKitReporter library
Stars: ✭ 16 (-55.56%)
Mutual labels:  apple
Clean-macOS
💻 A simple script to setup a clean environment on macOS
Stars: ✭ 155 (+330.56%)
Mutual labels:  apple
homekit-qrcode
Generate a pairing HomeKit QR code label for your HomeKit accessory from the command line
Stars: ✭ 17 (-52.78%)
Mutual labels:  apple
LocalSupport
A directory of local support services and volunteer opportunities
Stars: ✭ 60 (+66.67%)
Mutual labels:  geolocation
Sensors
A macOS application displaying the thermal, voltage and current sensor values.
Stars: ✭ 70 (+94.44%)
Mutual labels:  apple
Learning-Core-Audio-Swift-SampleCode
Swift sample code for the book, Learning Core Audio. The original sample code was written in C/Objective-C but I tried to make it in Swift version.
Stars: ✭ 114 (+216.67%)
Mutual labels:  apple
react-native-super-ellipse-mask
Apple flavored smooth corners for React Native
Stars: ✭ 55 (+52.78%)
Mutual labels:  apple
sign-in-with-apple-js-node-example
Sign in with Apple using Apple JS and REST API
Stars: ✭ 48 (+33.33%)
Mutual labels:  apple
LAPSforMac
Local Administrator Password Solution for Mac
Stars: ✭ 29 (-19.44%)
Mutual labels:  apple
punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (-30.56%)
Mutual labels:  apple
react-native-imaged-carousel-card
Fully customizable & Lovely Imaged Carousel Card for React Native
Stars: ✭ 70 (+94.44%)
Mutual labels:  apple
sign-in-with-apple
An example for sign-in-with-apple, golang-version.
Stars: ✭ 22 (-38.89%)
Mutual labels:  apple
react-native-bounceable
Animate and bounce any component with RNBounceable for React Native
Stars: ✭ 26 (-27.78%)
Mutual labels:  apple

GS-LOC

   ________  _________         .____    ________  _________    
  /  _____/ /   _____/         |    |   \_____  \ \_   ___ \   
 /   \  ___ \_____  \   ______ |    |    /   |   \/    \  \/   
 \    \_\  \/        \ /_____/ |    |___/    |    \     \____  
  \______  /_______  /         |_______ \_______  /\______  /  
         \/        \/                  \/       \/        \/   

 github.com/zadewg/GS-LOC/ :: Ofensive Intelligence Gathering
 Apple Geolocation Services RE. Database Scraper 

About wifi based geolocation

Wi-Fi positioning system (WPS) or WiPS/WFPS is a geolocation system that uses the characteristics of nearby Wi-Fi hotspots and other wireless access points to discover where a device is located. It is used where satellite navigation such as GPS is inadequate due to various causes including multipath and signal blockage indoors, or where acquiring a satellite fix would take too long.

The client queries a database which holds geographical coordinates related to Access Points with the APs it sees in range. This data is collected using wardriving techniques, or more recently by crowdsourcing it with the actual clients. Apple Inc, along with Google, hold the two largest databases of this kind.

GS-LOC Install and Usage

$ git clone https://github.com/zadewg/GS-LOC/
$ mv /GS-LOC/ /GSLOC/
$ cd /GSLOC/
$ pip install -r requirements.txt
$ echo "go find Wally!"

When querying the Database, it will respond with the location data from the 100 nearest access points.

python client.py b4:5d:50:8f:27:c1

BSID MAC: b4:5d:50:8f:27:c1
	Latitude: 59.43188593
	Longitude: 24.76144257
	Accuracy Radius: 50
	Altitude: 12
	Altitude Accuracy: 13
Channel: 1


BSID MAC: 1c:5f:2b:58:f5:ab
	Latitude: 59.43184859
	Longitude: 24.7617564
	Accuracy Radius: 45
	Altitude: 11
	Altitude Accuracy: 5
Channel: 13

[...]

The program will also generate a KML file which can be imported to Google Maps and other services.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<KML_File>
<Document>
	<Placemark>
		<description>1c:5f:2b:8b:79:48</description>
		<Point>
			<coordinates>59.43196212,24.75954368</coordinates>
		</Point>
	</Placemark>	
	<Placemark>
		<description>4c:72:b9:d:8:23</description>
		<Point>
			<coordinates>59.43155534,24.76144238</coordinates>
		</Point>
	</Placemark>
</Document>
</kml>
Google Earth KML Accuracy
POC Accuracy radius is narrower in denser urban areas due to a higher loss with distance in signal to noise ratio.

 

Importing GS-LOC

import GSLOC.client #Make sure the folder is named GSLOC, as python is not cool with hyphens.

MAC = "fc:52:8d:be:eb:5f"
DATA =  client.dbcall([MAC], 0 ,100, False, True) #[MAC list, Noise, Signal, Save Output, Generate KML] // DATA contains information on all nearby Access Points in a multidimensional array format. First element corresponds to the requested MAC.
print("Mac {} {}".format(MAC, "Latitude: {}, Longitude:{}".format(str(DATA[0][1]), str(DATA[0][2]))))

About Apple's Geolocation Services Reverse Engineering

Apple does not implement Certificate Pinning in the location service API, so it is trivial for an attacker to dinamically sign and intercept messages by manually trusting a CA on the client.

Two subdomains iphone-services.apple.com and gs-loc.apple.com respond to geolocation queries. The conversation utilizes Protocol Buffers and each request has a [header][message_size (16bit int)][message] format.

Header Format:

NUL SOH      /* 0x0001 start of header */
[length]     /* length of the locale string in bytes */
[locale]     /* en_US */
[length]     /* length of the identifier string in bytes */
[identifier] /* com.apple.locationd */
[length]     /* length of the version string in bytes
[version]    /* 8.4.1.12H321 ie. ios version and build */
NUL NUL      /* 0x0000 end of header */
NUL SOH      /* 0x0001 start of header */
NUL NUL      /* 0x0000 end of header */

Request message scheme:

message Request {
	message RequestWifi {
		optional string mac = 1;
	}
	repeated RequestWifi wifis = 2;
	optional int32 noise = 3 [default=0];
	optional int32 signal = 4 [default=100];
	optional string source = 5;
}

Response message scheme:

message Response {
	message ResponseWifi {
		message WifiLocation {
			optional int64 latitude = 1;             // X * pow(10, -8)
			optional int64 longitude = 2;            // X * pow(10, -8)
			optional int32 accuracy = 3;             // Radius (meters)
			optional int32 zeroField4 = 4;           // always 0 
			optional int32 altitude = 5;             // -500 if unknown
			optional int32 altitudeAccuracy = 6;     // Not set if altitude=-500
			optional int32 unknown11 = 11;           // [5,63]?
			optional int32 unknown12 = 12;           // [30,4000]?
		}
		optional string mac = 1;
		optional WifiLocation location = 2;
		optional int32 channel = 21;
	}
	repeated ResponseWifi wifis = 2;
}

 


This project is licensed under the MIT License - see the LICENSE file for details

mapez - telegram

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].