from scapy.all import sniff, IP, ICMP

def handle_pkt(pkt):
    if ICMP in pkt:
        src = pkt[IP].src
        dst = pkt[IP].dst
        print(f"[+] Ping from {src} -> {dst}")

print("[*] Listening for ICMP packets...")
sniff(filter="icmp", prn=handle_pkt)

