1

I try to find a solution to work (just read) a PCAP/pcap File inside a ZIP Archive. I won´t unzip the File to disk, because there are 1000 of zips, and each of them has one pcap inside

e.G.

file1.zip => contains file1.pcap 
file2.zip => contains file2.pcap ... 

I am using pyshark atm but can also use dpkt,scapy if it works with memory zips. But pyshark try to find the file.

>>> with ZipFile(pcaps_zip, "r") as z_in: 
...     for pcap in z_in.namelist():                                                                                                                                                                                                                                          
...             pyshark.FileCapture(pcap)                                                                                                                                                                                             
... 
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/local/lib/python3.6/site-packages/pyshark/capture/file_capture.py", line 48, in 
  __init__
    + str(self.input_filename)
FileNotFoundError: [Errno 2] No such file or directory: file1.pcap

 
  • 1
    Does this answer your question? [Extract a specific file from a zip archive without maintaining directory structure in python](https://stackoverflow.com/questions/17729703/extract-a-specific-file-from-a-zip-archive-without-maintaining-directory-structu) – jkr Jul 24 '20 at 21:37

0 Answers0