From charlesreid1

Outfitting a Snailcase with wifi gear and a Raspberry Pi.

The intention here is to create a platform that's more sophisticated than just running Kismet on the phone and seeing what wifi networks are in what location. The intention here is to create a more robust data-gathering platform that can be outfitted with more sensors: larger wifi antennas, spectrum analyzers, drives, batteries, etc.

The Setup: Prototype 1

To set up the wifi snailcase for prototype 1, my plans were to implement the following (very simple) gear setup:

  • Raspberry Pi with USB wifi antenna
  • Portable battery pack to power the Raspberry Pi

These were mounted inside of a Pelican case. The intention was to run a wifi monitoring program - replicating a simple setup like Kismet. Remember, for the first phase, the motto is always KISS.

Raspberry Pi Preparation

I utilized an older Raspberry Pi model B+ that I had for this project. Here is the rundown of commands I used and steps I took to prepare the Pi for this project.

Installing Raspbian OS

First, I did not want to use the Kali Raspberry Pi image, as it has a long history of weird issues that take hours to troubleshoot. I went with Raspbian.

Insert the SD card, use diskutil or fdisk to find it, and overwrite the disk with the image file using dd (careful! don't just copy and paste!):

sudo dd bs=1m if=2016-05-27-raspbian-jessie.img of=/dev/disk1

That'll take about 45 minutes. Once that's finished, you can keep the SD card inserted in your laptop, and modify the boot partition, specifically the file cmdline.txt, and add the following text to the end: ip=169.254.247.111 (the last two numbers are completely arbitrary). This will hard-code the Pi's IP address, and will allow you to directly plug your laptop into the Pi to SSH in (using a crossover cable, which is just a normal networking cable) to make sure everything is working, and configure the Wifi.

Once that's finished, SSH in:

$ ssh pi@169.254.247.111

Follow the steps on the Linux/Wireless page (modifying /etc/wpa_supplicant/wpa_supplicant.conf and /etc/network/interfaces) to hard-code wifi credentials into the Pi and allow it to connect to wifi.

Now your Raspberry Pi is ready to connect itself to wifi when it is turned on.

Insert a wifi adapter into the Pi, turn everything off, and turn everything back on. The Pi should not need the crossover cable anymore. Wait for it to join the network. Use nmap to find it if you need to.

Prepare OS

Once you can connect to the Pi over the local network, check it is connected to the internet:

$ ping linux.org

Follow the steps on the Raspberry Pi post-install page: Kali_Raspberry_Pi/Post-Install

$ sudo apt-get -y update
$ sudo apt-get -y dist-upgrade

Pack a lunch. It'll take a while.

Install Software

Now, to install the software we need. Here's a list:

  • Macchanger: apt-get install macchanger
  • Aircrack: apt-get install aircrack-ng

...that's it for now, folks. KISS.

Boot Script (Problems)

Add the location of the following script to the contents of the file /etc/rc.local:

#!/bin/sh

ifconfig wlan0 down
iwconfig wlan0 mode monitor
macchanger -r wlan0
ifconfig wlan0 up

sleep 5s

mkdir -p ~/box/08-19_besside/
cd ~/box/08-19_besside/
besside-ng -W wlan0

Remember to chmod +x and put it somewhere like ~/scripts.

Reboot to Test

Now you can reboot to test it out. You should see wlan0 in monitor mode, and if you run ps aux | grep besside you should see the process running.

$ ps aux | grep besside
root       598  4.3  1.1   6808  5024 ?        D    06:41   0:06 besside-ng -W wlan0

Prototype 1 Attempt (Failure)

First attempt with the wifi snailcase: I parked somewhere and let it run, but things did not go smoothly. Zero results. Please try again.

I'm pretty sure besside-ng was running - the Pi and the wifi card were both hot. But for some reason it just didn't find anything. Need to take my laptop along so I can ssh in and check on how things are progressing.

Flags