Created
March 15, 2018 06:26
-
-
Save zaftzaft/e3a0f8ee7abb2e7c650a667e6b8950db 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
#!/usr/bin/env python3 | |
import argparse | |
import logging | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
from scapy.all import * | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-r", "--read", required=True, help="filename", default=None) | |
args = parser.parse_args() | |
pkts = rdpcap(args.read) | |
eth = bytes(pkts[0]) | |
i = 0 | |
while True: | |
print("{} : {}".format(i+1, eth[i*4:i*4+4].hex().upper())) | |
i += 1 | |
if i*4 > len(eth): | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment