S
S
SKEPTIC2020-01-14 15:58:30
Python
SKEPTIC, 2020-01-14 15:58:30

How to read packages from cap file in understandable format in Python3?

How to read packages from cap file in understandable format in Python3?
Made TCPDUMP on the server. I downloaded a 1GB dump to my PC and started writing a Python script to read this file.
there he is

from scapy.all import *
from scapy.layers.inet import IP
pkts = rdpcap("ppsc.cap")

But that's bad luck) He reads small dumps (up to 100-200MB) But I have a dump as much as 1GB.
Because of this, the campaign gives me a MemoryLimit error in the console and stops the script from executing.
How to solve the problem and still read this damn cap file?
Maybe there are some other libraries.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iddqda, 2020-01-14
@iddqda

cut into small files with the same tspdump
tcpdump -r old_file -w new_files -C 10
but in general open with a wireshark and do whatever what for
python?
more precisely, I know why a python is needed, but judging by the 1G file, this is a one-time task
, and by the way, tshark from the wireshark package also knows how to script

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question