dpkt
dpkt copied to clipboard
Getting WiFi Channel
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)
can you share the pcap? i can give it a shot