-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyshark FileCapture crashes when tshark is missing the permissions to open the pcap file #453
Comments
Have similar issue of crash while running on win10 Exception ignored in: <function Capture.del at 0x0000017035AFA790> My code:
|
This comment has been minimized.
This comment has been minimized.
seems that the package in pypi is not updated one. |
facing same issue |
I am facing this as well once I create a FileCapture object and then try to access any packet in the capture. |
2021-01-21 02:55:30,956 - FileCapture - DEBUG - Creating TShark subprocess with parameters: /usr/bin/tshark -l -n -T pdml -Y tcp or udp or dns.qry.name eq wpad -r /tmp/tshark_capture_21.01.2021_02:55:27.pcapng
2021-01-21 02:55:30,956 - FileCapture - DEBUG - Executable: /usr/bin/tshark
2021-01-21 02:55:30,959 - FileCapture - DEBUG - TShark subprocess created
tshark: You don't have permission to read the file "/tmp/tshark_capture_21.01.2021_02:55:27.pcapng".
2021-01-21 02:55:31,243 - FileCapture - DEBUG - EOF reached (sync)
Traceback (most recent call last):
File "./netscan.py", line 137, in
main()
File "./netscan.py", line 96, in main
tshark_scan.print_results(output_file)
File "/home/kali/netscan/src/tshark_scan.py", line 99, in print_results
capture.close()
File "/home/kali/.local/lib/python3.8/site-packages/pyshark/capture/capture.py", line 426, in close
self.eventloop.run_until_complete(self.close_async())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/kali/.local/lib/python3.8/site-packages/pyshark/capture/capture.py", line 430, in close_async
await self._cleanup_subprocess(process)
File "/home/kali/.local/lib/python3.8/site-packages/pyshark/capture/capture.py", line 421, in _cleanup_subprocess
raise TSharkCrashException("TShark seems to have crashed (retcode: %d). "
pyshark.capture.capture.TSharkCrashException: TShark seems to have crashed (retcode: 2). Try rerunning in debug mode [ capture_obj.set_debug() ] or try updating tshark.
Exception ignored in: <function Capture.del at 0x7fbae1e20310>
Traceback (most recent call last):
File "/home/kali/.local/lib/python3.8/site-packages/pyshark/capture/capture.py", line 435, in del
File "/home/kali/.local/lib/python3.8/site-packages/pyshark/capture/capture.py", line 426, in close
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
File "/home/kali/.local/lib/python3.8/site-packages/pyshark/capture/capture.py", line 430, in close_async
File "/home/kali/.local/lib/python3.8/site-packages/pyshark/capture/capture.py", line 421, in _cleanup_subprocess
pyshark.capture.capture.TSharkCrashException: TShark seems to have crashed (retcode: 2). Try rerunning in debug mode [ capture_obj.set_debug() ] or try updating tshark.
The text was updated successfully, but these errors were encountered: