from scapy.all import AsyncSniffer
import queue
import threading

packet_queue = queue.Queue()

def packet_callback(packet):
    print(f"[+] Captured packet: {packet.summary()}")
    packet_queue.put(packet)
sniffer = AsyncSniffer(
    iface="br-12fb6e5258fa",
    filter="tcp port 443",
    prn=packet_callback,
    store=False
)

if __name__ == "__main__":
    print("[*] Starting live packet capture on ens33...")
    sniffer.start()

    try:
        while True:
            pass
    except KeyboardInterrupt:
        print("\n[*] Stopping capture...")
        sniffer.stop()
        print("[*] Capture stopped.")

