October 20, 2017, 04:15:55 PM
Welcome, Guest. Please login or register.

CMFP (Certified Metasploit Framework Professional) Course is out! http://www.top-hat-sec.com/cmfp.html

Author Topic: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)  (Read 5507 times)

Offline ZEROF

  • Top Hat Member
  • Experienced
  • ********
  • Posts: 225
  • Internets: +45/-1
    • Pentester
This tutorial was tested with "Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter" some China SignalKing adapter. Same ralink run with Alfa AWUS036NH version. And if your adapter using ath5k drivers, check down too, i tested this with my laptop who runs Atheros AE242x / AR542X Wireless Adapter.

I will try to resolve all this mess from last few months with one line of command (or two, first need reboot), if you you have some issues, keep me posted or move your ass and give some idea. I don't have time to write bash script for this.

First

Quote
sudo -i; apt-get update; apt-get upgrade; apt-get install linux-headers-$(uname -r); reboot

Run this if you are not already root:

sudo -i

Then (this is only for Ralink rtxxx drivers not rtlxxx, for them find and replace make defconfig-wifi with make defconfig-rtlwifi):

Quote
cd /usr/src/;wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.15.1/backports-3.15.1-1.tar.gz;tar -zxvf backports-*;cd backports-*;apt-get install patch;wget https://github.com/hellnet/backports-patches/raw/master/50-1-mac80211.compat08082009.wl_frag%2Back_v1.patch;patch -p1 < 50-1-mac80211.compat08082009.wl_frag+ack_v1.patch;wget https://github.com/hellnet/backports-patches/raw/master/70-1-fix-channel-negative-1.patch;patch -p1 < 70-1-fix-channel-negative-1.patch;wget https://github.com/hellnet/backports-patches/raw/master/60-1-compatdrivers_chan_qos_frag.patch;patch -p1 < 60-1-compatdrivers_chan_qos_frag.patch;rm 50-* 70-* 60-*;make defconfig-wifi;make;make install;update-initramfs -u;echo "REBOOT";sleep 5;reboot

And you are done ! If this don't help you, then do something better, like fishing :)

If you want to remove all what you just made before and start from 0 run this command:

Quote
sudo -i; cd /usr/src/backports-*; make uninstall; cd .. ; sudo rm -rf /usr/src/backports-*

ATH5K (run as root, type sudo -i)

Quote
cd /usr/src/;wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.15.1/backports-3.15.1-1.tar.gz;tar -zxvf backports-*;cd backports-*;apt-get install patch;wget https://github.com/hellnet/backports-patches/raw/master/50-1-mac80211.compat08082009.wl_frag%2Back_v1.patch;patch -p1 < 50-1-mac80211.compat08082009.wl_frag+ack_v1.patch;wget https://github.com/hellnet/backports-patches/raw/master/70-1-fix-channel-negative-1.patch;patch -p1 < 70-1-fix-channel-negative-1.patch;wget https://github.com/hellnet/backports-patches/raw/master/60-1-compatdrivers_chan_qos_frag.patch;patch -p1 < 60-1-compatdrivers_chan_qos_frag.patch;rm 50-* 70-* 60-*;make defconfig-ath5k;make;make install;update-initramfs -u;echo "REBOOT";sleep 5;reboot

ATH9K (run as root, type sudo -i to get your root)

Then:

Quote
cd /usr/src/;wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.15.1/backports-3.15.1-1.tar.gz;tar -zxvf backports-*;cd backports-*;apt-get install patch;wget https://github.com/hellnet/backports-patches/raw/master/50-1-mac80211.compat08082009.wl_frag%2Back_v1.patch;patch -p1 < 50-1-mac80211.compat08082009.wl_frag+ack_v1.patch;wget https://github.com/hellnet/backports-patches/raw/master/70-1-fix-channel-negative-1.patch;patch -p1 < 70-1-fix-channel-negative-1.patch;wget https://github.com/hellnet/backports-patches/raw/master/60-1-compatdrivers_chan_qos_frag.patch;patch -p1 < 60-1-compatdrivers_chan_qos_frag.patch;rm 50-* 70-* 60-*;make defconfig-ath9k; make; make install; update-initramfs -u; echo "REBOOT"; sleep 5; reboot

Tested on adapter with Atheros AR9280 chipset.

Edit: Updated for BackBox 4 !

Cheers!
« Last Edit: November 15, 2014, 03:35:30 AM by ZEROF »

Offline H4v0K

  • Administrator
  • Elite
  • *****
  • Posts: 1019
  • Internets: +986/-1
Re: Fix all Ralink/ath5k drivers for aircrack-ng (no more -1)
« Reply #1 on: July 04, 2014, 07:54:02 PM »
Thanks for the tut , will try it out as soon as i get time :) +1

Offline ZEROF

  • Top Hat Member
  • Experienced
  • ********
  • Posts: 225
  • Internets: +45/-1
    • Pentester
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #2 on: July 04, 2014, 11:59:22 PM »
Tested on adapter with Atheros AR9280 chipset, ath9k patched drivers. I just updated first post.

And before testing always run

sudo airmon-ng check kill

To get network-manager back (after cracking) :

sudo service network-manager start

Have fun and good luck with this solutions H4v0K :)
« Last Edit: July 05, 2014, 12:05:31 AM by ZEROF »

Offline electroblu3

  • Prospect
  • *
  • Posts: 5
  • Internets: +0/-0
  • Common sense is a privilege.
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #3 on: September 16, 2014, 04:59:52 PM »
Tested on BackBox 3.13 for Ralink RT2870/3070 with the latest backports v3.17. Works like a charm  :)

I should mentioned however patching does throw out errors, but it still works regardless.

Offline ZEROF

  • Top Hat Member
  • Experienced
  • ********
  • Posts: 225
  • Internets: +45/-1
    • Pentester
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #4 on: October 04, 2014, 12:47:05 AM »
Patch links updated, thanks electroblue.

Offline R4v3N

  • Administrator
  • Super Elite
  • *****
  • Posts: 3693
  • Internets: +160/-1
  • The googles and the metasploits...
    • Top-Hat-Sec
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #5 on: October 08, 2014, 08:09:26 AM »
wow excellent ZEROF!

Offline ZEROF

  • Top Hat Member
  • Experienced
  • ********
  • Posts: 225
  • Internets: +45/-1
    • Pentester
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #6 on: October 09, 2014, 01:51:29 PM »
Lol, thanks man. I saw to many topics all over internet about drivers issue for pentesting. They are not only BackBox related. I took my time few adapters and with few co-workers and i have found working solution. Now this solution is working for most of  WiFi adapters. When i get time i will update this tutorial.

This topic on our forum have 23722 visits for now :).

Have a nice day.

wow excellent ZEROF!

Offline 0E 800

  • If something can corrupt you, you're corrupted already.
  • Top Hat Member
  • Elite
  • ********
  • Posts: 961
  • Internets: +154/-0
  • ??? ???????? ?s ?? ??c?c??-???
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #7 on: October 21, 2014, 12:30:39 PM »
I tried applying above method on kernel 3.17. I got a few errors when trying to patch the compatdrivers_chan_qos_frag.patch.  I think that patches a few things, it was only able to apply the last patch. Even so, I was able do successfully test-crack a WEP and WPA/WPA2 AP.

It took me about 3 days to figure out how to compile kernel 3.17 with AUFS support - needed in order to boot from liveiso. I am thinking of remasterying BB4 to include kernel 3.17, if anyone is interested in testing it out on their sytem - hit me up.

Thank you ZER0F.
"He who passes not his days in the realm of dreams is the slave of the days."

Offline ZEROF

  • Top Hat Member
  • Experienced
  • ********
  • Posts: 225
  • Internets: +45/-1
    • Pentester
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #8 on: October 25, 2014, 11:09:03 AM »
Hi 0E 800,

I guess i need to spend one more day to test all again with add from other chipset users. But i don't know if i will have time soon. But i will try to upgrade backports to last version and see how it goes in BBox4, this was only tested with BBox3.

Offline 0E 800

  • If something can corrupt you, you're corrupted already.
  • Top Hat Member
  • Elite
  • ********
  • Posts: 961
  • Internets: +154/-0
  • ??? ???????? ?s ?? ??c?c??-???
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #9 on: October 27, 2014, 09:11:09 AM »
I have very minimal experience with patches. I was going to try to read the patch strings that failed and see if I could adapt them for the newer kernel. Be well.
"He who passes not his days in the realm of dreams is the slave of the days."

Offline ZEROF

  • Top Hat Member
  • Experienced
  • ********
  • Posts: 225
  • Internets: +45/-1
    • Pentester
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #10 on: October 27, 2014, 09:36:45 AM »
Hi 0E 800,

If you have time maybe you can help me to update one of script in this tutorial ( like that we can go step by step, chipset by chipset). Provide me info about your adapter drivers/chipset?

Something like:

Chipset: Ralink
Driver: rtxxx

To get this information and you don't know much about you can use tool ethtool. To get info about your drivers/chipset:

apt-get install ethtool
ethtool wlan0 or ethtool -i wlan0

I will write new "one command" and you can test it on new BBox, just provide me information i asked.

Thank you.
« Last Edit: October 27, 2014, 09:43:46 AM by ZEROF »

Offline 0E 800

  • If something can corrupt you, you're corrupted already.
  • Top Hat Member
  • Elite
  • ********
  • Posts: 961
  • Internets: +154/-0
  • ??? ???????? ?s ?? ??c?c??-???
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #11 on: October 27, 2014, 11:29:51 AM »
external wlan1: TPLINK TL-WN722N
atheros
ath9k_htc

Integrated wifi:
atheros
ath9k

I also have a genuine alfa 036H.

"He who passes not his days in the realm of dreams is the slave of the days."

Offline ZEROF

  • Top Hat Member
  • Experienced
  • ********
  • Posts: 225
  • Internets: +45/-1
    • Pentester
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #12 on: October 27, 2014, 01:51:06 PM »
Small update,

Ok, i just tested with Ralink RT drivers (not RTL, for RTL i need to write new code) all working fine and aircrack-ng kicking without issues (just stop network manager from menu>services>network manager>network manager stop or from terminal, it's up to you). Some errors pop up but they are not imp. for installation. Good news is that i have found last updated patch (1,2,3) and they don't give errors any more.

This is test code for you (will do the job for any ath9k):

Code: [Select]
sudo -i
Copy this

Quote
cd /usr/src/;wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.15.1/backports-3.15.1-1.tar.gz;tar -zxvf backports-*;cd backports-*;apt-get install patch;wget https://github.com/hellnet/backports-patches/raw/master/50-1-mac80211.compat08082009.wl_frag%2Back_v1.patch;patch -p1 < 50-1-mac80211.compat08082009.wl_frag+ack_v1.patch;wget https://github.com/hellnet/backports-patches/raw/master/70-1-fix-channel-negative-1.patch;patch -p1 < 70-1-fix-channel-negative-1.patch;wget https://github.com/hellnet/backports-patches/raw/master/60-1-compatdrivers_chan_qos_frag.patch;patch -p1 < 60-1-compatdrivers_chan_qos_frag.patch;rm 50-* 70-* 60-*;make defconfig-ath9k; make; make install; update-initramfs -u; echo "REBOOT"; sleep 5; reboot

P.S. Genuine alfa 036H use Ralink chipset, but drivers are rtxxx or rtlxxx? Thanks.
« Last Edit: November 15, 2014, 03:36:15 AM by ZEROF »

Offline lev3lz

  • Top Hat Member
  • Enthusiast
  • ********
  • Posts: 71
  • Internets: +13/-0
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #13 on: December 13, 2014, 09:53:21 PM »
Nice!  That ish is so freakin annoying...

I think this issue happens when the software doesn't properly change the channel.   Conflict of two pieces of code battling for channel control and it ends up in being stuck on one of the channels...

thanks for this!
know your enemy

Offline 0E 800

  • If something can corrupt you, you're corrupted already.
  • Top Hat Member
  • Elite
  • ********
  • Posts: 961
  • Internets: +154/-0
  • ??? ???????? ?s ?? ??c?c??-???
Re: Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)
« Reply #14 on: June 04, 2015, 03:51:06 PM »
Small update,

Ok, i just tested with Ralink RT drivers (not RTL, for RTL i need to write new code) all working fine and aircrack-ng kicking without issues (just stop network manager from menu>services>network manager>network manager stop or from terminal, it's up to you). Some errors pop up but they are not imp. for installation. Good news is that i have found last updated patch (1,2,3) and they don't give errors any more.

This is test code for you (will do the job for any ath9k):

Code: [Select]
sudo -i
Copy this

Quote
cd /usr/src/;wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.15.1/backports-3.15.1-1.tar.gz;tar -zxvf backports-*;cd backports-*;apt-get install patch;wget https://github.com/hellnet/backports-patches/raw/master/50-1-mac80211.compat08082009.wl_frag%2Back_v1.patch;patch -p1 < 50-1-mac80211.compat08082009.wl_frag+ack_v1.patch;wget https://github.com/hellnet/backports-patches/raw/master/70-1-fix-channel-negative-1.patch;patch -p1 < 70-1-fix-channel-negative-1.patch;wget https://github.com/hellnet/backports-patches/raw/master/60-1-compatdrivers_chan_qos_frag.patch;patch -p1 < 60-1-compatdrivers_chan_qos_frag.patch;rm 50-* 70-* 60-*;make defconfig-ath9k; make; make install; update-initramfs -u; echo "REBOOT"; sleep 5; reboot

P.S. Genuine alfa 036H use Ralink chipset, but drivers are rtxxx or rtlxxx? Thanks.

Just wanted to thank you again ZEROF, these instructions worked also for kernel 3.19 using
backports-20150525. Patches still worked.
"He who passes not his days in the realm of dreams is the slave of the days."