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] Run Pyshark on TCP Port interface?

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

  1. Stack

    Stack Membro Participativo

    In order to get the data I need from Tshark I run with the flags:

    tshark -i TCP@127.0.0.1:11111 -T ek


    and we are streaming data to the TCP port 11111.

    I'm trying to recreate this with pyshark:

    `capture = pyshark.LiveCapture(
    interface='Loopback',
    bpf_filter="tcp port 11111",
    tshark_path="/usr/bin/tshark",
    use_ek=True
    )`


    The problem is, pyshark only allows captures on certain interfaces, and capturing on the loopback interface rather than the specific TCP@127.0.0.1:11111 means the packets don't get properly dissected with my given Lua dissectors.

    Is there a way I can make the pyshark.LiveCapture give me the same dissected data as running tshark with my arguments?

    Tried many different interface options and even the "decode_as" flag did not work.

    Continue reading...

Compartilhe esta Página