Skip to content

Instantly share code, notes, and snippets.

@nickylimjj
Created December 4, 2019 14:49
Show Gist options
  • Save nickylimjj/bf6727a4550ceabeb6158752a0b4a326 to your computer and use it in GitHub Desktop.
Save nickylimjj/bf6727a4550ceabeb6158752a0b4a326 to your computer and use it in GitHub Desktop.
[scapy] quickstart guide to parse pcaps
#!/usr/bin/env python3
from scapy.all import *
filename = "capture.pcap"
pcap = rdpcap(filename)
result = ''
for p in pcap[TCP]:
try:
result += p[IP].src
except IndexError:
continue
print( result )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment