Using bettercap for wifi wardriving using Raspberry pi



Wardriving is collecting access point information while you move on a car, bike or walking. Bettercap is a framework for network monitoring and attacks. In this tutorial we will use a raspberry pi with an external battery to execute a bettercap caplet called airodump. Bettercap is the The Swiss Army knife for 802.11, BLE and Ethernet networks reconnaissance and MITM attacks. In this tutorial we are going to use bttercap for wardriving using a raspberry pi.

Using a external battery charger you can have a raspberry pi with an Alfa USB wifi working for hours, we recommend to use the TP-Link 10400mAh since it has a 2a output.

Raspberry pi running bettercap with alfa USB and tp link exteral battery

Step 1: Install bettercap

First we need to have golang working on the raspberrypi:

sudo apt update
sudo apt install wget
wget https://dl.google.com/go/go1.11.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.11.linux-armv6l.tar.gz

Then open .bashrc and add to the PATH environment variable the go binary and the downloaded go apps binary path:

export PATH=$PATH:/usr/local/go/bin:$GOME/go/bin

We need to install golang dep, which manages go dependencies and it is required by bettercap:

go get -d -u github.com/golang/dep
cd $(go env GOPATH)/src/github.com/golang/dep
DEP_LATEST=$(git describe --abbrev=0 --tags)
git checkout $DEP_LATEST
go install -ldflags="-X main.version=$DEP_LATEST" ./cmd/dep
git checkout master

make sure dep command is available on your terminal. Now we can install bettercap from source code:

go get github.com/bettercap/bettercap
cd $GOPATH/src/github.com/bettercap/bettercap
make && sudo make install

Everything should be installed. In the next step we are going to introduce the concept of caplets and start to do some tests

Step 2: Bettercap caplets on the raspberry pi

Now we are going to install bettercap caplets:

git clone https://github.com/bettercap/caplets.git
cd caplets
sudo make install

Once done you can start airodump caplet with:

sudo ./bettercap -caplet airodump.cap -iface wlan0

Check other caplets like wpa_handshake.cap