I just captured via wireshark the network traffic. I am trying to get the http request. The problem is that my whole data is captured in IEEE80211 Protocol, almost all example are about ethernet Protocol.
#!/usr/bin/env python
import dpkt
f = open('data/data.pcap','rb')
pcap = dpkt.pcap.Reader(f)
for ts, buf in pcap:
eth = dpkt.ieee80211.IEEE80211(buf)
ip = eth.data
tcp = ip.data
if tcp.dport == 80 and len(tcp.data) > 0:
http = dpkt.http.Request(tcp.data)
print (http.uri)
f.close()
I am getting Error:
Traceback (most recent call last):
File "C:/Users/user/parser/take.py", line 11, in <module>
tcp = ip.data
AttributeError: 'bytes' object has no attribute 'data'
How can I access the data in a IEEE80211 Protocol?
I hope anyone can help me.
@kbandla
I just captured via wireshark the network traffic. I am trying to get the http request. The problem is that my whole data is captured in IEEE80211 Protocol, almost all example are about ethernet Protocol.
I am getting Error:
How can I access the data in a IEEE80211 Protocol? I hope anyone can help me. @kbandla
Thanks