MadWifi Support for AR5007 (AR2425) With Injection (Aircrack)

Sunday, July 27, 2008

A new HAL was recently released that allowed MadWifi to support the AR5007/AR2425 devices by Atheros. Last month, there were still some hiccups with the code, but it seems smooth enough for general consumption now. The new driver supports both 32-bit and 64-bit environments, unlike the older 32-bit-only hack. As a bonus, I successfully patched the code for injection.

The commands required to checkout, patch, build, and install the driver are rather simple. I’m posting it here both as a note to myself and for public benefit.

First, we need to checkout the new driver from svn:

svn checkout madwifi-hal
pushd madwifi-hal

Injection support is optional. It’s very simple to achieve with the Aircrack-ng patch, however:

wget -O – | patch -Np1

Now the driver needs to be built. This requires that we have the kernel headers installed. On Ubuntu, it’s a simple matter of installing build-essential and linux-headers-generic (or whichever corresponds to the kernel in use). Then:

make clean && make

Before we install the new driver, it’s best if we stop the wireless device first and unload the current driver:

sudo ifconfig ath0 down
sudo ifconfig wifi0 down
sudo ./scripts/madwifi-unload

Now we can install the driver, which should start working without a reboot:

sudo make install
sudo depmod -ae
sudo modprobe ath_pci

… and we’re done. The files can be removed now, but it’s best that they be kept — the driver will need to be rebuilt and reinstalled whenever a new kernel is installed, like so:

pushd madwifi-hal
make clean && make
sudo ifconfig ath0 down
sudo ifconfig wifi0 down
sudo ./scripts/madwifi-unload
sudo make install
sudo depmod -ae
sudo modprobe ath_pci

I hope this guide was useful. For more information about this driver, please refer to this MadWifi support ticket. For more information about Aircrack-ng, please refer to its website.

November 6th, 2008: The MadWifi project has a new domain. The SVN location in the guide has been updated.


  1. kiko barcelona says:

    Hi from barcelona!!! nice job Jiang!!!

    I am new at linux…

    I am trying to aply the patch without installing the driver in a eee pc900-701. Madwifi allready installed out of the box. after download the patch and write down : “patch -Np1 -i ../madwifi-ng.patch”
    it says “file to patch:”
    What is the name of the file to patch or where i can find it????

    i am using backtrack 3.

    Hope you can help me …

  2. Jiang Yio says:


    You need to apply the patch to the driver’s source tree. After you’ve done that, you’d compile and install the new driver. The stock madwifi driver does not support injection and needs to be patched for aircrack to work.

    I’m not too familiar with BackTrack, but since it’s centered around security auditing, I’d expect it to already have drivers patched for injection. You can find the docs on their wiki:

  3. Maks says:

    What about Windows… can I use this patch for windows? Or tell me other program which I can use to crack a wep key. I have the wireless wifi collection such as airsnort, aircrack… and I also have Atheros AR5007EG and I cant use them to crack because it says “you must install specified drivers” and I don’t know where to find them. PLEASE HELP… don’t email me just leave a reply because I forgot my pass :S……Excuse my English… THANKS

  4. Phiko says:

    Good job Jiang…;) Can you give me the wireless “hack” tools for cracking a wep/wpa for WINDOWS XP SP2 including certain drivers which I`ll use on my atheros AR5007EG???….excuse my english…thanks a lot

  5. Jiang Yio says:

    In general, Windows is not the right tool for the job. The OmniPeek drivers let you monitor but not inject, reducing efficiency greatly.

    MadWifi is a Linux driver for Atheros chipsets. To use your Atheros device on Windows, you should install the Windows driver provided by Atheros. For Aircrack on Windows, I heard you should use a certain OmniPeek driver instead.

  6. Tecolote says:

    Thanks a lot, works!!

  7. vistaloser says:

    i need to get my AR5007 to work with my aircrack ng package
    but airodump wouldn’t recognize my wireless
    i am running windows by the way
    how can i get it to work?

  8. Jiang Yio says:

    Though it is unsupported, Aircrack-ng does work on Windows. Please have a look at the documentation.

    You might want to boot into Linux for this, as you’d be able to work much more efficiently.

  9. I get this error when patching.

    patching file ath/if_ath.c
    Hunk #1 FAILED at 2950.
    Hunk #2 succeeded at 3015 (offset 52 lines).
    Hunk #3 succeeded at 3040 (offset 52 lines).
    1 out of 3 hunks FAILED — saving rejects to file ath/if_ath.c.rej

    Do I need a new patch? I followed the instructions exactly.


  10. Larry Kunz says:

    Hi Jiang Yio,

    Very good instructions on AR5007 but —

    I am VERY new to Linux and am unable to get my AR5007 wifi working with Ubuntu NBR in an Acer One.

    Trying to understand your programing but get confused at the new driver building step ” installing build-essential and linux-headers-generic ” — is there more code needed or do I just input ” make clean && make ” at the terminal for this step?

    Could you even simplify your very good instructions even further ( ie baby step by step )for a Linux DUMMY like me?

    Appreciate if you could email me back at

    Thank you for your patience and help !!
    Larry Kunz

  11. Al says:

    You are the man! This noob spent 2 days trying to install drivers. and when I finally figured it out, Aireplay wouldn’t work because I never patched it. This walkthrough is amazing, I wish it had been the first item on my Google search.

    By the way, if the links are outdated, just use your browser to check out the http and then adjust the filename and directory accordingly.

    Also, for noobs like myself, you can just download the file into the madwifi directory with “wget”(drop “-O – | patch -Np1″). Then, when you’re in the directory, use ” patch -N -p 0 -i madwifi-ng-r3925.patch”

    Again, adjust filename accordingly if newer patch.

    Then follow my man’s ingenious guide and done!

  12. LuRy says:

    I have problem with compilation madwifi ,i will try compiling for windows and i get mistake.
    Please help me with that i try witg cygwin

    LuRyt@LuRy /home/madwifi/madwifi-hal-
    $ make
    /bin/sh: -c: line 0: syntax error near unexpected token `(‘
    /bin/sh: -c: line 0: `cd /lib/modules/1.5.25(0.156/4/2)/build && pwd’ *** /lib/modules/1.5.25(0.156/4/2)/build is missing, please set KERNELPATH. Stop.

  13. zztommyzz says:

    Is there any peek drivers(for WinXP) for Atheros AR5007EG wireless adaptor??Where can I find it???

    I have already tryied all available for other models to wildpack site but nothing

    Please HELP!
    I’m going CRAZY!!

  14. cell jammer says:

    Is there such a thing as wifi jammers?

  15. zee says:

    hey man the download link is not working
    can u plz send to me the new download link to my email txxxxx

  16. Chris says:

    hey, are there any Atheros AR5007EG drivers or patches that I can use for Aircrack to support injection? I’m running on Linux, but there doesn’t seem to be anything that will work for this *particular* card. Seems like there’s support for every *other* card, though. Any patches?

  17. Jiang Yio says:

    Last time I tried, Aircrack-ng worked with ath5k/mac80211, the opensource kernel-based driver for this chipset. Madwifi-ng supposedly works better.

  18. LASTMAN says:

    ok im trying to run aircrack on my Toshiba that has a AR5007EG card on Windows 7.
    Im trying to crack my own wep but when i run Airdump ng it says adapter not supported…
    Help please!!!
    Can someone upload the driver to megaupload?
    Newb here trying to crack my own wep so give me some slack……..

  19. safwen says:



Pingbacks & Trackbacks

  1. inportb » Blog Archive » Aircrack for Atheros AR5007EG - Pingback on 2008/07/29
  2. Crack WEP: Patch driver for AR5007 (AR2425) - Jiajun Wang and Xiao Tang’s Blog - Welcome to our online blog - Pingback on 2008/12/31