nerdexam
EC-Council

312-50V9 · Question #96

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 field-based syntax with comparison operators and logical keywords 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

(26 responses)
  • A
    12% (3)
  • B
    4% (1)
  • C
    4% (1)
  • D
    81% (21)

Why each option

Wireshark display filters use a field-based syntax with comparison operators and logical keywords to isolate traffic by protocol, port, and IP address.

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

The field 'tcp.src == 25' matches only traffic where port 25 is the source port, missing inbound traffic, and 'ip.host' alone does not correctly filter bidirectional host traffic in standard Wireshark syntax.

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 notation and would produce a parse error.

Cport 25 and host 192.168.0.125

'port 25 and host 192.168.0.125' is valid BPF capture filter syntax but does not restrict traffic to TCP specifically, and it uses BPF notation rather than Wireshark display filter field syntax.

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

The filter 'tcp.port == 25 and ip.host == 192.168.0.125' uses Wireshark display filter syntax, combining the protocol-specific port field (tcp.port) with a host address field joined by the logical AND operator. This correctly restricts results to TCP traffic only on port 25 for the specified IP in either direction, isolating SMTP communication to and from that host.

Concept tested: Wireshark display filter syntax for TCP port and host

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

Topics

#PCAP filter#display filter#TCP filtering#Wireshark syntax

Community Discussion

No community discussion yet for this question.

Full 312-50V9 Practice