Skip to main content

ALFA AWUS036H (rtl8187) and linux kernel 2.6.28 - the ultimate ALFA driver

Notice: This tutorial is not only intended for AWUS036H or rtl8187 users, as the mac80211 stack in 2.6.28 is very nice, this tutorial should be helpful/useful for anyone with a wireless card supported by the mac80211 stack.

Updates:
09/01/09 17:24CET: fixed a bug in "mac80211_2.6.28-rc8-wl_frag+ack_radiotap_2.6.28_mod.patch" please redownload (h t t p : / / astray.fragstore.net/apps/mac80211_2.6.28-rc8-wl_frag+ack_radiotap_2.6.28_mod.patch)

Hey,

it seems like the documentation about the Realtek 8187 chipset and aircrack-ng, as well as some of the
forum posts are a bit outdated - they usually cover the r8187 driver, old mac80211 and ndiswrapper things for WPA authentication.
I've been searching for a complete solution, which allows me to use the ALFA AWUS036H in monitor mode, packet injection, fragmentation
attacks, aswell as authenticating with my AP using WPA or WPA2 without driver switching and other hassles, without much success. (e.g. h t t p : / / forums.remote-exploit.org/showthread.php?t=15497)

So I asked in the aircrack-ng IRC chan about the problem and got an answer by hdm, who told me that the mac80211 implementation in the current 2.6.28 linux kernel is very good.

The outcome of compiling a new 2.6.28 kernel with the current aircrack-ng SVN patches and the aircrack-ng trunk was everything I wanted:
full compatibility to aircrack-ng
wpa_supplicant wpa/wpa2 authentication (without a hassle)
support of all aireplay-ng attack modes
about 500 packets per second injection rate
full iwconfig support including setting TX-Power
All this without driver switching, ndiswrapper scripts or anything.

To perhaps save you guys some time, here are the necessary steps to take after you've compiled/got the new 2.6.28 kernel
(h t t p : / / forums.remote-exploit.org/showpost.php?p=113187&postcount=1):

- have a 2.6.28 final kernel ready (h t t p : / / w w w . kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2), I won't cover how to compile the kernel, as there are several tutorials available (google for "slackware kernel compile"), basically you need to find the .config file of your current kernel, unzip the contents of the new kernel to /usr/src/linux-something/, copy the .config there, then "make oldconfig && make bzImage && make modules && make modules_install && cp arch/x86/bzImage /boot/vmlinuz", and editing your grub/LILO config should do the trick basically

- be sure the mac80211 module is activated in your kernel config

download the following patches:
h t t p : / / trac.aircrack-ng.org/export/1330/trunk/patches/rtl8187-mac80211-injection-speed-2.6.28-rc6.patch
h t t p : / / astray.fragstore.net/apps/mac80211_2.6.28-rc8-wl_frag+ack_radiotap_2.6.28_mod.patch
h t t p : / / astray.fragstore.net/apps/rtl8187-mac80211-pwr.patch

- copy the just downloaded patches to your kernel source folder (will be "/usr/src/linux/" from now on)
- cd /usr/src/linux/
- copy the following files to a safe place:
drivers/net/wireless/rtl818x/rtl8187_dev.c
include/net/ieee80211_radiotap.h
net/mac80211/tx.c
drivers/net/wireless/rtl8187_dev.c (not sure about this one)

Make a dry-run of all patches over your kernel sources:
patch -Np1 --dry-run -i mac80211_2.6.28-rc8-wl_frag+ack_radiotap_2.6.28_mod.patch
patch -Np1 --dry-run -i rtl8187-mac80211-injection-speed-2.6.28-rc6.patch
patch -Np1 --dry-run -i rtl8187-mac80211-pwr.patch

If everything goes without errors, remove "--dry-run" from the commands issued above to finally patch the sources.

Note:
"mac80211_2.6.28-rc8-wl_frag+ack_radiotap_2.6.28_mod.patch" is a modified version of the original 2.6.28-rc8 wl_frag+ack radiotap patch from aircrack SVN (h t t p : / / trac.aircrack-ng.org/browser/trunk/patches/mac80211_2.6.28-rc8-wl_frag%2Back_radiotap.patch), which results in a compiling error because of a duplicate line, in 2.6.28 final.

After patching the sources redo "make modules && make modules_install" and reboot the system.

Known issues:
PWR-tab in airodump-ng shows negative values for me (without the PWR patch it doesn't show any values in PWR-tab)
"airmon-ng start wlan0" and "ifconfig wlan0 up" take about 5 seconds to bring the interface up

Comments

Popular posts from this blog

Test New ALFA-AWUS036H v.2 (1.000mW) VS ALFA-AWUS036H v.1 (500mW)

- Recently emerged the New ALFA-AWUS036H v.2 (1.000mW), and these are the tests. TEST WITH NETSTUMBLER 1) usb da 100mW chipset railink 2) usb da 200mW chipset railink rt73 3) intel 2200 b/g con connettore esterno rp-sma 4) Alfa-AWUS036H 500mW 5) New Alfa-AWUS036H V2 da 1.000mW

Creating A Cheap Bluetooth Sniffer

Many papers and posts on internet forums have commented on the success of turning normal everyday bluetooth USB dongles ($10), into their more powerful counterparts that allow the capturing of packets from the airwaves. These more powerful USB dongles are usually sold at a much higher price ($10,000) together with the software to drive and control these devices. The problems associated with BlueTooth sniffing You cant simply just purchase the dongle with the alternate firmware. There is next to no real opensource packet capture program for the bluetooth protocol. Hardware & Limitations Chipsets: Whats the difference? The chipset of the Bluetooth USB Dongles are very important. Broadcom chipsets are cheap hardware and are deemed unsuitable devices for this paper. But unfortunalty nowadays, every manufacturer seems to prefer putting these chips in their products compared to the more reliable Cambridge Silicon Radio (CSR) chipset. If your lucky enough to find a dongle with a CSR chips...

ALFA-­AWUS036H & ALFA-­AWUS050NH INSTALLING/UPDATING DRIVERS RTL8187, r8187, RT2800usb on UBUNTU

NOTE: For surfing Internet with ALFA-AWUS050NH on Ubuntu Jaunty with rt2870sta driver, you must use the Kernel "2.6.28-11-generic #42-Ubuntu", without change or updates the drivers modules. NOTE: The tutorial is not related to Ubuntu karmic. Driver RTL8187/Stacks-­mac80211 (ref. ALFA-­AWUS036h) ­- These drivers, for surfing Internet, are more stable than r8187, and fully compatible with Network-Manager 0.7 installed by default on Ubuntu 9.04. Network-Manager 0.7 installed by default on Ubuntu 9.04. ­- Supports all encryption without problems. (OPEN, WEP and WPA/WPA2) ­- With Compat-Wireless, the "injection" working, but for support “Fragmentation attack” (opt. -5) you need to install one patch. - The RX sensitivity and packets injection is less, related to drivers r8187. Driver r8187/Stacks-ieee80211 (ref. ALFA-AWUS036h) - This driver is recommended for use with the Suite of Aircrack-ng, but not particularly suitable for Internet connections, as less stable and disc...