0

I recently bought an ALFA-AWUS03NHA Wireless Card, I am running Debian and I want to use the card with the aircrack-ng suite of tools. However, I am pretty sure it is using my laptops wireless card, for a few reasons: the light on the ALFA card never flashes, and if I'm running a command and unplug the card it makes no difference.

I've done some research into the drivers for the card, I believe it uses the AR9271 driver, which is included in some download called 'ath_9k'. But I think this is already installed, at least when I run lsmod the drivers show up:

Before plugging in the card, I run the following commands:

~$ sudo iwconfig
[sudo] password for root: 
eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"..."  
          Mode:Managed  Frequency:2.412 GHz  Access Point: "MA:CA:DD:RE:SS"   
          Bit Rate=54 Mb/s   Tx-Power=16 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=56/70  Signal level=-54 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:53   Missed beacon:0

~$ sudo ifconfig
eth0      Link encap:Ethernet  HWaddr "mac_address"  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:"ip address" Mask:255.0.0.0
          inet6 addr: "..." Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:166 errors:0 dropped:0 overruns:0 frame:0
          TX packets:166 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:29969 (29.2 KiB)  TX bytes:29969 (29.2 KiB)

wlan0     Link encap:Ethernet  HWaddr "..."  
          inet addr: "..."  Bcast: "..."  Mask:255.255.240.0
          inet6 addr: "..." Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8272 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5897 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10531170 (10.0 MiB)  TX bytes:766102 (748.1 KiB)

    ~$ lsmod | grep ath
ath9k                  98430  0 
ath9k_common           12634  1 ath9k
ath9k_hw              391009  2 ath9k_common,ath9k
ath                    26026  3 ath9k_common,ath9k,ath9k_hw
mac80211              488308  1 ath9k
cfg80211              436618  3 ath,ath9k,mac80211

I've ommitted a few things, such as identifiable network information and addresses, and a lot of things from lsmod to save space, I just included anything which had ath9k in.

Now I plug in the card, and run the following commands:

~$ lsusb
Bus 002 Device 005: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 002 Device 003: ID 062a:4102 Creative Labs 
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 04f2:b1d6 Chicony Electronics Co., Ltd 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Note the driver number (is this a driver or chipset number? is there a difference?): 9271.

~$ sudo iwconfig
eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"..."  
          Mode:Managed  Frequency:2.412 GHz  Access Point: "..."  
          Bit Rate=54 Mb/s   Tx-Power=16 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=56/70  Signal level=-54 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:59   Missed beacon:0

~$ sudo ifconfig
eth0      Link encap:Ethernet  HWaddr "..." 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:"..."  Mask:255.0.0.0
          inet6 addr: "..." Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:178 errors:0 dropped:0 overruns:0 frame:0
          TX packets:178 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:33921 (33.1 KiB)  TX bytes:33921 (33.1 KiB)

wlan0     Link encap:Ethernet  HWaddr "..."  
          inet addr:"..."  Bcast:"..."  Mask:255.255.240.0
          inet6 addr: "..." Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10338 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7222 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13177945 (12.5 MiB)  TX bytes:1030820 (1006.6 KiB)

Running if/iwconfig seems to return pretty much the same output, with or without the card.

~$ sudo airmon-ng start wlan0


Found 3 processes that could cause trouble.
If airodump-ng, aireplay-ng or airtun-ng stops working after
a short period of time, you may want to kill (some of) them!
-e 
PID Name
2675    NetworkManager
2847    wpa_supplicant
3886    dhclient
Process with PID 3886 (dhclient) is running on interface wlan0


Interface   Chipset     Driver

wlan0       Atheros AR9285  ath9k - [phy0]
                (monitor mode enabled on mon0)

The first thing to notice is AR9285, NOT the same chipset/driver listed for the wireless card. After plugging the card in, there still seems to be one accessible wireless interface, wlan0. What is supposed to happen, do I get a new interface, wlan1, on top of the old one, or should the wireless card overwrite the other and become the new wlan0?

If I run the same lsmod command as before now the card is plugged in, I get new drivers appearing in the 'usbcore' section:

~$ lsmod | grep ath
ath9k_htc              64602  0 
ath9k                  98430  0 
ath9k_common           12634  2 ath9k,ath9k_htc
ath9k_hw              391009  3 ath9k_common,ath9k,ath9k_htc
ath                    26026  4 ath9k_common,ath9k,ath9k_htc,ath9k_hw
mac80211              488308  2 ath9k,ath9k_htc
cfg80211              436618  4 ath,ath9k,mac80211,ath9k_htc
usbcore               166472  5 uvcvideo,ehci_hcd,ehci_pci,usbhid,ath9k_htc

I'm pretty sure neither of those things are happening, instead the wireless card simply isn't being used, I'm sure of this as I can unplug it with no effect, and it never flashes at any point during set up or execution of commands.

So, the question!

Do I have the correct drivers installed for the card? If so, why is it not working? Every video or tutorial I've seen assumes the Alfa is just plug and play. Am I missing out some step here?

2 Answers 2

1

To fix this in Debian 9, add the following repo to /etc/apt/sources.list:

deb http://httpredir.debian.org/debian/ stretch main contrib non-free

Then install the appropriate driver:

apt update; apt-get install firmware-misc-nonfree

Now it should work just fine:

root@debian:~# wpa_supplicant -i wlx00xx -c wpa_supplicant.conf -D wext
Successfully initialized wpa_supplicant
wlx00xx: CTRL-EVENT-SCAN-FAILED ret=-1 retry=1
wlx00xx: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='TestWiFi' freq=5640 MHz)
wlx00xx: Association request to the driver failed
wlx00xx: Associated with xx:xx:xx:xx:xx:xx
wlx00xx: WPA: Key negotiation completed with xx:xx:xx:xx:xx:xx [PTK=CCMP GTK=CCMP]
wlx00xx: CTRL-EVENT-CONNECTED - Connection to xx:xx:xx:xx:xx:xx completed [id=0 id_str=]

Now you can ask for an IP with dhclient wlx00xx.

-1

Solved.

It turns out I didn't have the correct driver installed, I was just confused by the driver being listed in lsmod (only under the usbcore section), figured out it wasn't actually installed. facepalm

1
  • 1
    It would be useful if you could tell us what driver you've installed and how.
    – TCB13
    Commented Aug 16, 2018 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .