Overview

To prepare for an upcoming Wifi Survey, I decided to configure a Wifi Pineapple to use Kismet and GPS as described in Hacking Exposed – Wireless. In addition to the book, there are quite a few articles and posts to make this happen, and overall it is a simple effort.

Configuration

  • WiFi Pineapple Mark V
  • Pineapple Juice 15000
  • GlobalSat BU-353-S4 USB GPS Receiver

Setup

While some people recommend using Kismet for GPS, I did not have success with that configuration and ended up running GPSD. Consequently, the default kistmet.conf file does not require substantial changes as it defaults to a GPS/GPSD configuration.

Daemonizing GPSD and specifying the ‘don’t wait for a client to connect before polling’ flag (-n). Note that a capital ‘N’ flag is used to run GPSD interactively and may assist with your device troubleshooting.

While I think that your GPS will most likely register as /dev/ttyUSB0, double-check the load.

Kismet is a client interface for the Pineapple, so ensure that you install AutoSSH and auto-enable it.

To get Kismet running, we need to do the following:

  1. ssh to Pineapple
  2. Install dependencies:
    1. opkg update
    2. opkg install gpsd
    3. opkg install kistmet_server
  3. Edit Kismet configuration (see Wardriving with WiFi Pineapple Mark V running Kismet)
    1. Modify log directory; logprefix=/sd/kismet/
  4. Run GPS service:
    1. gpsd -n /dev/ttyUSB0
  5. Initialize Antenna
    1. ifconfig wlan1 down
    2. iwconfig wlan1 mode monitor
  6. Run Kismet
    1. kismet_server

Kiswalk Startup/Shutdown Script

With your setup scripts in place, all that needs to be done is to SSH into the Pineapple, run ‘kiswalk.sh start’, go for a walk, SSH back in and run ‘kiswalk.sh stop’

#!/bin/bash

if [[ "$1" == "start" ]]
then
    echo "Starting Kismet..."

    # Initialize GPS device
    gpsd -n /dev/ttyUSB0

    # Put the second antenna in monitor mode
    ifconfig wlan1 down
    iwconfig wlan1 mode monitor

    # Start Kismet
    kismet_server --daemonize
elif [[ "$1" == "stop" ]]
then
    # Stop Kismet
    echo -e '\n!0 shutdown' | nc localhost 2501

    # Download the capture files
    tar cvzf /sd/kismet.tar.gz /sd/kismet/*
    scp /root/kismet.tar.gz root@172.16.42.239:/sd/kismet.tar.gz
else
    echo "kiswalk.sh [start/stop]"
fi

Script maintained on Github

References

Hak5 Forum: GPSD Problem

Hak5 Forum: Track Pineapple via GPS

Wardriving with WiFi Pineapple Mark V running Kismet