1

I did a deauth attack to my own wifi.

After that I tried to connect wifi (in Kali Linux), but it showed network manager not running. I solved it by using service NetworkManager restart.

Then Network Manager opened, but it couldn't access my wifi networks (unable to access "available networks").

AdminBee
  • 21,637
  • 21
  • 47
  • 71

1 Answers1

0

Note: I'll use wlan0 as interface name below. This should be replaced with the actual wireless interface name (such as wlp1s0 or similar). It can be found in the list of interfaces using ip -br link and is most likely the interface with a w as first letter.


It appears that the aireplay-ng command used to send the deauth attack switches the wireless interface to monitor mode (aka link/ieee802.11/radiotap) but then fails to properly revert it to the usual managed mode. NetworkManager (and/or wpa_supplicant) then doesn't detect anymore a usable wireless interface. This can be checked by running concurrently ip monitor link dev wlan0 and running as in the example in the previous link aireplay-ng -0 1 -a 00:14:6C:7E:40:80 -c 00:0F:B5:34:30:30 wlan0 to see what happens.

First terminal:

$ ip monitor link dev wlan0
3: wlan0: <NO-CARRIER,BROADCAST,UP> 
    link/ether 
[...]

Second terminal, as root user:

# aireplay-ng -0 1 -a 00:14:6C:7E:40:80 -c 00:0F:B5:34:30:30 wlan0
ioctl(SIOCSIWMODE) failed: Device or resource busy
13:45:48  Waiting for beacon frame (BSSID: 00:14:6C:7E:40:80) on channel 1
13:45:58  No such BSSID available.
# 

At the same time in first terminal this happens:

3: wlan0: <BROADCAST> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc
3: wlan0: <BROADCAST> 
    link/ieee802.11/radiotap 
3: wlan0: <NO-CARRIER,BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ieee802.11/radiotap 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc
3: wlan0: <NO-CARRIER,BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state DORMANT group default 
    link/ieee802.11/radiotap 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc
3: wlan0: <NO-CARRIER,BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state DORMANT group default 
    link/ieee802.11/radiotap 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc
3: wlan0: <NO-CARRIER,BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state DORMANT group default 
    link/ieee802.11/radiotap 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc

In the end the interface switched from link/ether to link/ieee802.11/radiotap which is not usable as a managed Wifi connection.


The easiest to revert it to managed mode is to use the iw command which is the Linux low level command dedicated to Wifi interface. Its documentation isn't great yet. One of its help entries is for changing the type of the interface:

# iw help | grep 'set type'
    dev <devname> set type <type>

This has to be done when the interface is down. So to revert to the usual managed mode, run these commands as root user:

ip link set wlan0 down
iw dev wlan0 set type managed
ip link set wlan0 up

Which gets in the first terminal:

3: wlan0: <BROADCAST> mtu 1500 qdisc noqueue state DOWN group default 
    link/ieee802.11/radiotap 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc
3: wlan0: <NO-CARRIER,BROADCAST,UP> mtu 1500 qdisc noqueue state DORMANT group default 
    link/ether 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc
3: wlan0: <NO-CARRIER,BROADCAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 1e:5a:93:39:ca:7c brd ff:ff:ff:ff:ff:ff permaddr 12:34:56:78:9a:bc

The interface reverted to link/ether.

You might then have to restart again NetworkManager so it detects back a usable wireless interface if it didn't automatically.

A.B
  • 31,762
  • 2
  • 62
  • 101