dpkt icon indicating copy to clipboard operation
dpkt copied to clipboard

Getting WiFi Channel

Open mistal-distal opened this issue 6 years ago • 1 comments

I'm using pcapy to capture packets off of a wireless interface. I pass the packet to dpkt to parse and I'm able to get most fields from the packet: source_address, name, bssid, etc..

How do I access the channel from either the frame or the original packet? Example of what I got going below


def convert_address(address): 
    return ':'.join('%02x' % ord(b) for b in address)


packet = dpkt.radiotap.Radiotap(data)
packet_dbm = -(256 - packet.ant_sig.db)
frame = packet.data
if frame.type == dpkt.ieee80211.MGMT_TYPE:

        subtype = subtypes_management[frame.subtype]
        strength = packet_dbm
        tAddress = convert_address(frame.mgmt.src)
        sAddress = convert_address(frame.mgmt.src)
        access_name = frame.ssid.data
        access_address = convert_address(frame.mgmt.bssid)

mistal-distal avatar May 08 '18 20:05 mistal-distal

can you share the pcap? i can give it a shot

kbandla avatar May 10 '18 03:05 kbandla