Skip to content

Instantly share code, notes, and snippets.

@ymgve
Created November 21, 2017 14:58
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 ymgve/4e1064e515d2b882307e1fb6fb674b28 to your computer and use it in GitHub Desktop.
Save ymgve/4e1064e515d2b882307e1fb6fb674b28 to your computer and use it in GitHub Desktop.
import struct
f = open("onlyscanner.pcap", "rb")
of = open("packetdata.raw", "wb")
header = f.read(24)
while True:
pheader = f.read(16)
if len(pheader) == 0:
break
_, _, ilen, olen = struct.unpack("<IIII", pheader)
packet = f.read(olen)
of.write(packet[0x40:])
of.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment