Wardriving on a Raspberry Pi: Software Installation (Kismet, GPSD and Aircrack) - benjigifford/CAPSTONE-PROJECT-Benji-Gifford-Warskating GitHub Wiki
Warskating Software
https://www.busysignal.io/wigle-box-build-with-kismet-raspi-gps-wifi/
This build uses three main pieces of software:
- Kismet - Kismet is an open source sniffer, WIDS, wardriver, and packet capture tool for Wi-Fi, Bluetooth, BTLE, wireless thermometers, airplanes, power meters, Zigbee, and more. (kismetwireless.net
- GPSD - The Global Positioning Satellite Daemon is a computer software program that collects data from a Global Positioning System (GPS) receiver and provides the data via an Internet Protocol (IP) network to potentially multiple client applications in a server-client application architecture. Gpsd may be run as a daemon to operate transparently as a background task of the server. The network interface provides a standardized data format for multiple concurrent client applications, such as Kismet or GPS navigation software. (wikipedia.org)
- WiGLE - WiGLE (or Wireless Geographic Logging Engine) is a website for collecting information about the different wireless hotspots around the world. Users can register on the website and upload hotspot data like GPS coordinates, SSID, MAC address and the encryption type used on the hotspots discovered. In addition, cell tower data is uploaded and displayed.1(https://en.wikipedia.org/wiki/WiGLE#cite_note-1) (wikipedia.org)
Kismet and GPSD run on the device itself, while WiGLE is the site/utility that is used for plotting nodes on a presentable map.
This article documents the process that I went through with installing and configuring these applications.
Installing net-tools
- This is optional, I just thought it would be nice to do in case I wish to ssh into the device at a later point. This would make it easier to retrieve files for the WiGLE upload. (See https://www.linuxbabe.com/ubuntu/connect-to-wi-fi-from-terminal-on-ubuntu-18-04-19-04-with-wpa-supplicant)
sudo apt-get update
sudo apt-get upgrade
sudo apt install net-tools
sudo apt install wpasupplicant
wpa_passphrase <My roommate's SSID> <My roommate's WiFi Security Passcode> | sudo tee /etc/wpa_supplicant.conf
sudo wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0
sudo cp /lib/systemd/system/wpa_supplicant.service
ExecStart=/sbin/wpa_supplicant -u -s -c /etc/wpa_supplicant.conf -i wlan0
Restart=always
At this point in the setup, plug in the WiFi antenna and the GPS device. Mine connect via USB.
Installing GPSD
sudo apt update
sudo apt upgrade
sudo apt install gpsd gpsd-clients python-gps
ls /dev/ttyACM0
/dev/tty/ACM0 is the default path of USB devices on the Pi. To default GPSD to this path, you can edit the /etc/default/gpsd file and specify DEVICES="/dev/ttyACM0". Then, restart the gpsd service for the changes to take effect.
sudo nano /etc/default/gpsd
sudo gpsd /dev/ttyACM0 -F /var/run/gpsd.sock
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
sudo gpsd /dev/ttyACM0 -F /var/run/gpsd.sock
sudo usermod -a -G dialout $USER
gpsmon
gpsmon didnt like the aspect ratio I was using on my terminal. Just resize the window until those GPS logs start coming in!
Open the Kismet configuration file:
sudo nano /etc/kismet/kismet.conf
Modify the GPS configuration lines as follows:
gps=true
gps_device=/dev/ttyACM0
Installing Aircrack (for WiFi Recon)
- We will then be selecting the WiFi antenna and putting it into monitor mode
sudo apt update
sudo apt upgrade
sudo apt install aircrack-ng
sudo airmon-ng
This will list out all of the wifi cards attached to your RPi. I had two show up, as I have my WiFi antenna plugged in, but normally you would just see the built-in RPi carf on wlan0. We will now be putting the USB WiFi antenna into monitor mode.
sudo airmon-ng start wlan1
sudo airmon-ng
Now you can see that "wlan1" has been renamed to "wlan0mon", indicating that the antenna is now in monitor mode. Next, it's time to install Kismet!
Installing Kismet
Kismet is no longer a part of the Raspberry Pi repositories, which I discovered after trying to get it to install for about 30 hours. This process will show you how to defy Raspberry's rules and get Kismet working.
sudo apt update
sudo apt upgrade
wget -O - https://www.kismetwireless.net/repos/kismet-release.gpg.key | sudo apt-key add -
echo 'deb https://www.kismetwireless.net/repos/apt/release/buster buster main' | sudo tee /etc/apt/sources.list.d/kismet.list
sudo apt update
wget http://ftp.us.debian.org/debian/pool/main/p/protobuf/libprotobuf17_3.6.1.3-2_arm64.deb
sudo dpkg -i libprotobuf17_3.6.1.3-2_arm64.deb
sudo apt install kismet kismet-capture-linux-wifi
Running Kismet
The last step in the process is to take a shot at running Kismet. This was a bit difficult for me to do, but I discovered that your user must be in the kismet group to run Kismet.
sudo usermod -a -G kismet yourusername
Kismet requires a couple setup steps before you run it. I simplified this by writing a simple bash script kismet.sh:
sudo gpsd /dev/ttyAMC0 -F /var/run/gpsd.sock # sets GPS to run from the USB module
sudo airmon-ng # sets aircrack to monitor so it can start scanning
sudo airmon-ng start wlan1 # starts scanning on the WiFi antenna interface
sudo kismet # starts kismet with root privileges
After these steps, run the bash script and navigate to localhost:2501 in the Raspberry Pi's web browser. This is the Kismet web interface.
Go to the hamburger menu in the top left, and select Data Sources. Then activate wlan1 for 802.11 scanning, or the Bluetooth source to scan for more devices. I like to run both of them for maximum output.