#!/usr/bin/python

from scapy.all import *

PacketList = []

def packetSpoof(pkt):
	
	source = IP()
	data = TCP()
	data = pkt[TCP].payload
	 
	packet = [source, data, data]
	PacketList.append(packet) 
	print(packet)	

pkt=sniff(filter="tcp", prn=packetSpoof)

ile = open("torDataFile.txt","w")
ListLength = len(PacketList)
for i in range(ListLength):
	file.write(PacketList[i])

file.close()
