Aircrack-ng forum

General Category => Useful stuff => Topic started by: s0ullight on August 10, 2013, 02:37:27 am

Title: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: s0ullight on August 10, 2013, 02:37:27 am
Introduction:
This guide will attempt to fix the wrong channel reporting issue many users face on Ubuntu 13.04 (raring ringtail). Typically airodump-ng will report the following:
Quote
fixed channel mon0: -1
The odd thing about the above message is that this issue was fixed since the 3.3 rc1 kernel release. Note that 13.04 ships with a 3.8 kernel. I assume this kernel suffers from a regression.

The fix
The easiest way to fix this is to download and install backported drivers from a kernel release that works.
First, let's make sure we have the required headers and tools to install these drivers:
Code: [Select]
sudo apt-get install build-essentialNow we have to download and extract a stable backports tarball, I found version 3.10.4 to be working:
Code: [Select]
mkdir ~/backports
cd ~/backports
wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.10.4/backports-3.10.4-1.tar.bz2
tar jxvf backports-3.10.4-1.tar.bz2
cd backports-3.10.4-1
This tarball includes much more than drivers for wireless adapters, but we only need to compile the modules for the wireless subsystem.
Code: [Select]
make defconfig-wifi
make
If everything went fine, your new modules should be ready to be used. Let's install them:
Code: [Select]
sudo make installNo worries, your original drivers are still there, the system will simply prefer these new ones.
The easiest way to get your freshly built drivers working is to reboot.
Once rebooted, make sure the system is indeed using the new drivers:
Code: [Select]
lsmod | grep compatIt should return a line that's similar to:
Quote
compat                 14155  4 bcma,cfg80211,brcmsmac,mac80211
The above procedure you will have to do once.

Let's add a monitor interface for our device (change wlan0 to the interface name your device has):
Code: [Select]
sudo airmon-ng start wlan0This will add an interface usually similar to "mon0".
We still have to stop the network manager service, or the reporting will be wrong:
Code: [Select]
sudo service network-manager stop
sudo killall wpa_supplicant
You should be all set now, fire up an airodump-ng monitor session on a single channel and see if you still get the annoying -1.

You can restart network-manager with:
Code: [Select]
sudo service network-manager start
In case you want to return to your original drivers:
Code: [Select]
cd ~/backports/backports-3.10.4-1
sudo make uninstall

I hope this will be useful, enjoy!
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: DarkAudax on August 10, 2013, 01:37:01 pm
s0ullight,

Thanks for sharing this.

d.
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: rascal on August 14, 2013, 10:30:32 am
After
Code: [Select]
make defconfig-wifi or
Code: [Select]
sudo make installDone:

Code: [Select]
/--------------
| Your kernel headers are incomplete/not installed.
| Please install kernel headers, including a .config
| file or use the KLIB/KLIB_BUILD make variables to
| set the kernel to build against, e.g.
|   make KLIB=/lib/modules/3.1.7/
| to compile/install for the installed kernel 3.1.7
| (that isn't currently running.)
\--
make: *** [install] Errore 1

Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: int3 on December 03, 2013, 09:12:53 pm
I can't unistall! now I have huge lags.

Code: [Select]
make[1]: *** No rule to make target `unistall'.  Stop.
make: *** [unistall] Error 2
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: misterx on December 04, 2013, 02:16:16 am
I don't think there is an uninstall. By the way, there is a typo, you're missing the 'n' after the 'i'.
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: smd on June 26, 2014, 01:21:49 am
I followed this guide to the exact description, however these are the results after the "make" command is given. Towards the end it goes on about "error 2" a lot and some "Error 1". Suggestions?

Code: [Select]
smd@SMDCPU:~/backports/backports-3.10.4-1$ make
make[5]: `conf' is up to date.
warning: (WL12XX && WL18XX) selects WLCORE which has unmet direct dependencies (WLAN && !BACKPORT_KERNEL_2_6_30 && m && <choice> && WL_TI && GENERIC_HARDIRQS && MAC80211)
warning: (WL12XX && WL18XX) selects WLCORE which has unmet direct dependencies (WLAN && !BACKPORT_KERNEL_2_6_30 && m && <choice> && WL_TI && GENERIC_HARDIRQS && MAC80211)
#
# configuration written to .config
#
Building backport-include/backport/autoconf.h ... done.
  CC [M]  /home/smd/backports/backports-3.10.4-1/compat/main.o
  LD [M]  /home/smd/backports/backports-3.10.4-1/compat/compat.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/compat/cordic.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/compat/crc8.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/main.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/scan.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/core.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/sprom.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/driver_chipcommon.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/driver_chipcommon_pmu.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/driver_pci.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/driver_gpio.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/host_pci.o
  LD [M]  /home/smd/backports/backports-3.10.4-1/drivers/bcma/bcma.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/usb/cdc_ether.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/usb/rndis_host.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/usb/usbnet.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/wireless/at76c50x-usb.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/wireless/rndis_wlan.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/wireless/adm8211.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mwl8k.o
  CC [M]  /home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.o
/home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.c: In function ‘hwsim_init_netlink’:
/home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.c:2130:35: error: macro "genl_register_family_with_ops" passed 3 arguments, but takes just 2
   hwsim_ops, ARRAY_SIZE(hwsim_ops));
                                   ^
/home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.c:2129:7: error: ‘genl_register_family_with_ops’ undeclared (first use in this function)
  rc = genl_register_family_with_ops(&hwsim_genl_family,
       ^
/home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.c:2129:7: note: each undeclared identifier is reported only once for each function it appears in
/home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.c: At top level:
/home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.c:2078:24: warning: ‘hwsim_ops’ defined but not used [-Wunused-variable]
 static struct genl_ops hwsim_ops[] = {
                        ^
make[6]: *** [/home/smd/backports/backports-3.10.4-1/drivers/net/wireless/mac80211_hwsim.o] Error 1
make[5]: *** [/home/smd/backports/backports-3.10.4-1/drivers/net/wireless] Error 2
make[4]: *** [_module_/home/smd/backports/backports-3.10.4-1] Error 2
make[3]: *** [modules] Error 2
make[2]: *** [modules] Error 2
make[1]: *** [modules] Error 2
make: *** [default] Error 2
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: misterx on June 27, 2014, 03:49:54 am
Maybe you need to switch libnl versions. If you have 1, use 3 or if you 3, try one. I know 2 doesn't work with aircrack-ng and that might be it.
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: SWAY on July 07, 2014, 08:08:21 am
I wanted to share with everyone the reason Ubuntu causes the "negative-one" issue and a simple fix:
I've notice that Ubuntu sets the wifi interface (not the monitor) to channel -1 to scan for available APs but then leaves the interface in that channel.  While you are using aircrack-ng to listen to hanshakes, set your interface down ("sudo ifconfig wlan0 down" replace wlan0 with your interface dev if different) just prior to sending your deauthorization packets.  This forces aircracking to bring up your interface with the correct channel prior to sending your deauth. packets.
I know it's not a "Real" fix to the problem, but it is an effective one.
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: misterx on July 08, 2014, 12:26:38 am
Killing network managers fixes it.
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: itsAj3 on November 09, 2014, 07:37:48 am
can someone help me ?
I'm having this error after make install command
make[4]: `conf' is up to date.
warning: (WL12XX && WL18XX) selects WLCORE which has unmet direct dependencies (WLAN && !BACKPORT_KERNEL_2_6_30 && m && <choice> && WL_TI && GENERIC_HARDIRQS && MAC80211)
warning: (WL12XX && WL18XX) selects WLCORE which has unmet direct dependencies (WLAN && !BACKPORT_KERNEL_2_6_30 && m && <choice> && WL_TI && GENERIC_HARDIRQS && MAC80211)
#
# configuration written to .config
#
Building backport-include/backport/autoconf.h ... done.
  CC [M]  /root/backports-3.10-2/compat/main.o
  LD [M]  /root/backports-3.10-2/compat/compat.o
  CC [M]  /root/backports-3.10-2/compat/cordic.o
  CC [M]  /root/backports-3.10-2/compat/crc8.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/main.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/scan.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/core.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/sprom.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/driver_chipcommon.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/driver_chipcommon_pmu.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/driver_pci.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/driver_gpio.o
  CC [M]  /root/backports-3.10-2/drivers/bcma/host_pci.o
  LD [M]  /root/backports-3.10-2/drivers/bcma/bcma.o
  CC [M]  /root/backports-3.10-2/drivers/net/usb/cdc_ether.o
  CC [M]  /root/backports-3.10-2/drivers/net/usb/rndis_host.o
  CC [M]  /root/backports-3.10-2/drivers/net/usb/usbnet.o
  CC [M]  /root/backports-3.10-2/drivers/net/wireless/at76c50x-usb.o
  CC [M]  /root/backports-3.10-2/drivers/net/wireless/rndis_wlan.o
  CC [M]  /root/backports-3.10-2/drivers/net/wireless/adm8211.o
  CC [M]  /root/backports-3.10-2/drivers/net/wireless/mwl8k.o
  CC [M]  /root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.o
/root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.c: In function 'hwsim_init_netlink':
/root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.c:2130:35: error: macro "genl_register_family_with_ops" passed 3 arguments, but takes just 2
/root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.c:2129:7: error: 'genl_register_family_with_ops' undeclared (first use in this function)
/root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.c:2129:7: note: each undeclared identifier is reported only once for each function it appears in
/root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.c: At top level:
/root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.c:2078:24: warning: 'hwsim_ops' defined but not used [-Wunused-variable]
make[7]: *** [/root/backports-3.10-2/drivers/net/wireless/mac80211_hwsim.o] Error 1
make[6]: *** [/root/backports-3.10-2/drivers/net/wireless] Error 2
make[5]: *** [_module_/root/backports-3.10-2] Error 2
make[4]: *** [sub-make] Error 2
make[3]: *** [all] Error 2
make[2]: *** [modules] Error 2
make[1]: *** [modules] Error 2
make: *** [install] Error 2
Title: Re: GUIDE: Ubuntu 13.04 fix wrong channel reporting (negative one)
Post by: misterx on February 26, 2015, 02:31:46 am
I just saw that post. Use the latest version of the backports, not some ancient one.