Friday, January 9, 2009

Making Packet Injection work on Ubuntu 8.10 (Intrepid Ibex) kernel 2.6.27 on Intel 4965 AG/AGN wireless card

Primarily I followed the following link to make packet injection work on my new Intrepid Ibex (Ubuntu 8.10) kernel 2.6.27 with an Intel 4965 card on a THinkpad T61.
http://tinyshell.be/aircrackng/forum/index.php?PHPSESSID=395694818ce8f33e9810767d30518a2d&action=printpage;topic=3954.0

Before we start, I should suggest you read the complete document and all posts (the tinyshell link), so that as you complete the reading you will have an idea of what to do and what not to. I am not an expert at giving advice in linux, and so I will only mention the steps that worked for me. You may be required to apply your brains at some places and knowledge about patches etc and why we apply them. Remember I already screwed my Gutsy Gibbon (Ubuntu 7.10) while upgrading the kernel. So be prepared for any such occurences.
THese things happen while learning. :) THats the real fun.

Previously in my Gutsy, I was having a kernel 2.6.22, As I have read so far, packet injection doesn't work properly (http: //tinyshell.be/aircrackng/forum/index.php?topic=3954.0 ) below kernels 2.6.25. Even I had to install the driver for Intel 4965 wireless card. That made my wireless work but even after applying the relevant patches I couldn't make injection work. When I tried to update my kernel through apt-get it showed me some errors. And finally the newer kernel never booted and my 2.6.22 was rendered almost useless.
I never debugged as I was more interested in making injection work somehow.
My next endeavour included downloading Backtrack 3, installing it in a USB drive. But still the injection through aireplay-ng didn't work. I also downloaded the latest Ubuntu 8.10 Intrepid Ibex, which is having a kernel 2.6.27.

The good part is that the driver support for Intel 4965 is included in this kernel. What I read from the Intel site is that driver support for this card (Intel iwl4965) is included in kernels higher than 2.6.24. (http://www.intellinuxwireless.org/?p=iwlwifi) So, no doubt my wireless connection is working well with the default config.

But for making packet injection work, I read through the forum and learned that I need to download the latest compat driver to make injection work.
OK, so I downloaded

http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2

from here:

http://linuxwireless.org/en/users/Download


Besides this there is a mention of separate injection patches for iwl4965 and mac80211 but nevertheless I never needed them. :) (Thanks to alex88)

After downloading the compat driver to my root folder.

tar -jxf compat-wireless-2.6.tar.bz2
cd compat-wireless-2009-01-08/
make
make install

and then reboot!!

After that I set my wireless interface in monitor mode by
airmon-ng start wlan0

The airmon-ng creates another interface mon0 in monitor mode. (NOt sure how and why but there is no need to mess with wlan0 :), something that I realised late :/)
and you can try the packet injection test:

root@r00t3r:/home/hax0r# aireplay-ng -9 mon0
14:41:02 Trying broadcast probe requests...
14:41:02 Injection is working!
14:41:04 Found 0 APs
root@r00t3r:/home/hax0r#

Although it says Injection is working, but it can be misleading as it showed me the same message when I ran it for the first time after patching in my Ubuntu 7.10 Gutsy.

So again went through the forum and used the following commands to reload the driver modules (I don't know why they again installed compat, I think once you have installed it correctly, reloading the modules should do the work)
Go to the compat directory (where you extracted compat driver) and issue the following commands:

make
make install
rmmod iwlagn
rmmod iwlcore
rmmod mac80211
rmmod cfg80211
modprobe iwlagn
modprobe mac80211
modprobe cfg80211

When I again tried the injection test it gave me positive results:

root@r00t3r:/home/aditya# aireplay-ng -9 mon0
19:43:21 Trying broadcast probe requests...
19:43:21 Injection is working!
19:43:22 Found 1 AP

19:43:22 Trying directed probe requests...
19:43:22 xx:xx:xx:xx:xx:xx - channel: 1 - 'Gamtal@280'
19:43:24 Ping (min/avg/max): 9.500ms/40.762ms/70.648ms Power: 167.00
19:43:24 28/30: 93%

As of now I only tried to run 'Interactive frame selection technique' the option 2 of aireplay-ng. And it seemed to work normally. Didn't do other tests, as I don't know the theory part of it. Will try them and let you know later. As of now I am more than elated that somehow injection is working on my machine. :)


Summary
**********
1. No injection patches required. (I havnt checked each and every attack, so this may change depending on the attack, like earliar we used to install specific patch for fakeauth. )
2. Download latest compat driver.
3. Install it using 'make' and 'make install'
4. reboot.

Guidelines
************
5. Make sure the 'Network Manager' of Ubuntu is not using your wireless card for wireless connections. Else while placing the interface in monitor mode, it will give a 'device busy' error. For this, Right Click the 'Network Manager' icon on your system tray and uncheck the enable wireless option. If you don't see the icon you can start it using 'nm-applet' command in the terminal. (as it used to happen in Ubuntu 7.10, the icon goes away sometimes :/)

6. Make sure your card is switched 'ON' if any hardware key exists in your laptop. (yes, this can happen as well :))

Hope this works for you.

BByes for nows. See you laters. :) MUha

3 comments:

  1. THANK YOU.Your a life saver :)

    ReplyDelete
  2. I am glad it solved your problem. Thanks for commenting it. :)

    ReplyDelete
  3. The best resolution for the 4965 injection problem ;)

    ReplyDelete