Ubuntu8.10 : Aircrack-ng with RTL8187 (Alfa AWUS036H)

| 05 April 2009 | |
I got some friends asking for help on Ubuntu8.10 for the USB wifi RTL8187 setup. I give it a try, and it works well for both monitoring & injection. So lets start from a scratch of clean install of Ubuntu8.10 distro & remind that this issue have been covered in various sites including the Ubuntu forum and the Aircrack community. My working environment is under VMware Workstation 6.5.2beta with NAT connection. There is no difference with command between HDD installation or Vmware.

First step, update your Ubuntu8.10?
After we complete install Ubuntu8.10 under VMware, we need to update all important requirement for the aircrack-ng program to work well under Ubuntu8.10. Naturally, there will be an auto notification tells that some update is required at the top right of Ubuntu8.10 desktop or you may just navigate to System > Administration > Update Manager for the updates. There were about at least 301 updates for the first time installation of Ubuntu8.10, but the most important updates are gcc, the kernel-headers, module-assistant package and the associates. These processes may take some time depending on your speed of internet connection.

/

Second step, installing aircrack-ng?
All updates above should be properly installed as it is considered to be automatic process. I prefer to install the firmware/driver before attaching the USB wifi device physically. Again, for the smoothness of our installation process, lets change user to root. It can be done by command sudo -i. Now, we are ready to install aircrack-ng suites into Ubuntu8.10. Navigate to System > Administration > Synaptic Package Manager. Click on Search icon, key in aircrack and start searching. Click the apply icon when ready to install.

/

Third step, removing the old drivers?
With the root access, root@ubuntu:~#, lets remove the old firmware/driver that comes along with the kernel installed previously.

root@ubuntu:~# cd /lib/modules/2.6.27-7-generic/kernel/drivers/net/wireless/
root@ubuntu:/lib/modules/2.6.27-7-generic/kernel/drivers/net/wireless/# rm rtl8187.ko
root@ubuntu:/lib/modules/2.6.27-7-generic/kernel/drivers/net/wireless/# cd
root@ubuntu:~#

Another place to remove the old driver,

root@ubuntu:~# cd /lib/modules/2.6.27-7-generic/kernel/net/ieee80211/
root@ubuntu:/lib/modules/2.6.27-7-generic/kernel/net/ieee80211# rm ieee80211_crypt_wep.ko
root@ubuntu:/lib/modules/2.6.27-7-generic/kernel/net/ieee80211# rm ieee80211_crypt.ko
root@ubuntu:/lib/modules/2.6.27-7-generic/kernel/net/ieee80211# rm ieee80211_crypt_ccmp.ko
root@ubuntu:/lib/modules/2.6.27-7-generic/kernel/net/ieee80211# rm ieee80211_crypt_tkip.ko
root@ubuntu:/lib/modules/2.6.27-7-generic/kernel/net/ieee80211# rm ieee80211.ko

/

Fourth step, installing the new driver for RTL8187?
Up until here, I haven't attach the wireless card. Continue on our modification,

root@ubuntu:~# rmmod r8187 rtl8187 2>/dev/null
root@ubuntu:~# mkdir /usr/src/drivers
root@ubuntu:~# cd /usr/src/drivers
root@ubuntu:/usr/src/drivers# wget http://dl.aircrack-ng.org/drivers/rtl8187_linux_26.1010.zip
root@ubuntu:/usr/src/drivers# wget http://patches.aircrack-ng.org/rtl8187_2.6.27.patch
root@ubuntu:/usr/src/drivers# unzip rtl8187_linux_26.1010.zip
root@ubuntu:/usr/src/drivers# cp -v rtl8187_2.6.27.patch -t rtl8187_linux_26.1010.0622.2006
root@ubuntu:/usr/src/drivers# cd rtl8187_linux_26.1010.0622.2006/
root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006# tar xzf drv.tar.gz
root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006# tar xzf stack.tar.gz

After all adjustment above, we need to make some changes on r8187.h file. Lets hunt this file,

root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006# cd beta-8187/
root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006/beta-8187# gedit r8187.h

So that, some changes need to be done in lines 46 & 47,
Ogirinal lines on 46 & 47 are :
#include <asm/io.h>
#include <asm/semaphore.h>

We overwrite lines 46,47 to this :
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
#include <asm/io.h>
#include <asm/semaphore.h>
#else
#include <linux/io.h>
#include <linux/semaphore.h>
#endif

Original settings

/

Modified settings
/

Save it & we are ready to execute the compilation. Return to rtl8187_linux_26.1010.0622.2006 folder,

root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006# apt-get install patch
root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006# patch -Np1 -i rtl8187_2.6.27.patch
root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006# make
root@ubuntu:/usr/src/drivers/rtl8187_linux_26.1010.0622.2006# make install

Everything should works well without error. Restart your distro and connect your card (eg : Alfa AWUS036H) or any card with RTL8187 based chipset.

/

Diagram above show an example of cracked wireless under 2minutes with Alfa AWUS036H. All the command to use aircrack-ng program is exactly the same except the device had to be changed to wlan0 or wlan1 depending on what you saw on terminal with ifconfig -a. You may refer HERE.

Do you have tutorial for RTL8187 in Ubuntu9.04 ?
Yes, you may refer inside my forum, HERE. Register to forum to view content.

0 comments:

Post a Comment