pythonwifiscapy

Strange behavior of sendp, discharging packets to wrong destination


I am trying to send a 802.11 packet to a client from my access point using scapy. But every time the packet is dispatched to the air, it is being sent to a wrong destination. What I've tried doing:

from scapy.all import *
conf.iface = 'wlan1mon'

ap = '34:af:90:4a:bb:57'
client = 'ff:ff:ff:ff:ff:ff'

__pkt = RadioTap() / Dot11(addr1=client, addr2=ap, addr3=ap) / Dot11Deauth(reason=2)

sendp(__pkt, count=70)

Now, from the packets fields, it should be sent to Broadcast address but when I fire up Wireshark, the packets were sent to an unknown destination: 00:00:c0:00:00:00 (western):

wireshark

The question is why the packets are being sent to a wrong destination or even if they are, is there any other way of dispatching packets to the air?


Solution

  • The problem was occurring when I directly specified the monitor interface in the conf.iface settings. But when the interface is given as the argument in sendp function, packets were discharged to the correct destination.

    >>> sendp(__pkt, iface="wlan1mon")