Mar-07-2019, 08:13 PM
Hey all,
I need help writing a code that can capture packets (pcap) from a dedicated port. All I need is for the code to capture the packet, timestamp it using the
I don't really know how to capture packets though. I am guessing I can use Scapy, PyShark, or PyPcap. I'm just hoping someone else out there knows a good deal about this.
I'm thinking:
I'm ok with doing a packet capture that saves all the packets to a pcap file for later use, I just need the timestamp to be from the
Thanks for the help!
I need help writing a code that can capture packets (pcap) from a dedicated port. All I need is for the code to capture the packet, timestamp it using the
datetime
module, and write it to a pcap or even a text file.I don't really know how to capture packets though. I am guessing I can use Scapy, PyShark, or PyPcap. I'm just hoping someone else out there knows a good deal about this.
I'm thinking:
time = datetime.datetime.now() packet = #capture command... f.write(str(time) + '\n' + str(packet)Does anyone know the capture command? Can it work like this?
I'm ok with doing a packet capture that saves all the packets to a pcap file for later use, I just need the timestamp to be from the
datetime
module because I am reading serial data in using this time source.Thanks for the help!