Skip to content

Fallback to 'iw' if 'iwconfig' fails #2

Description

@Mister-X-

This happened on NetHunter with Wifite v2.2.5.

root@kali:~# iwconfig 2>&1 | grep wlan
wlan1     no wireless extensions.
wlan0     no wireless extensions.
root@kali:~# airmon-ng start wlan1
Found 1 processes that could cause trouble.
Kill them using 'airmon-ng check kill' before putting
the card in monitor mode, they will interfere by changing channels
and sometimes putting the interface back in managed mode
  PID Name
26073 wpa_supplicant
PHY Interface   Driver      Chipset
phy0    p2p0        icnss       Not pci, usb, or sdio
phy0    wlan0       icnss       Not pci, usb, or sdio
phy9    wlan1       rt2800usb   Ralink Technology, Corp. RT2870/RT3070
        (mac80211 monitor mode vif enabled for [phy9]wlan1 on [phy9]wlan1mon)
        (mac80211 station mode vif disabled for [phy9]wlan1)
root@kali:~# iwconfig 2>&1 | grep wlan
wlan0     no wireless extensions.
wlan1mon  no wireless extensions.
root@kali:~# wifite
   .               .
 .´  ·  .     .  ·  `.  wifite 2.2.5
 :  :  :  (¯)  :  :  :  automated wireless auditor
 `.  ·  ` /¯\ ´  ·  .´  https://github.com/derv82/wifite2
   `     /¯¯¯\     ´
 [!] Warning: Recommended app bully was not found. install @ https://github.com/aanarchyy/bully
 [!] Warning: Recommended app pyrit was not found. install @ https://github.com/JPaulMora/Pyrit/wiki
 [!] Warning: Recommended app hashcat was not found. install @ https://hashcat.net/hashcat/
 [!] Warning: Recommended app hcxdumptool was not found. install @ https://github.com/ZerBea/hcxdumptool
 [!] Warning: Recommended app hcxpcaptool was not found. install @ https://github.com/ZerBea/hcxtools
 [!] Conflicting processes: wpa_supplicant (PID 26073)
 [!] If you have problems: kill -9 PID or re-run wifite with --kill)
    Interface   PHY   Driver              Chipset
-----------------------------------------------------------------------
 1. p2p0        phy0  icnss               Not pci, usb, or sdio
 2. wlan0       phy0  icnss               Not pci, usb, or sdio
 3. wlan1mon    phy9  rt2800usb           Ralink Technology, Corp. RT2870/RT3070
 [+] Select wireless interface (1-3): 3
 [+] enabling monitor mode on wlan1mon... failed
failed
 [!] Error: Cannot find any interfaces in Mode:Monitor
 [!] Full stack trace below
 [!]    Traceback (most recent call last):
 [!]    File "/usr/lib/python2.7/dist-packages/wifite/__main__.py", line 93, in entry_point
 [!]        wifite.start()
 [!]    File "/usr/lib/python2.7/dist-packages/wifite/__main__.py", line 53, in start
 [!]        Configuration.get_monitor_mode_interface()
 [!]    File "/usr/lib/python2.7/dist-packages/wifite/config.py", line 129, in get_monitor_mode_interface
 [!]        cls.interface = Airmon.ask()
 [!]    File "/usr/lib/python2.7/dist-packages/wifite/tools/airmon.py", line 319, in ask
 [!]        iface.interface = Airmon.start(iface)
 [!]    File "/usr/lib/python2.7/dist-packages/wifite/tools/airmon.py", line 190, in start
 [!]        raise Exception('Cannot find any interfaces in Mode:Monitor')
 [!]  Exception: Cannot find any interfaces in Mode:Monitor
 [!] Exiting

It seems like it tries to use iwconfig output to determine if the card is in monitor mode (as seen by Mode:Monitor), but apparently, ieee80211 compatibility has been disabled, so any deprecated command (iwconfig and others) will fail, and this can be seen at the very beginning of the output.
So, what I would recommend is that if it happens, is to fallback to using iw to check if the interface is in monitor mode.

Note that airodump-ng works just fine on it.

I'm not sure if this happens with this version but I decided to open this here since derv82's repo hasn't seen any activity in a long time. Let me know if you prefer to have it opened in derv82's repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions