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

From Nearline Storage
Jump to navigation Jump to search
m
m
Line 4: Line 4:
 
==Using==
 
==Using==
 
#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.
 
#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 the laptop plus a random port number that you will tell gpsd to listen on ("NNNN" in this writeup.)
+
#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.)
#Open the laptop's firewall so that gpsd can receive data from the phone app: <code>sudo firewall-cmd --add-port NNNN/udp</code>
+
#Open the laptop's firewall so that gpsd can receive data from the phone app: <code>sudo firewall-cmd --add-port 9999/udp</code>
#Set <code>OPTIONS="udp://*:NNNN"</code> in the /etc/sysconfig/gpsd file.  Use systemd to start gpsd.
+
#Set <code>OPTIONS="udp://*:9999"</code> in the /etc/sysconfig/gpsd file.  Use systemd to start gpsd.
 
#Use the <code>gpsmon</code> command to confirm that gpsd is receiving data from the GPS on the phone.
 
#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.
 
#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.
 
#<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>
 
#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>

Revision as of 22:33, 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