Hi, is there a way to convert a file into a pcap file? i have a .raw file and i want to change it to a .pcap file. so far what i know is that .pcap has some sort of header or offset or something compared to other files. i have no idea what those headers are. i want to convert because i wanna see if the Wireshark would be able to read the file and it doesn't except .raw files.
|+0 forum 1|
Hello. I found this packet sniffer code that uses the pycap wrapper. Initially, its for live capture but I've changed it to read a .pcap file instead and im trying to understand it but some parts of it i can't i comprehend. could someone explain them to me please? the full code is: import socket from struct import pack, unpack import pcapy import sys def main(argv): dev = input("Enter file name to sniff : ") print("Sniffing file " + dev) # Read offline cap = pcapy.open_offline(dev) #start sniffing packets while(1) : (header, packet) = cap.next() parse_packet(packet) # change to string …
|+0 forum 0|