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 4 (or 3) (the Raspberry Pi zero does not have enough CPU / Memory, dont try it, i did)
- RTC hat
- OLED hat
- GPS Module (serial, not usb)
- WIFI USB Sticks, suitable for monitoring mode
- SD card for the operating system
- USB Stick for actual logfile
- Bluetooth dongle (optional)
Solder the GPS Module on the RTC hat:
And then stack everything together with the OLED.
Do not plug in the Wifi sticks now, first the software setup part.
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:
change the password:
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.
sudo vi /etc/modules #Paste on the end: i2c-bcm2708 i2c-dev rtc-ds1307
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:
6.) WIFI setup
To habe preditcable WLAN device numbers fix it to the USB ports:
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
Make the script start on boot with systemd (yes, not rc.local)
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.
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!
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.