Created
November 21, 2017 14:58
-
-
Save ymgve/4e1064e515d2b882307e1fb6fb674b28 to your computer and use it in GitHub Desktop.
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
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