Introduction
geoloc is a command which helps utilise information that Google maintains about the physical locations of WiFi access points.
It has functions for interrogating the Google location services and for building HTML and JavaScript that can be used to plot the returned
information on a map.
For some background, refer to: http://orwelliantremors.blogspot.com/2010/12/mobile-80211-parole-bracelet-for-man-in.html
Installation
These instructions assume you have a Unix like command line environment with bash, git, python and curl (with SSL libraries installed).
-
Clone the github repository
-
# if you chose another location, override with export GEOLOC_HOME=... in your .bashrc
git clone git://github.com/jonseymour/geoloc.git ~/.geoloc
- Add geoloc to your path
-
sudo ln -sf ~/.geoloc/bin/geoloc.sh /usr/local/bin/geoloc
Usage
Show the location of a MAC address
This command will retrieve the location details for a mac address from Google and display the formatted json document.
geoloc locate 002568CC80EB | geoloc format_json
Show the location of a MAC address on map
This command will retrieve the location details for a mac address from Google and display the location on a map.
geoloc show 02568CC80EB
Create a new map
This command will create a new, empty map.
geoloc map create mymap
Add a mac address to a map
This command will add a new mac address to the map.
geoloc map add mymap 002568CC80EB
Import a kismet CSV file into the map
This command will import a kismet CSV file. The file should have fields delimited by semicolons, the mac address should be in column 4, the SSID in column 3.
One way to make these files is to run aircrack-ng(1).
geoloc map import-kismet mymap < some-file.kismet.csv
Build the map HTML
This command will generate the HTML (and Javascript) for a mostly static copy of the map (you still need live access to Google Maps!).
geoloc map build mymap
Open the map
This command will open the map in a browser (assuming you have xdg-open installed).
geoloc map open mymap
Tweak the script
Don't like how it works? You can edit the script yourself.
geoloc edit
File System Structure
- bin/
- contains the geoloc.sh command
- js/
- contains the JavaScript library used to render the map
- html/
- contains the HTML template used for building new maps
- db/mac_addresses
- contains one subdirectory for each mac address
- db/mac_address/{mac}/
- contains JSON documents describing a MAC address
- db/mac_address/{mac}/current
- contains the JSON document for the named mac address
- db/maps
- contains one directory for each map
- db/maps/{map}/index.html
- contains the html for a Google Map. Created by map create {map}.
- db/maps/{map}/generator.js
- contains the compiled data for the map. Created by map build {map}.
- db/maps/{map}/zoom
- Contains the map zoom value. Created by map create {map}.
- db/maps/{map}/center
- Contains a symbolic link to the mac address to be used for the center of the map. Usually FFFFFFFFFFFF - the local center
- db/maps/{map}/mac_addresses/{mac}
- Contains one symbolic link for each address to appear on the map
TODO
Features I might add if I get the time:
- a web front end
- support for refreshing the cache
- improved user experience for the generated maps