Skip to content

Instantly share code, notes, and snippets.

@mdfranz
Created November 10, 2024 14:09
Show Gist options
  • Save mdfranz/4416c3e95a304fb23e8ea90fa6bdf93c to your computer and use it in GitHub Desktop.
Save mdfranz/4416c3e95a304fb23e8ea90fa6bdf93c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys, pyshark
cap = pyshark.FileCapture(sys.argv[1])
for e in cap:
if 'IP' in e:
if 'TCP' in e:
print (e['eth'].src,e['ip'].src,e['eth'].dst,e['ip'].dst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment