Created
December 4, 2019 14:49
-
-
Save nickylimjj/bf6727a4550ceabeb6158752a0b4a326 to your computer and use it in GitHub Desktop.
[scapy] quickstart guide to parse pcaps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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