How to set up and compile Aircrack-ng on a Raspberry Pi

The Aircrack-ng suite is a collection of useful tools aiding you in collecting wireless data and recovering wireless passwords. Perhaps it’s questionable to call it “password recovery”, since surely it’s easier logging into the wireless access point and read the password – but at least it has some legitimate uses.

I wanted to dump all of my wireless traffic in order to check how much data I was actually transmitting. In order to do this, I needed the following:
1. A device to store and process the data
2. A wireless network card

I chose to use my Raspberry Pi together with a USB WiFi card – and this is how I did it.

Step 1 – Install Raspbian

I’ve only used raspbian, so it’s no surprise I’ll suggest you to install it prior to trying this. I’m confident you can get this to work with any Debian-based distro, but don’t quote me on it.

Step 2 – Download the Source Code for Aircrack-ng

Connect to your Raspberry Pi via SSH or use a monitor and keyboard to access it. Then run the following command (you do need internet access):

wget http://download.aircrack-ng.org/aircrack-ng-1.1.tar.gz

Congratulations – you now have the source code. Go ahead and unpack it with the following:

tar -zxvf aircrack-ng-1.1.tar.gz

Enter the folder with:

cd aircrack-ng-1.1

All done? Good.

Step 3 – Getting the Dependencies.

If you try to compile the source right away, you’ll get something like…

crypto.h:12:26: fatal error: openssl/hmac.h: No such file or directory

… which means you need to get OpenSSL.

This takes care of that:

sudo apt-get install libssl-dev

Step 4 – Compiling the source

You should now have the required libraries and a functioning compiler already, but if in doubt go ahead and run:

sudo apt-get install build-essential

I’ve had issues with the default makefile, so let’s fix that real quick.

nano common.mak

Find the two lines starting with “CFLAGS” and remove “-Werror” from it. Werror makes all warnings into errors, which halts the progress. It works fine anyway. Press CTRL+O and then Enter to save. Then CTRL+X to exit.

Time to make:

make

And finally:

sudo make install

(Optionally you can run “sudo airodump-ng-oui-update” as prompted to update the OUI file).

All Done!

I won’t cover how the software works, but you should now have it set up and fully functioning. Compiling and installing code from source isn’t as hard as it might first seem.