pyshark
pyshark copied to clipboard
No captures or accompanying errors in Ubuntu
Description Pyshark is not capturing packets, and does not list any errors.
To Reproduce Execute the following lines on an interactive python 3.12 shell.
>>> import pyshark as pys
>>> cap = pys.LiveCapture(interface='eth0')
>>> cap.set_debug()
>>> cap.sniff(packet_count=500)
2023-10-30 15:04:23,587 - LiveCapture - DEBUG - Creating Dumpcap subprocess with parameters: /usr/bin/dumpcap -q -i eth0 -w -
2023-10-30 15:04:23,592 - LiveCapture - DEBUG - Dumpcap subprocess (pid 13179) created
2023-10-30 15:04:23,925 - LiveCapture - DEBUG - Creating TShark subprocess with parameters: /usr/bin/tshark -l -n -T pdml -c 500 -i -
2023-10-30 15:04:23,925 - LiveCapture - DEBUG - Executable: /usr/bin/tshark
2023-10-30 15:04:23,930 - LiveCapture - DEBUG - Capturing on 'eth0'
2023-10-30 15:04:23,930 - LiveCapture - DEBUG - File: -
2023-10-30 15:04:23,931 - LiveCapture - DEBUG - TShark subprocess (pid 13200) created
2023-10-30 15:04:23,931 - LiveCapture - DEBUG - Starting to go through packets
2023-10-30 15:04:23,971 - LiveCapture - DEBUG - Running as user "root" and group "root". This could be dangerous.
2023-10-30 15:04:24,257 - LiveCapture - DEBUG - Capturing on '-'
2023-10-30 15:04:24,884 - LiveCapture - DEBUG - 0 packets captured
2023-10-30 15:04:24,908 - LiveCapture - DEBUG - EOF reached
2023-10-30 15:04:24,908 - LiveCapture - DEBUG - Cleanup Subprocess (pid 13179)
2023-10-30 15:04:24,911 - LiveCapture - DEBUG - Cleanup Subprocess (pid 13200)
>>> cap
<LiveCapture (0 packets)>
>>>
Expected Behavior Expected packets to be sniffed, or an explanatory error of why pyshark can't operate.
Versions:
- OS: Ubuntu 20.04.6 LTS
- pyshark version: 0.6 (Python 3.12.0)
- tshark version: TShark (Wireshark) 3.2.3 (Git v3.2.3 packaged as 3.2.3-1)
I have exactly the same error with the following versions:
- OS: Ubuntu 20.04.6 LTS
- Python: 3.10.13
- pyshark: 0.6
- TShark (Wireshark) 3.2.3 (Git v3.2.3 packaged as 3.2.3-1)