Difference between revisions of "Use Android Phone As GPS With Kismet"

From Nearline Storage
Jump to navigation Jump to search
(Created page with "==Installing== #Install "[https://play.google.com/store/apps/details?id=io.github.tiagoshibata.gpsdclient&hl=en_US GPSd Client]" app on the Android phone. It will be called "...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
#Install gpsd and kismet on the laptop.
 
#Install gpsd and kismet on the laptop.
 
==Using==
 
==Using==
#If you will be mobile, then turn off the wifi on the phone, turn on its mobile hotspot, and connect the laptop to the hotspot before doing the rest of this.
+
#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.
#Run the "GPSd Forwarder" app, specifying the IP of your laptop plus the random port number that you will tell gpsd to listen on.
+
#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.)
#Start gpsd with <code>sudo gpsd -N udp://*:NNNN</code> with "NNNN" being the port number from the previous step.<br />You can make this permanent by setting <code>OPTIONS="udp://*:NNNN"</code> in the /etc/sysconfig/gpsd file.  Then you can use systemd to start/stop gpsd.
+
#Open the laptop's firewall so that gpsd can receive data from the phone app: <code>sudo firewall-cmd --add-port 9999/udp</code>
#Use the <code>gpsmon</code> command to confirm that gpsd is receiving data from the phone.
+
#Set <code>OPTIONS="udp://*:9999"</code> in the /etc/sysconfig/gpsd file.  Use systemd to start gpsd.
#Uncomment this line in /etc/kismet/kismet.conf: <br /><code># gps=gpsd:host=localhost,port=2947</code> and start kismet: <code>sudo kismet</code><br />Note that this line will cause kismet to automatically start gpsd via systemd if it is not running.
+
#Use the <code>gpsmon</code> command to confirm that gpsd is receiving data from the GPS on the phone.
 +
#Uncomment this line in /etc/kismet/kismet.conf: <br /><code># gps=gpsd:host=localhost,port=2947</code> and start kismet: <code>sudo kismet</code><br />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.
 +
#<code>sudo kismet</code> to collect the data.
 +
#Use the kismetdb_to_kml utility to convert a Kismet db to a KML file for use with Google Earth or other GIS tools:<br /><code>sudo kismetdb_to_kml --in Kismet-20210116-21-57-38-1.kismet --out output.kml</code><br />Kismet logs are SQLite3 database files.  See https://kismetwireless.net/docs/devel/kismetdb/

Latest revision as of 22:39, 16 January 2021

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
    Kismet logs are SQLite3 database files. See https://kismetwireless.net/docs/devel/kismetdb/