nerdexam
EC-Council

312-50V11 · Question #322

What is the correct PCAP filter to capture all TCP traffic going to or from host 192.168.0.125 on port 25?

The correct answer is D. tcp.port == 25 and ip.host == 192.168.0.125. Wireshark display filters use a structured field-based syntax requiring valid field names and comparison operators to isolate traffic by protocol, port, and IP address.

Sniffing

Question

What is the correct PCAP filter to capture all TCP traffic going to or from host 192.168.0.125 on port 25?

Options

  • Atcp.src == 25 and ip.host == 192.168.0.125
  • Bhost 192.168.0.125:25
  • Cport 25 and host 192.168.0.125
  • Dtcp.port == 25 and ip.host == 192.168.0.125

How the community answered

(57 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    2% (1)
  • D
    93% (53)

Why each option

Wireshark display filters use a structured field-based syntax requiring valid field names and comparison operators to isolate traffic by protocol, port, and IP address.

Atcp.src == 25 and ip.host == 192.168.0.125

tcp.src == 25 is not a valid Wireshark display filter field (the correct field is tcp.srcport), and it would only match traffic originating from port 25, missing traffic destined for port 25.

Bhost 192.168.0.125:25

The syntax host 192.168.0.125:25 is not valid in either BPF capture filter or Wireshark display filter syntax; host and port must be declared as separate filter primitives joined by a logical operator.

Cport 25 and host 192.168.0.125

port 25 and host 192.168.0.125 is valid BPF/libpcap capture filter syntax used by tcpdump, not Wireshark display filter syntax, so it cannot be entered in the Wireshark display filter bar.

Dtcp.port == 25 and ip.host == 192.168.0.125Correct

In Wireshark display filter syntax, tcp.port == 25 matches TCP segments where either the source or destination port equals 25, and ip.host == 192.168.0.125 matches packets where that address appears as either source or destination. Combining both with 'and' correctly captures all TCP port 25 traffic flowing to or from the specified host.

Concept tested: Wireshark display filter syntax for host and port

Source: https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html

Topics

#PCAP filter syntax#Wireshark filters#TCP port filter#host filter

Community Discussion

No community discussion yet for this question.

Full 312-50V11 Practice