Scapy/Pcap Reader
From charlesreid1
Creating a pcap file reader in Scapy.
The Summary
You will need a pcap file to begin with. (Use Tcpdump or some other utility.)
Once you've got your pcap file:
- Read in the pcap file
- Loop through each packet to gather some basic aggregate statistics
Read Pcap File
Start scapy:
$ scapy Welcome to Scapy (2.3.1) >>>
To read a pcap file, use the rdpcap() method and pass the absolute path to the pcap file:
>>> a=rdpcap("/path/to/capture.pcap")
Now you should be able to see the number of packets:
>>> len(a) 2055
| scapy a Python library for interfacing with network devices and analyzing packets from Python.
Building Wireless Utilities: Scapy/Airodump Clone · Scapy/AP Scanner Analyzing Conversations: Scapy/Conversations Database: Scapy/Wifi Database Category:Scapy · Category:Python · Category:Networking
|