User Tools

Site Tools


zd1211rw

This is an old revision of the document!


zd1211rw

This driver supports the zd1211 and the newer zd1211b chipsets by Zydas.

The older zd1211 chipset only partially supports injection. Any injection which requires the device to receive a packet does not work correctly. So the fake authentication, chopchop, and fragmentation attacks plus injection testing do not work. Other basic functions such as monitor mode and the remaining attacks work.

The new zd1211b chipset fully supports all functions.

The zd1211rw driver has been incorporated into the latest kernels. So you will have to patch the kernel source to obtain injection support. This is described below in detail.

The following links may be helpful to you to learn more about the driver and which devices are supported by it:

Patching zd1211rw

This section will describe how to patch your driver for injection. There is quite a bit of variation between distributions so this describe the general steps you must take. You will have to tweak the instructions for your specific distribution and kernel version. It assumes a reasonable level of unix knowledge and experience. If you don't have this, ask a friend to help you out. If you can't follow these instructions then you should not be messing with your kernel. Don't post to the Forum asking for detailed instructions.

You will need to have your kernel headers and full source already installed on your system. See Installing Fedora kernel headers and sources below for how to do this on Fedora.

Copy contents of /usr/src/linux/net/ieee80211 to a safe place. This is so you can recover if things go bad or if you want to apply a new version of the patch.

Copy contents of /usr/src/linux/drivers/net/wireless/zd1211rw to a safe place. This is so you can recover if things go bad or if you want to apply a new version of the patch.

Download and expand the latest version of the aircrack-ng suite to obtain the patches or download the from here. Typically, you will need the svn version to have best patches. Please note that the patch names might change so you may have to adjust the version numbers in the next few steps.

Copy zd1211rw_inject_2.6.20.patch to /usr/src/linux/

cd /usr/src/linux/

NOTE: In the following lines, verbose and dry-run have a double dash in front of them.

patch -Np1  --verbose --dry-run -i zd1211rw_inject_2.6.22.patch 

If it was OK:

patch -Np1  --verbose  -i zd1211rw_inject_2.6.22.patch 

Copy ieee80211_inject.patch to /usr/scr/linux

patch -Np1  --verbose --dry-run -i ieee80211_inject.patch

If it was OK:

patch -Np1  --verbose  -i ieee80211_inject.patch

NOTE: In the following lines, change “2.6.20-1.2944.fc6” to match your particular system.

cd /usr/src/linux/drivers/net/wireless/zd1211rw
make -C /lib/modules/2.6.20-1.2944.fc6/build/ M=`pwd` modules
cd /usr/src/linux/net/ieee80211
make -C /lib/modules/2.6.20-1.2944.fc6/build/ M=`pwd` modules

Now copy the new modules to the /lib/modules tree to be used.

cp /usr/src/linux/drivers/net/wireless/zd1211rw/zd1211rw.ko /lib/modules/2.6.20-1.2944.fc6/kernel/drivers/net/wireless/zd1211rw/zd1211rw.ko
cp /usr/src/linux/net/ieee80211/*.ko /lib/modules/2.6.20-1.2944.fc6/kernel/net/ieee80211/
cp /usr/src/linux/net/ieee80211/softmac/*.ko /lib/modules/2.6.20-1.2944.fc6/kernel/net/ieee80211/softmac/

And finally, rebuild the module dependencies.

 depmod -ae

At this point, the simplest method to bring up the new modules live is to reboot your system.

If you have problems compiling zd1211rw, you can try:

 CONFIG_ZD1211RW=m make -C /lib/modules/`uname -r`/build M=`pwd` clean
 CONFIG_ZD1211RW=m make -C /lib/modules/`uname -r`/build M=`pwd` modules

Installing Fedora kernel headers and source

These instructions are specific to Fedora. Change 2.6.20-1.2944.fc6 to the particular kernel version you have installed. uname -r can help you determine what is currently installed.

You need these packages already installed:

kernel-headers-2.6.20-1.2944.fc6
kernel-devel-2.6.20-1.2944.fc6

Running the command rpm -qa | grep kernel will show which kernel packages are installed.

If the headers and development packages are not already installed then obtain them from your favourite repository then:

rpm -ivh kernel-headers-2.6.20-1.2944.fc6.i386.rpm
rpm -ivh kernel-devel-2.6.20-1.2944.fc6.i686.rpm (obtain i586 or i686 depending on your architecture)

Alternatively, use yum -y install kernel-headers“ and yum -y install kernel-devel.

Now download and install the full kernel sources if they are not already on your system (This assumes you have downloaded this RPM from your favourite repository).

rpm -ivh kernel-2.6.20-1.2944.fc6.src.rpm 

Change to the following directory:

cd /usr/src/redhat/SPECS

Change ”–target=i586“ to the architecture of your system in the next line.

rpmbuild -bp --target=i586 kernel-2.6.spec

NOTE: Change references to versions to your specific version in the next few lines.

/bin/cp -a /usr/src/redhat/BUILD/kernel-2.6.20/linux-2.6.20.i586/*  /usr/src/kernels/2.6.20-1.2944.fc6-i586/
ln -s /usr/src/kernels/2.6.20-1.2944.fc6-i586 /usr/src/linux

Recompiling Kernel with Loadable Modules

Some kernels incorporate the functionality built into the kernel. If you want to change the zd1211rw and ieee802.11 to loadable modules, the following describes how to do this. The source of this note is this thread in the forum.

These are the settings for menuconfig using 2.6.20-gentoo-r7, changing from kernel built-in to loadable modules for the purposes of these patches. This will likely work as well on other distributions.

First, change the appropriate items in menuconfig:

 cd /usr/src/linux
 
 make menuconfig
 
 Networking ---->
 then set
 <M> Generic IEEE802.11 Networking Stack
 <M> Software MAC add-on to the IEEE 802.11 netowrking stack
 all other module capable IEEE 80211 items will have automatically set themselves to <M>
 
 Also check that:
 Device Drivers ----> Network device support ----> Wireless LAN (non-hamradio) ---->
 <M> ZyDAS ZD1211/ZD1211B USB-wireless support is also set to <M>
 
 Exit out and save the config

Now apply the zd1211 and ieee80211 inject patches and recompile/install the kernel and modules.

 Apply the zd1211 inject and ieee80211 inject patches as per patch instructions but only do the 4 patch -Np1  commands, in gentoo doing the make commands and copying all the files is unnecessary!!

After the patches are applied, you can now recompile the kernel and modules with the following commands:

 cd /usr/src
 make && make modules modules_install install

Wait for it to finish and then reboot your system.

Lastly, test your drivers and the injection patch.

zd1211rw.1187973552.txt.gz · Last modified: 2007/08/24 18:39 by darkaudax