[Python] Why doesnt my script with windivert detect DNS packets?

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

  1. Stack

    Stack Membro Participativo

    On my project folder theres main.py, WinDivert.dll and WinDivert64.sys, ive tried to do other stuff with windivert and it worked so thats not the issue (i think)

    import pydivert
    from scapy.all import *

    filter = "udp.DstPort == 53 or udp.SrcPort == 53" # Only DNS packets

    with pydivert.WinDivert(filter) as w: # start sniffin
    for pkt in w:
    payload = pkt.payload # get the payload
    ipPacket = IP(payload) # make it a scapy packet
    ipPacket.summary() # show it
    w.send(pkt) # forward it


    Theres no errors, it just simple doesnt sniff any packets with the filter

    Continue reading...

Compartilhe esta Página