Raspberry PI Wardriving setup

how to setup a Raspberry PI 4 or 3b to collect Wifi information. This is commonly called Wardriving (Wikipedia)

Raspberry Pi Wardriving

The RPI will run Kismet to collect all surrounding Wifi networks. This then can be uploaded to WiGLE to map all the WIFI´s!

Hardware

  1. Raspberry Pi 4 (or 3) (the Raspberry Pi zero does not have enough CPU / Memory, dont try it, i did)
  2. RTC hat
  3. OLED hat
  4. GPS Module (serial, not usb)
  5. WIFI USB Sticks, suitable for monitoring mode
  6. SD card for the operating system, like the Samsung Pro Endurance
  7. USB Stick for actual logfile
  8. Bluetooth dongle (optional)

Solder the GPS Module on the RTC hat:

Raspberry Pi with RTC and GPS

And then stack everything together with the OLED.

Do not plug in the Wifi sticks now, first the software setup part.

Software

I use the 64 Bit Kali image, Kali will make later steps much easier, 64 Bit this gives some extra headache with the adafruit python libs, but later more.

This guide requires some basic knowhow on how to use the bash, its not fully copy/paste here!

1.) Kali Image

Download the 64 Bit Kali image: 64 Bit Kali image (as the time of writing it is the Kali Linux Raspberry Pi 2 (v1.2), 3, 4 and 400 (64-Bit) 2021.1

Burn it with Etcher to the SD card.

Boot your RPI with it, connected over HDMI and with a USB Keyboard and Mouse attached to it.

2.) First setup steps

Adjust the keyboard layout: dpkg-reconfigure keyboard-configuration

change the password: passwd

Enter your WIFI data or connect the RPI over ethernet to the internet

Download this bash script here and run it, it will download the needed items: warpi_setup.sh

Enable swap, i use 1024mb to ensure the system will not freeze: Kali Raspberry Pi Swap setup

3.) Install Kismet

Kismet is the latest in Kali, so normaly its not needed to change something.

This can be read here: Kismet Repositories

4.) Activate I2C / UART

raspi-config will not work on Kali for that, so it has to be done by hand.

I2C/UART Tools:

sudo vi /etc/modules
#Paste on the end:
i2c-bcm2708
i2c-dev
rtc-ds1307

and here:

sudo vi /boot/config.txt 
#Paste 
dtparam=i2c1=on
dtparam=i2c_arm=on
enable_uart=1
dtoverlay=i2c-rtc,ds3231 

and modify here:

sudo vi /boot/commandline.txt 
#remove all serial parts
dwc_otg.fiq_fix_enable=2 root=PARTUUID=ed889dad-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait net.ifnames=0

5.) Activate the RTC / GPS

for GPS GPSD is used.

the RTC has to be set once:

hwclock -w

6.) WIFI setup

To habe preditcable WLAN device numbers fix it to the USB ports:

Set WLAN device number to USB port

Depending on your used hardware for the WIFI, it could need drivers:

apt install realtek-rtl88xxau-dkms

7.) the OLED script to boot and 64 bit hacks

This script is wildly copy pasted around and it works, adopt to your needs! Github: Python "GUI" for the WarPI

Find arial.ttf and Minecraftia.ttf with your favorite search engine and place them in /home/kali/.

Make the script start on boot with systemd (yes, not rc.local)

Run Python on boot with systemd

8.) Kismet config

copy the kismet_site.conf, modify the wlan and bluetooth sources.

It is configured to directly write the wiglecsv by using most from the kismet_wardrive.conf

More on the wardriving mode in kismet: Kismet Wardriving

9.) mount the USB stick

mount it with fstab so its always there: https://pimylifeup.com/raspberry-pi-mount-usb-drive/

The python script expects the usb drive under: /media/usb/  with a kismet folder there.

10.) profit!

use the device, when it shutdown´s it will convert the *.kismet files to CSV on the USB Stick.

Upload it to WiGLE and enjoy!

WiGLE

11.) Updating

after a while it might be good to update the software.

The first is to update the operating system, for this: How to Update Kali Linux

Second is the gui script, get the latest requirements.txt and warpigui.py from github and update:

sudo pip3 install --upgrade -r requirements.txt

Last:

A word about the needed CPU / Memory, i first tried this with a Raspberry Pi Zero W, there is no way to run more than 2000 devices stable, the memory is not enough. And the CPU will be stuck to 100% nearly all the time resulting in many missed networks. Yes, i overclocked it, did not help, just corrupted me some sd cards.

Raspberry Pi zero W on the limit

Comments powered by CComment