Hello , i'am looking for a way to sniff the traffic in real time and save it on a cap file or csv so i can load it in logstash .
(i tried pyshark but i got a none csv file format while opening the file)
import os
import pyshark
#sniff de l'interface en temps réel
fichier = open("sniff.csv", "w") #création du fichier qui contiendra les capture
#Faire Une boucle infini
capture = pyshark.LiveCapture(interface ='eth0',decryption_key='',encryption_type='wpa-psk')
capture.sniff (timeout=10)
for pkt in capture:
pkt = str(pkt) #conversion en chaine de caractère
fichier.write(pkt) #Ecrtit le resultat mais pas sur le bon format
Thank you
(i tried pyshark but i got a none csv file format while opening the file)
import os
import pyshark
#sniff de l'interface en temps réel
fichier = open("sniff.csv", "w") #création du fichier qui contiendra les capture
#Faire Une boucle infini
capture = pyshark.LiveCapture(interface ='eth0',decryption_key='',encryption_type='wpa-psk')
capture.sniff (timeout=10)
for pkt in capture:
pkt = str(pkt) #conversion en chaine de caractère
fichier.write(pkt) #Ecrtit le resultat mais pas sur le bon format
Thank you