from scapy.all import *
pkts = rdpcap("lalalao.pcap")
for p in pkts:
## print p.time
if IP in p: #if packet has IP layer
src_ip = p[IP].src
dest_ip = p[IP].dst
print src_ip
f = open('IP_src.txt', 'a+')
for ip in src_ip:
f.writelines(ip)
f.close()
Wie schreibe ich jedes ip in einer anderen Zeile der Textdatei? Der Code funktioniert nicht!Wie schreibe ich jede IP-Adresse in eine andere Zeile einer Textdatei?