Fix all Ralink/ath5k/ath9k drivers for aircrack-ng (no more -1)

Started by ZEROF, July 04, 2014, 10:22:29 AM

Previous topic - Next topic

ZEROF

I saw so many pain in the ass with same issue, over, and over again. I'm sure that you are just lazy like any bitch on summer day.

Maybe our wiki is not good for you, or it can't click and make copy/paste in your place.

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

Quotesudo -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):

Quotecd /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:

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

ATH5K (run as root, type sudo -i)

Quotecd /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:

Quotecd /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!

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

b4d_bl0ck

Nice man  ;)
let's see if this is going to reduce the amount of fixed channel: -1 threads. ;D
bool secure = check_paranoia() ? true : false;

Hackdroid

Is this fix exclusive to Ralink drivers? I have other wireless card and whatever I do, I can't fix the said problem.

ZEROF

Hi Hackdroid,

Yep i tested this only with my Ralink adapter. What is yours? Maybe we can try something.

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

Hackdroid

#4
Something went wrong after running the second command. I looked into it and found out that it didn't extract the backports-* archive. I changed the command from tar jxvf backports-* to tar -zxvf backports-* then everything went fine. I will leave a feedback later if it will fix my problem.

EDIT:
I have Atheros AR9280 which use the ath9k driver.

UPDATE:
I think it didn't fixed my problem with the negative channel 1. I still get this error when running aircrack-ng suites especially airbase-ng:
Error: Got channel -1, expected a value > 0.
I don't know if this is really the issue but it seems that because of this error, I can't make my fake access point accessible.

ZEROF

Ok, thank you for testing, i fixed script. And it's normal that Atheros will not pop up with this this is only for Ralink chipset. Let's try from zero(f) :).

Run:

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

Run this if you are not already root:

sudo -i

Then:

Quotecd /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 http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch; patch -p1 < mac80211.compat08082009.wl_frag+ack_v1.patch; wget -Ocompatdrivers_chan_qos_frag.patch http://www.pastie.org/pastes/8846771/download; patch -p1  < compatdrivers_chan_qos_frag.patch; make defconfig-ath9k; make; make install; update-initramfs -u; echo "REBOOT"; sleep 5; reboot


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

Hackdroid

#6
Okay I'll try it now. Thanks for the update.  ;D

EDIT: Do you bring down your wlan before bringing it in monitor mode?

ZEROF

Good luck. I just tested Atheros AE242x / AR542X Wireless Adapter (ath5k drivers) on my lap top and it's working. First post updated. Now i wait for your test, if this does not work for you ... and it's work on my ralink and atheros pc, i don't know what you are doing :). If something goes wrong, maybe with newer kernel you can make your adapter up and running.

QuoteEDIT: Do you bring down your wlan before bringing it in monitor mode?

sudo airmon-ng check kill

To get networkmanager back (after cracking) :

sudo service network-manager start

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

Hackdroid

It worked! Thanks ZEROF. I did what you said, plus I brought my wlan0 down before putting it into monitor mode. At last, I can now make my rouge AP work. I'll continue updating my thread sooner than later. I just have this problems that prevent me from doing that. Thanks again for your help.

ZEROF

Cool,

Now i can say that we have solution for ralink, ath5k and ath9k for now ;). I will update first post.

You're welcome.

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

Hackdroid

One last thing, I tried different configurations before running airbase-ng. It seems that bringing wlan down doesn't really help. What really helped was the process of killing all processes that might interfere with airmon-ng before running it. So I highly recommend running airmon-ng check kill before using the aircrack-ng suite.

ZEROF

I posted that before :). But sure, if something mess with wlan0 don't think that things will be ok. Others will know now :)

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

dataghost

with both of my 3070 chips i need to bring down after mon0 is created and then start the crack that doesnt work, so what i do and has worked well with reaver is bring the device back up while the cracking is in process and its working flawlessly

socal93

Hello guys, Im bit of a noob when it comes to drivers. So please bare with me

I tried to run the commands in the first post, but i noticed a few errors while watching it do its thing.

I got an error saying hunk 1 failed ? is that normal


i have the rtl8192ce

i still have the negative -1 channel error and i did make defconfig-rtlwifi instead of make defcofig-wifi

ZEROF

I guess most of people using this command will never try to fix errors and help this topic going on. You are lazy, like always.

I have found problem and it was fixed, no more errors on my side.

socal93: I will check hunk issue with patch 1. Always run "sudo airmon-ng check kill". Then to get mon0 interface working always set channel number of your AP target, if not aircrack-ng will not work etc. Here, problem was with 2nd patch. When you do wget from raw github link, name of patch was wrong.

Edit: Hunk is not comming from patch 1. Problem is patch 60-1-compatdrivers_chan_qos_frag.patch, diff 1, others are working, from what i can see patch need small rebuild. Hope that someone will have time to do that.

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*