A payload for the Hak5 WiFi Pineapple Pager that lets you use your mobile phone as the Pager's GPS.
mobile2gps creates a bridge between your mobile phone's location data and the Pager's GPS system:
- Fake GPS Device: The server creates a pseudo-terminal (PTY) that acts as a fake serial GPS device
- gpsd Integration: The server starts
gpsd(GPS daemon) and points it to the fake GPS device - HTTPS Server: A web server runs on port 1993, serving a web page that uses the browser's Geolocation API
- Connectivity: Your mobile phone connects to the Pager's Management AP, allowing it to access the web server at
https://172.16.52.1:1993 - Data Conversion: Your mobile browser sends GPS coordinates to the web server, which converts them to NMEA GPRMC sentences
- GPS Feed: The NMEA sentences are written to the fake GPS device, which gpsd reads and makes available to the Pager's GPS system
- Download the payload (using
git clone, the ZIP, or a payload downloader on the Pager) - Build or download the
mobile2gpsserver binary and place it in the payload folder - Copy
payload.sh,mobile2gps(the binary), andindex.htmlto/mmc/root/payloads/user/general/mobile2gpson your Pager
Pre-compiled server binaries are available here.
It is not recommended to try building on the Pager.
This folder contains build scripts that automatically configure cross-compilation for the Pager's architecture (MIPS 24KEc soft-float).
Prerequisites: Go 1.21 or later must be installed on your computer.
- Install Go if you haven't already
- Open PowerShell in the project directory
- Run the build script:
.\build.ps1
- Install Go if you haven't already:
# Ubuntu/Debian sudo apt-get install golang-go # macOS (using Homebrew) brew install go # Or download from https://go.dev/dl/
- Build using the Makefile:
make build
Q: The connection between my phone and the Pager is unstable.
A: The Pager's Management AP does not have internet access (unless it is also connected to a network with Client Mode). Without internet access, your phone might switch to a different known network you are in range of. How you handle this problem will vary. iOS will pop-up a prompt to "Keep Trying Wi-Fi" to stay connected to the Management AP. You may want/need to delete the known network(s) to prevent switching.
If the Pager is in Client Mode (connected to a network, like your home Wi-Fi) while you are connected to the Management AP, going outside the range of the client network may also trigger your phone to try switching networks.
Q: mobile2gps reports a valid position but the Pager's GPS settings shows my position is 0, 0.
A: Try restarting the Pager and run mobile2gps again.
Q: Do I need to configure the Serial Device or Baud Rate on the Pager?
A: No, mobile2gps interacts directly with gpsd. These settings are ignored and have no effect.
- iphone-gpsd by Balint Seeber - https://spench.net/drupal/software/iphone-gps
- NoSleep.js by Rich Tibbett - https://github.com/richtr/NoSleep.js