Skip to content

Basic library for converting PCAP files into JSON files. Idea is that ML code is already well suited for parsing JSON, so make it easier to feed a PCAP to ML code.

License

Notifications You must be signed in to change notification settings

cas1m1r/PCAP2JSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCAP2JSON

Basic library for converting PCAP files into JSON files. Idea is that ML code is already well suited for parsing JSON, so make it easier to feed a PCAP to ML code.

Dependencies

  • pyshark
  • tqdm

Usage

capture = CAP('example.pcap')
capture.save()

Future Improvements

This is the alternate approach I came up with. First was to parse each packet based on protocol type, but this creates a somewhat complicated structure to maintain. Using a dynamically evaluated expression to decode packet fields allowed me to remove all of these classes and create a single function (at the cost of performance). Revisiting previous or new approaches that are more efficient will be a next step.

About

Basic library for converting PCAP files into JSON files. Idea is that ML code is already well suited for parsing JSON, so make it easier to feed a PCAP to ML code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages