from scapy.all import rdpcap def analyze_pcap(file_path): packets = rdpcap(file_path) print(f"Total packets: {len(packets)}") for packet in packets: if packet.haslayer('IP'): print(f"Source: {packet['IP'].src}, Destination: {packet['IP'].dst}") pcap_file = input("Enter the path to the PCAP file: ") analyze_pcap(pcap_file)