Skip to content

Instantly share code, notes, and snippets.

@dzderic
Created October 12, 2012 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dzderic/3877408 to your computer and use it in GitHub Desktop.
Save dzderic/3877408 to your computer and use it in GitHub Desktop.
import dpkt, pcap
pc = pcap.pcap('lo')
pc.setfilter('tcp and dst host 127.0.0.1 and port 8080 and tcp[tcpflags] & (tcp-push) != 0')
for timestamp, packet in pc:
print repr(dpkt.ethernet.Ethernet(packet))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment