In this Null Byte, we are going to be installing Packet Injection capable drivers in Linux. These are the open-source drivers required to sniff wireless traffic, inject packets to crack a wireless access point, and go into "monitor-mode". These drivers are superior because they are the fastest available drivers.
I did this under Arch Linux, but I will assume most of you are using Ubuntu, or at least a variant of it. With that said, I'll be using Ubuntu's "apt-get" package manager, rather than the almighty "pacman" package manager that comes with Arch.
Step 1 Downloading & Installing Kernel Headers
To do these commands, you will need to open up a terminal window and enter them as typed.
First, we need to get the Linux kernel-headers installed. These will allow us to modify and add kernel modules (drivers) without actually messing with the kernel itself.
In Ubuntu, they should be installed by default, but just to make sure:
sudo apt-get install linux-headers-$(uname -r)
If that goes through, error free, proceed to the next step. If you get errors, make sure you're updated. In the terminal, type:
sudo apt-get update
Step 2 Downloading Compat-Wireless Driver Package & Patches
Compat-Wireless is a package that contains all the latest and greatest wireless drivers for Linux.
Make sure you have "wget" installed:
sudo apt-get install wget
Make sure you're in a directory that you want to have the package in. If you're like me, you're an organization freak when it comes to your directory structures! Use wget to download the compat-wireless package:
sudo wget http://www.orbit-lab.org/kernel/compat-wireless-2.6/2011/09/compat-wireless-2011-09-27-p.tar.bz2
Now, extract your archive after wget finishes downloading it:
sudo tar jxvf compat-wireless-2011-09-27-p.tar.bz2 && cd compat-wireless-2011-09-27
We need to download patches for fragment attacks and a fix for a glitch that caused your monitor interface to be stuck on "channel -1".
sudo wget http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch
sudo wget http://patches.aircrack-ng.org/channel-negative-one-maxim.patch
Step 3 Patching the Package
Now to actually run the patches on the compat-wireless package:
patch -p1 < mac80211.compat08082009.wl_frag+ack_v1.patch
patch -p1 < channel-negative-one-maxim.patch
Step 4 Selecting, Compiling & Installing Wireless Modules
The script below is to select which driver you want, because by default, compat-wireless will install all of the modules. If you don't know which chipset you have, you can omit this part or follow this guide at CyberCiti.
Now, onward to the compilation and installation:
sudo make && sudo make install
Unload your previous drivers:
sudo make wlunload
Load your wireless module:
sudo modprobe <driver-name-here>
If you don't know your driver name, don't worry. You can just reboot, and your computer will automatically load the appropriate drivers.
Most, if not all of these commands could've been executed in tandem. I wanted break it down for you so it was easier to understand. Also, this way if any issues occur, you can narrow it down to the specific command.
Put any questions you have in the Null Byte Forums!