1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] AttributeError: 'AsyncSniffer' object has no attribute 'stop_cb'

Discussão em 'Python' iniciado por Stack, Setembro 16, 2025.

  1. Stack

    Stack Membro Participativo

    When running the following code:

    import time
    from scapy.all import AsyncSniffer

    sniffy = AsyncSniffer(iface="wlp0s20f3", filter="not arpand not port 22")

    sniffy.start()
    time.sleep(1)
    sniffy.stop()


    I get:

    def stop(self, join=True):
    """Stops AsyncSniffer if not in async mode"""
    if self.running:
    try:
    > self.stop_cb()
    E AttributeError: 'AsyncSniffer' object has no attribute 'stop_cb'

    venv/lib/python3.8/site-packages/scapy/sendrecv.py:1017: AttributeError


    I found this similar question: Scapy AsyncSniffer fails if stop() is called right after start(). However, in my case the issue was not fixed although I added the sleep(1).

    I won't bore you by adding more debugging. By writing a minimal reproducible example, it became obvious: the filter is broken

    Continue reading...

Compartilhe esta Página