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
11 # disable payload parsing (saves two seconds runtime^^)
16 for p in PcapReader('large_flow.pcap'):
22 bin = "{0:016b}".format(id)
23 upper = int(bin[0:8], 2)
24 lower = int(bin[8:16], 2)
25 print ("Upper: %s (%d), Lower: %s (%d)" % (bin[0:8], upper, bin[8:16], lower))
26 print ("Full: %s" % (bin))
31 os.unlink('stream_encrypted')
32 except Exception as e:
33 # ignore if file is missing
35 with open('stream_encrypted', 'a+') as encfile:
39 os.unlink('stream_decrypted')
40 except Exception as e:
41 # ignore if file is missing
43 os.system('openssl enc -d -rc4 -nosalt -k nSa123 -in stream_encrypted -out stream_decrypted')