Extract http objects to files with python
I know it's easy to extract http objects to files. But I have many pcap files so wish to do it with python script. How can I do it with python?
Use tshark, calling it from python and using the --export-objects <protocol>,<destdir>
argument to specify which protocol objects, "http" in your case and the destination directory. The python code will also have to provide the name of the capture file to read as a -r
argument.
See the tshark man page for more info on using it.
For tshark use a command similar to:
tshark -r "NameOfCaptureFile" --export-objects "http,PathToDestinationDirectory"
Your Python code will have to arrange such a command line substituting in the capture file name and the output directory. You'll have to write that Python code yourself.
Asked: 2019-12-04 14:33:04 +0000
Seen: 1,601 times
Last updated: Dec 05 '19