stephane-martin / cycapture

Cython bindings for libpcap and libtins
GNU Lesser General Public License v3.0
10 stars 9 forks source link

Options Not being set correct #5

Open derekpanderson opened 8 years ago

derekpanderson commented 8 years ago

I don't believe 802.11 packets are being handled correctly. I included some test code below, when I run it on my machine I always get subype 0 and either '' or None for ssid. I know the subtype is wrong because the subtype set on a probe request is always 4. TCPDump also confirms the values are wrong.

http://www.wildpackets.com/resources/compendium/wireless_lan/wlan_packet_types

from cycapture.libpcap import BlockingSniffer
from cycapture.libtins import EthernetII, Dot11, Dot11ProbeRequest
sniffer = BlockingSniffer(interface="wlan1", monitor_mode=True)

f = lambda mview: Dot11ProbeRequest.from_buffer(mview)
with sniffer.iterator(f=f) as i:        # parse the packets using libtins
    for ts, ts_ms, length, dot11_pdu in i:
        print dot11_pdu.subtype, dot11_pdu.ssid
stephane-martin commented 8 years ago

hi, have you tried to set the datalink type to something like DLT_IEEE802_11 ?

sniffer.datalink = BlockingSniffer.DLT.DLT_IEEE802_11