based upon tshark pyshark provides the functionalities.
>> pip install pyshark
After installing the wheel we can access the function provided by the library. One of the example is
capture = pyshark.LiveCapture(interface='eth0')
> The above command imports pyshark and captures the data streaming over the selected ‘eth0’ interface. The timeout is set for the pyshark to trace the data.
f = ("layers.txt", "w")
if len(capture) > 0:
for packet in capture:
val = packet.__dict__['layers']
> this command checks the library for traced data and stores in layers.txt file.
The below is image for viewing the packet
Github link for example:
GitHub - adarsharegmi/wireshark_-python
You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…