Raspberry Pi Wardriving setup

Raspberry PI Wardriving setup

how to setup a Raspberry PI 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 3b (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. fast SD card
  7. 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 RaspberryPi 2 and 3 64 bit 2019.2a)

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

apt update / apt upgrade to make shure the base system is ok.

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

3.) Install Kismet

We want the latest and greatest, so we must use the kismet repositories :

wget -O - https://www.kismetwireless.net/repos/kismet-release.gpg.key | sudo apt-key add -
echo 'deb https://www.kismetwireless.net/repos/apt/release/kali kali main' | sudo tee /etc/apt/sources.list.d/kismet.list apt update apt install kismet

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:

apt install python-smbus
apt install i2c-tools
vi /etc/modules
#Paste on the end:
i2c-bcm2708
i2c-dev
rtc-ds1307

and here:

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

5.) Activate the RTC / GPS

for GPS we use GPSD:

apt install gpsd gpsd-clients

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! Python "GUI" for the WarPI

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

Run Python on boot with systemd

8.) Kismet config

make a kismet_site.conf, add the wifi´s and gpsd, and the bluetooth if wanted

gps=gpsd:host=localhost,port=2947
source=wlan1:name=adapter24ghz:type=linuxwifi,channels="1,2,3,4,5,6,7,8,9,10,11,12,13" 
source=wlan2:name=adapterdualband:type=linuxwifi,channels="1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,132,136,140,144,149,153,157,161"
source=hci1:name=bluetooth1:type=linuxbluetooth
source=hci0:name=bluetooth0:type=linuxbluetooth

track_device_seenby_views=false
track_device_phy_views=false
manuf_lookup=false
track_device_rrds=false
kis_log_packets=false
kis_log_messages=false

Warning, by dissabling the packet logging, the build in kismetdb_to_wigle tool breaks -> use this python instead: Devices to WiGLE.CSV

9.) profit!

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

Upload it to WiGLE and enjoy!

WiGLE

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, 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

e-max.it: your social media marketing partner
Hits: 1112

Comments powered by CComment