3 # disable IPv6 error message
5 logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
6 from scapy.all import *
7 logging.getLogger("scapy.runtime").setLevel(logging.WARN)
8 from pprint import pprint
12 # disable payload parsing (saves two seconds runtime^^)
17 #for p in PcapReader('large_flow.pcap'):
18 for p in PcapReader(sys.argv[1]):
24 bin = "{0:016b}".format(id)
25 upper = int(bin[0:8], 2)
26 lower = int(bin[8:16], 2)
27 # print ("Upper: %s (%d), Lower: %s (%d)" % (bin[0:8], upper, bin[8:16], lower))
28 # print ("Full: %s" % (bin))
33 os.unlink('stream_encrypted')
34 except Exception as e:
35 # ignore if file is missing
37 with open('stream_encrypted', 'a+') as encfile:
41 os.unlink('stream_decrypted')
42 except Exception as e:
43 # ignore if file is missing
45 os.system('openssl enc -d -rc4 -nosalt -k nSa123 -in stream_encrypted -out stream_decrypted')