Ask Your Question
0

what is the capture filter for dns.flags.opcode==5

asked 2025-05-15 17:21:18 +0000

What is the equivalent of display filter dns.flags.opcode==5 if I want to apply it as a capture filter?

edit retag flag offensive close merge delete

Comments

Have you already constructed a capture filter to only capture DNS?

Chuckc gravatar imageChuckc ( 2025-05-15 17:33:35 +0000 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2025-05-15 18:19:20 +0000

Chuckc gravatar image

updated 2025-05-15 18:28:59 +0000

I haven't had luck generating a DNS packet with an opcode other than 0 so this hasn't been tested.

https://www.tcpdump.org/manpages/pcap...
(PACKET DATA ACCESSORS)

PACKET DATA ACCESSORS
To use the packet data in an arithmetic expression, use the following syntax:
proto [ expr : size ]

DNS RFC (https://datatracker.ietf.org/doc/html...):

The header contains the following fields:

                                    1  1  1  1  1  1
      0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    |                      ID                       |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    |QR|   Opcode  |AA|TC|RD|RA|   Z    |   RCODE   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
--- snip ---

There are 8 bytes/octets in a UDP header (0-7), then two for the DNS ID (UDP 8-9).
Try udp port 53 && udp[10] & 0x78 == 0x28

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2025-05-15 17:21:18 +0000

Seen: 40 times

Last updated: May 15