Skip to content

Instantly share code, notes, and snippets.

View viz-prakash's full-sized avatar

Vijay Prakash viz-prakash

  • USA
View GitHub Profile
@viz-prakash
viz-prakash / scapy_packet_filter.py
Created January 27, 2020 02:55
Python script for Pcap parsing using Scapy, along with performance testing
#!/usr/bin/env python3
# -*- coding: ISO-8859-15 -*-
"""
This file contains some example methods of how pcaps can be parsed, filtered in different ways, and
converted to JSON representation with scapy and tshark(tshark is directly invoked on pcap).
It shows an example of how a tcp session can be extracted from a huge pcap consisting of multiple
sessions.
It also does a performance testing of those methods, but don't take the output as it is.