from scapy.all import sniff
def packet_callback(packet): if packet.haslayer("IP"): print(f"Paquete capturado: {packet['IP'].src} -> {packet['IP'].dst}")
sniff(filter="ip", prn=packet_callback, count=10)