Use Android Phone As GPS With Kismet

From Nearline Storage
Jump to navigation Jump to search

Installing

  1. Install "GPSd Client" app on the Android phone. It will be called "GPSd Forwarder" once it's installed.
  2. Install gpsd and kismet on the laptop.

Using

  1. If you will be mobile, turn off wifi on the phone and disconnect the laptop from any wifi network. Tether the laptop to the phone via USB and connect it to the internet via the phone. The goal is to use the phone for network connectivity so that the laptop wifi adapter can be used for scanning by kismet.
  2. Run the "GPSd Forwarder" app, specifying the IP of the laptop plus a random port number that you will tell gpsd to listen on ("9999" in this writeup.)
  3. Open the laptop's firewall so that gpsd can receive data from the phone app: sudo firewall-cmd --add-port 9999/udp
  4. Set OPTIONS="udp://*:9999" in the /etc/sysconfig/gpsd file. Use systemd to start gpsd.
  5. Use the gpsmon command to confirm that gpsd is receiving data from the GPS on the phone.
  6. Uncomment this line in /etc/kismet/kismet.conf:
    # gps=gpsd:host=localhost,port=2947 and start kismet: sudo kismet
    Note that this line will, in the future, cause kismet to automatically start gpsd via systemd if it is not already running. If the phone isn't connected as a GPS at that point, errors to that effect will be logged. There are no other ill effects.
  7. sudo kismet to collect the data.
  8. Use the kismetdb_to_kml utility to convert a Kismet db to a KML file for use with Google Earth or other GIS tools:
    sudo kismetdb_to_kml --in Kismet-20210116-21-57-38-1.kismet --out output.kml