SlideShare a Scribd company logo
NDI Communications - Engineering & Training
Network analysis Using Wireshark
Lesson 3 – Capture and Display Filters
Page 2
Lesson Objectives
By the end of this lesson, the participant will be able to:
Understand basic capture filters
Understand basic display filters
Perform basic packet filtering
Page 3
Chapter Content
Capture filters – basics and filter language
Display filters – basics and filter language
Case studies
Page 4
Capture Filters
Options:Capture
Filter options will be in the format:
[not] primitive [and|or [not] primitive ...]
Filter examples
ether host 00:08:15:00:08:15
host 192.168.0.1
tcp port http
tcp port 23 and src host 10.0.0.5
Double-Click
Page 5
Capture Filter Structure
A capture filter comes in the format:
[not] primitive [and|or [not] primitive ...]
A primitive is simply one of the following:
[src|dst] host <host>
ether [src|dst] host <ehost>
gateway host <host>
[src|dst] net <net> [{mask <mask>}|{len <len>}]
[tcp|udp] [src|dst] port <port>
less|greater <length>
ip|ether proto <protocol>
ether|ip broadcast|multicast
<expr> relop <expr>
Page 6
Basic Filters - Host Filters
Capture all packets where host is the
destination
dst host <host >
Capture all packets where host is the
source
src host <host>
host is either the ip address or host
name
host <host>
DescriptionSyntax
Examples:
Host 194.90.1.5; Host www.ynet.co.il; Src host 10.1.1.1;
Dst host 100.1.1.1
Page 7
Basic Filters - Port Filters
Capture all packets where port is
the destination port
dst port <port >
Capture all packets where port is
the source
src port <port>
Capture all packets where port is
either the source or destination
port <port>
DescriptionSyntax
Examples:
port 80; port 5060; Src port 139; Dst port http
Page 8
Basic Filters - Network Filters
Capture all packets where net is the
destination
dst net <net >
Capture all packets where net is the
source
src net <net>
Capture all packets to/from netnet <net>
DescriptionSyntax
Examples:
Net 192.168.2.0/24; src net 192.168.1.0/24; dst net 12.1.1.1
Page 9
Byte Offset Notation
proto [Offset in bytes from the start of the header:Number
of bytes to check]
Examples:
ip[8:1]
Go to byte 8 of the ip header and check one byte (TTL field)
tcp[0:2]
Go to the start of the tcp header and check 2 bytes (source port)
Capture filters examples:
http://wiki.wireshark.org/CaptureFilters
Page 10
Structured Filters
A capture filter takes the form of a series of primitive expressions
connected by conjunctions (and/or) and optionally preceded by not:
[not] primitive [and|or] [not] primitive ...
Examples:
A capture filter for telnet that captures traffic to and from a particular host
tcp port 23 and host 10.0.0.5
Capturing all telnet traffic not from 10.0.0.5
tcp port 23 and not src host 10.0.0.5
Page 11
Example #1– Capture traffic to
www.ynet.co.il
Capture filter definition:
Host www.ynet.co.il
Page 12
Examples #2
Capture only traffic to or from IP address 172.18.5.4:
host 172.18.5.4
Capture traffic to or from a range of IP addresses:
net 192.168.0.0/24 or
net 192.168.0.0 mask 255.255.255.0
Capture traffic from a range of IP addresses:
src net 192.168.0.0/24 or
src net 192.168.0.0 mask 255.255.255.0
Page 13
Examples #3
Capture traffic to a range of IP addresses:
dst net 192.168.0.0/24 or
dst net 192.168.0.0 mask 255.255.255.0
Capture only DNS (port 53) traffic:
port 53
Capture non-HTTP and non-SMTP traffic on your server (both
are equivalent):
host www.example.com and not (port 80 or port 25) host
www.example.com and not port 80 and not port 25
Page 14
Examples #4
Capture except all ARP and DNS traffic:
port not 53 and not arp
Capture traffic within a range of ports
(tcp[2:2] > 1500 and tcp[2:2] < 1550) or (tcp[4:2] > 1500 and tcp[4:2]
< 1550) or, with newer versions of libpcap (0.9.1 and later:
tcp portrange 1501-1549
Capture only Ethernet type EAPOL:
ether proto 0x888e
Page 15
Examples #5
Capture only IP traffic - the shortest filter, but sometimes very
useful to get rid of lower layer protocols like ARP and STP:
ip
Capture only unicast traffic - useful to get rid of noise on the
network if you only want to see traffic to and from your machine,
not, for example, broadcast and multicast announcements:
not broadcast and not multicast
Page 16
Chapter Content
Capture filters – basics and filter language
Display filters – basics and filter language
Case studies
Page 17
Display Filters
Page 18
Another way to Use Display Filters
Right click
The field you
Wand to filter
Field name appears here
Choose Prepare
Ro Apply filter
And choose
condition
Page 19
Details
Display filters allow you to concentrate on the packets you are
interested in while hiding the currently uninteresting ones. They allow
you to select packets by:
Protocol
The presence of a field
The values of fields
A comparison between fields
…... and a lot more
When using a display filter, all packets remain in the capture file. The
display filter only changes the display of the capture file but not its
content!
Page 20
Filter Comparison Operators
Frame.len <= 0x20
Frame.len ge 0x100
Frame.len < 1518
Frame.len > 64
Ip.src != 10.1.1.5
Ip.src == 10.1.1.5
Example
Less then or equal to<=le
Greaten then or equal to>=ge
Less Than<lt
Greater than>gt
Not equal!=ne
Equal==eq
DescriptionC-LikeShortcut
Page 21
Display Filter Field Types
There are several types of filter fields:
Unsigned integer (8-bit, 16-bit, 24-bit, 32-bit)
Boolean
Ethernet address (6 bytes)
IPv4 address
IPv6 address
Page 22
Unsigned integer
You can express integers in decimal, octal, or hexadecimal. The
following display filters are equivalent:
Decimal:
ip.len le 1500
Octal:
ip.len le 02734
Hexadecimal:
ip.len le 0x5DC
Page 23
Boolean
A boolean field is present in the protocol decode only if its value
is true.
For example, tcp.flags.syn is present, and thus true, only if the SYN
flag is present in a TCP segment header.
Thus the filter expression tcp.flags.syn will select only those
packets for which this flag exists, that is, TCP segments where
the segment header contains the SYN flag.
Page 24
Ethernet address (6 bytes)
Separators can be a colon (:), dot (.) or dash (-) and can have one
or two bytes between separators
Examples:
eth.dst == ff:ff:ff:ff:ff:ff
eth.dst == ff-ff-ff-ff-ff-ff
eth.dst == ffff.ffff.ffff
Page 25
IPv4 address
The common filter will be:
ip.addr == 192.168.0.1
Classless InterDomain Routing (CIDR) notation can be used to
test if an IPv4 address is in a certain subnet.
For example, this display filter will find all packets in the 129.111
Class-B network:
ip.addr == 129.111.0.0/16
Page 26
IPv6 address
ipv6.addr == ::1
ipv6.addr == 2041:0000:130F:0000:0000:09C0:876A:130B
ipv6.addr == 2053:0:130f::9c2:876a:130b
ipv6.addr == ::
Page 27
Combining Expressions
not ip
tr.dst[0:3] == 0.6.29 xor
tr.src[0:3] == 0.6.29
ip.scr == 10.0.0.5 or ip.src ==
192.1.1.1
ip.src == 10.0.0.5 and tcp.flags.fin
Example
Logical NOT!not
Logical XOR^^xor
Logical OR||or
Logical AND&&and
DescriptionC-LikeShortcut
Page 28
Substring Operators
Wireshark allows you to select subsequences of a sequence in rather elaborate
ways. After a label you can place a pair of brackets [ ] containing a comma
separated list of range specifiers.
eth.src[0:3] == 00:00:83
eth.src[1-2] == 00:83
eth.src[:4] == 00:00:83:00
eth.src[4:] == 20:20
eth.src[2] == 83
eth.src[0:3,1-2,:4,4:,2] == 00:00:83:00:83:00:00:83:00:20:20:83
Page 29
The "Filter Expression" dialog box
Protocol field
to be
checked
Operator to
be performed
Page 30
Example #6 – Filter Traffic Between
Hosts
SDSDSD
172.16.100.111
172.16.100.12
Port mirror to be configured
from the laptop, to
The Server port or
The PC port
Page 31
Example #7 – Filter Traffic Between
Hosts
ip.addr == 172.16.100.111 and ip.addr == 172.16.100.12
Page 32
Example #8 – Filter Traffic Between
Hosts
To ISP
Port mirror to be
configured from the
laptop, to the router port
192.168.101.253
Page 33
Example #9 – Filter Traffic Between
Hosts
ip.addr == 192.168.101.253
Page 34
Example #10 – Filtering ICMP
icmp
Page 35
Example #11 – Filtering Mail Traffic
tcp.port == 110
Page 36
Saving a Display Filter
When viewing the saved data, for
saving a display filter go to:
Analyze  Display Filters
And you will get:
Choose a name and save the
filter as defined
Page 37
Chapter Content
Capture filters – basics and filter language
Display filters – basics and filter language
Case studies
Page 38
Example #12 - DCERPC
DCERPC
Page 39
Example #13 - DCERPC
DCERPC
Spoolss runs over DCERPC and therefore
presented under this filter
Page 40
Example #14 - Retransmissions
tcp.analysis.retransmission
Page 41
Example #15 – Zero Window
tcp.analysis.zero_window
Page 42
Summary
For more information, technical data and many examples and case
studies:
http://www.amazon.com/Network-Analysis-Using-Wireshark-
Cookbook/dp/1849517649
Thanks!!!
Yoram Orzach
yoram@ndi-com.com
+972-52-4899699

More Related Content

PPT
Wireshark
PPT
Wireshark - presentation
PPTX
Wireshark
PPTX
Wireshark
PPTX
Wireshark
PDF
Penetration testing web application web application (in) security
PDF
Suricata
PPTX
Packet analysis using wireshark
Wireshark
Wireshark - presentation
Wireshark
Wireshark
Wireshark
Penetration testing web application web application (in) security
Suricata
Packet analysis using wireshark

What's hot (20)

PPTX
Firewall
PPTX
Wireshark
PPTX
Wireshark
PPTX
Wireshark Packet Analyzer.pptx
PPTX
PPTX
Wireshark Basic Presentation
PDF
WEBSOCKET Protokolünün Derinlemesine İncelenmesi
PPTX
F5 tcpdump
PPTX
GRE Tunnel Configuration
DOCX
Mikrotik basic configuration
PDF
Tp snmp-packet-tracer
PDF
BGP on mikrotik
DOCX
PPTX
Wireshark network analysing software
PDF
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
PDF
Clase practica seguridad escaneo con nma pf
PDF
Wireshark Tutorial
PPTX
Vulnerabilities in modern web applications
PDF
Vpn site to site avec les équipements JUNIPER
Firewall
Wireshark
Wireshark
Wireshark Packet Analyzer.pptx
Wireshark Basic Presentation
WEBSOCKET Protokolünün Derinlemesine İncelenmesi
F5 tcpdump
GRE Tunnel Configuration
Mikrotik basic configuration
Tp snmp-packet-tracer
BGP on mikrotik
Wireshark network analysing software
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
Clase practica seguridad escaneo con nma pf
Wireshark Tutorial
Vulnerabilities in modern web applications
Vpn site to site avec les équipements JUNIPER
Ad

Viewers also liked (20)

PPT
Wireshark Inroduction Li In
PDF
Ch 07 -- The Expert System
PDF
Wireshark course, Ch 05: Advanced statistics tools
PDF
Wireshark course, Ch 02: Introduction to wireshark
PDF
Ch 06 -- Bandwidth Delay and Jitter Issues
PDF
Network Analysis Using Wireshark 1
PPT
Wireshark Basics
PPT
OSTU - Wireshark Capture Filters (by Ray Tompkins)
PDF
Ch 03 --- the OpenFlow protocols
PDF
Ch 04 --- sdn deployment models
PPTX
Introduction To Cellular And Wireless Networks
PDF
Ch 05 --- nfv basics
PDF
Wireshark ppt
PDF
Ch 09 -- ARP & IP Analysis
PDF
[NCTU] [CCCA] Network Security I
PDF
Nmap commands
ODP
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
PPT
SSL basics and SSL packet analysis using wireshark
PDF
Ch 08 -- Ethernet & LAN Switching Troubleshooting
PPTX
Reconnaissance - For pentesting and user awareness
Wireshark Inroduction Li In
Ch 07 -- The Expert System
Wireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 02: Introduction to wireshark
Ch 06 -- Bandwidth Delay and Jitter Issues
Network Analysis Using Wireshark 1
Wireshark Basics
OSTU - Wireshark Capture Filters (by Ray Tompkins)
Ch 03 --- the OpenFlow protocols
Ch 04 --- sdn deployment models
Introduction To Cellular And Wireless Networks
Ch 05 --- nfv basics
Wireshark ppt
Ch 09 -- ARP & IP Analysis
[NCTU] [CCCA] Network Security I
Nmap commands
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
SSL basics and SSL packet analysis using wireshark
Ch 08 -- Ethernet & LAN Switching Troubleshooting
Reconnaissance - For pentesting and user awareness
Ad

Similar to Wireshark course, Ch 03: Capture and display filters (20)

PDF
Network analysis Using Wireshark 4: Capture Filters
PPT
wiresharktslecturev10006july2009-12501942038813-phpapp03.ppt
PPTX
Workshop Wireshark
PPT
Traffic monitoring
PDF
Ferramenta de análise de rede para windows e linux
PDF
wireshark.pdf
PPT
Traffic-Monitoring.ppt
PPT
Traffic-Monitoring.ppt
PPT
Traffic-Monitoring.ppt
PDF
Wireshark lecture
PDF
Wireshark lecture
PPT
OSTU - Wireshark Display Filters (by Ray Tompkins)
PDF
Network Analysis using Wireshark 5: display filters
PDF
How can you configure Wireshark to always recognize port 444 as an S.pdf
PDF
Wireshark 101 - OWASP Chandigarh Meetup - CyberForge Academy
PPTX
Presentation on wireshark
PDF
Wireshark Tutorial, Wireshark Tutorial, Wireshark Tutorial
PDF
Uccn1003 -may10_-_lab_09_-_wireshark_analysis_live_capture
PPTX
Wireshark.pptx
PDF
Network analysis Using Wireshark 4: Capture Filters
wiresharktslecturev10006july2009-12501942038813-phpapp03.ppt
Workshop Wireshark
Traffic monitoring
Ferramenta de análise de rede para windows e linux
wireshark.pdf
Traffic-Monitoring.ppt
Traffic-Monitoring.ppt
Traffic-Monitoring.ppt
Wireshark lecture
Wireshark lecture
OSTU - Wireshark Display Filters (by Ray Tompkins)
Network Analysis using Wireshark 5: display filters
How can you configure Wireshark to always recognize port 444 as an S.pdf
Wireshark 101 - OWASP Chandigarh Meetup - CyberForge Academy
Presentation on wireshark
Wireshark Tutorial, Wireshark Tutorial, Wireshark Tutorial
Uccn1003 -may10_-_lab_09_-_wireshark_analysis_live_capture
Wireshark.pptx

More from Yoram Orzach (15)

PDF
Network analysis Using Wireshark Lesson 1- introduction to network troublesho...
PDF
Network analysis Using Wireshark Lesson 12 - bandwidth and delay issues
PDF
Network analysis Using Wireshark Lesson 11: TCP and UDP Analysis
PDF
Network Analysis Using Wireshark Jan 18- seminar
PDF
Network Analysis Using Wireshark -10- arp and ip analysis
PDF
Network Analysis Using Wireshark Chapter 09 ethernet and lan switching
PDF
Network Analysis Using Wireshark Chapter 08 the expert system
PDF
lesson 7- Network analysis Using Wireshark - advanced statistics tools
PDF
Network Analysis Using Wireshark -Chapter 6- basic statistics tools
PDF
Network analysis Using Wireshark Lesson 3: locating wireshark
PDF
lesson 2- Network analysis Using Wireshark introduction to cellular feb-2017
PDF
Ch 02 --- sdn and openflow architecture
PDF
Ch 01 --- introduction to sdn-nfv
PDF
Wireshark - Basics
PDF
Introduction To Cellular Networks
Network analysis Using Wireshark Lesson 1- introduction to network troublesho...
Network analysis Using Wireshark Lesson 12 - bandwidth and delay issues
Network analysis Using Wireshark Lesson 11: TCP and UDP Analysis
Network Analysis Using Wireshark Jan 18- seminar
Network Analysis Using Wireshark -10- arp and ip analysis
Network Analysis Using Wireshark Chapter 09 ethernet and lan switching
Network Analysis Using Wireshark Chapter 08 the expert system
lesson 7- Network analysis Using Wireshark - advanced statistics tools
Network Analysis Using Wireshark -Chapter 6- basic statistics tools
Network analysis Using Wireshark Lesson 3: locating wireshark
lesson 2- Network analysis Using Wireshark introduction to cellular feb-2017
Ch 02 --- sdn and openflow architecture
Ch 01 --- introduction to sdn-nfv
Wireshark - Basics
Introduction To Cellular Networks

Recently uploaded (20)

PPTX
Internet___Basics___Styled_ presentation
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
Introduction to the IoT system, how the IoT system works
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
SAP Ariba Sourcing PPT for learning material
PDF
Testing WebRTC applications at scale.pdf
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PPTX
Introduction to Information and Communication Technology
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPTX
presentation_pfe-universite-molay-seltan.pptx
Internet___Basics___Styled_ presentation
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Introduction to the IoT system, how the IoT system works
PptxGenJS_Demo_Chart_20250317130215833.pptx
Slides PPTX World Game (s) Eco Economic Epochs.pptx
SAP Ariba Sourcing PPT for learning material
Testing WebRTC applications at scale.pdf
introduction about ICD -10 & ICD-11 ppt.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Module 1 - Cyber Law and Ethics 101.pptx
Introduction to Information and Communication Technology
international classification of diseases ICD-10 review PPT.pptx
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
Unit-1 introduction to cyber security discuss about how to secure a system
Power Point - Lesson 3_2.pptx grad school presentation
presentation_pfe-universite-molay-seltan.pptx

Wireshark course, Ch 03: Capture and display filters

  • 1. NDI Communications - Engineering & Training Network analysis Using Wireshark Lesson 3 – Capture and Display Filters
  • 2. Page 2 Lesson Objectives By the end of this lesson, the participant will be able to: Understand basic capture filters Understand basic display filters Perform basic packet filtering
  • 3. Page 3 Chapter Content Capture filters – basics and filter language Display filters – basics and filter language Case studies
  • 4. Page 4 Capture Filters Options:Capture Filter options will be in the format: [not] primitive [and|or [not] primitive ...] Filter examples ether host 00:08:15:00:08:15 host 192.168.0.1 tcp port http tcp port 23 and src host 10.0.0.5 Double-Click
  • 5. Page 5 Capture Filter Structure A capture filter comes in the format: [not] primitive [and|or [not] primitive ...] A primitive is simply one of the following: [src|dst] host <host> ether [src|dst] host <ehost> gateway host <host> [src|dst] net <net> [{mask <mask>}|{len <len>}] [tcp|udp] [src|dst] port <port> less|greater <length> ip|ether proto <protocol> ether|ip broadcast|multicast <expr> relop <expr>
  • 6. Page 6 Basic Filters - Host Filters Capture all packets where host is the destination dst host <host > Capture all packets where host is the source src host <host> host is either the ip address or host name host <host> DescriptionSyntax Examples: Host 194.90.1.5; Host www.ynet.co.il; Src host 10.1.1.1; Dst host 100.1.1.1
  • 7. Page 7 Basic Filters - Port Filters Capture all packets where port is the destination port dst port <port > Capture all packets where port is the source src port <port> Capture all packets where port is either the source or destination port <port> DescriptionSyntax Examples: port 80; port 5060; Src port 139; Dst port http
  • 8. Page 8 Basic Filters - Network Filters Capture all packets where net is the destination dst net <net > Capture all packets where net is the source src net <net> Capture all packets to/from netnet <net> DescriptionSyntax Examples: Net 192.168.2.0/24; src net 192.168.1.0/24; dst net 12.1.1.1
  • 9. Page 9 Byte Offset Notation proto [Offset in bytes from the start of the header:Number of bytes to check] Examples: ip[8:1] Go to byte 8 of the ip header and check one byte (TTL field) tcp[0:2] Go to the start of the tcp header and check 2 bytes (source port) Capture filters examples: http://wiki.wireshark.org/CaptureFilters
  • 10. Page 10 Structured Filters A capture filter takes the form of a series of primitive expressions connected by conjunctions (and/or) and optionally preceded by not: [not] primitive [and|or] [not] primitive ... Examples: A capture filter for telnet that captures traffic to and from a particular host tcp port 23 and host 10.0.0.5 Capturing all telnet traffic not from 10.0.0.5 tcp port 23 and not src host 10.0.0.5
  • 11. Page 11 Example #1– Capture traffic to www.ynet.co.il Capture filter definition: Host www.ynet.co.il
  • 12. Page 12 Examples #2 Capture only traffic to or from IP address 172.18.5.4: host 172.18.5.4 Capture traffic to or from a range of IP addresses: net 192.168.0.0/24 or net 192.168.0.0 mask 255.255.255.0 Capture traffic from a range of IP addresses: src net 192.168.0.0/24 or src net 192.168.0.0 mask 255.255.255.0
  • 13. Page 13 Examples #3 Capture traffic to a range of IP addresses: dst net 192.168.0.0/24 or dst net 192.168.0.0 mask 255.255.255.0 Capture only DNS (port 53) traffic: port 53 Capture non-HTTP and non-SMTP traffic on your server (both are equivalent): host www.example.com and not (port 80 or port 25) host www.example.com and not port 80 and not port 25
  • 14. Page 14 Examples #4 Capture except all ARP and DNS traffic: port not 53 and not arp Capture traffic within a range of ports (tcp[2:2] > 1500 and tcp[2:2] < 1550) or (tcp[4:2] > 1500 and tcp[4:2] < 1550) or, with newer versions of libpcap (0.9.1 and later: tcp portrange 1501-1549 Capture only Ethernet type EAPOL: ether proto 0x888e
  • 15. Page 15 Examples #5 Capture only IP traffic - the shortest filter, but sometimes very useful to get rid of lower layer protocols like ARP and STP: ip Capture only unicast traffic - useful to get rid of noise on the network if you only want to see traffic to and from your machine, not, for example, broadcast and multicast announcements: not broadcast and not multicast
  • 16. Page 16 Chapter Content Capture filters – basics and filter language Display filters – basics and filter language Case studies
  • 18. Page 18 Another way to Use Display Filters Right click The field you Wand to filter Field name appears here Choose Prepare Ro Apply filter And choose condition
  • 19. Page 19 Details Display filters allow you to concentrate on the packets you are interested in while hiding the currently uninteresting ones. They allow you to select packets by: Protocol The presence of a field The values of fields A comparison between fields …... and a lot more When using a display filter, all packets remain in the capture file. The display filter only changes the display of the capture file but not its content!
  • 20. Page 20 Filter Comparison Operators Frame.len <= 0x20 Frame.len ge 0x100 Frame.len < 1518 Frame.len > 64 Ip.src != 10.1.1.5 Ip.src == 10.1.1.5 Example Less then or equal to<=le Greaten then or equal to>=ge Less Than<lt Greater than>gt Not equal!=ne Equal==eq DescriptionC-LikeShortcut
  • 21. Page 21 Display Filter Field Types There are several types of filter fields: Unsigned integer (8-bit, 16-bit, 24-bit, 32-bit) Boolean Ethernet address (6 bytes) IPv4 address IPv6 address
  • 22. Page 22 Unsigned integer You can express integers in decimal, octal, or hexadecimal. The following display filters are equivalent: Decimal: ip.len le 1500 Octal: ip.len le 02734 Hexadecimal: ip.len le 0x5DC
  • 23. Page 23 Boolean A boolean field is present in the protocol decode only if its value is true. For example, tcp.flags.syn is present, and thus true, only if the SYN flag is present in a TCP segment header. Thus the filter expression tcp.flags.syn will select only those packets for which this flag exists, that is, TCP segments where the segment header contains the SYN flag.
  • 24. Page 24 Ethernet address (6 bytes) Separators can be a colon (:), dot (.) or dash (-) and can have one or two bytes between separators Examples: eth.dst == ff:ff:ff:ff:ff:ff eth.dst == ff-ff-ff-ff-ff-ff eth.dst == ffff.ffff.ffff
  • 25. Page 25 IPv4 address The common filter will be: ip.addr == 192.168.0.1 Classless InterDomain Routing (CIDR) notation can be used to test if an IPv4 address is in a certain subnet. For example, this display filter will find all packets in the 129.111 Class-B network: ip.addr == 129.111.0.0/16
  • 26. Page 26 IPv6 address ipv6.addr == ::1 ipv6.addr == 2041:0000:130F:0000:0000:09C0:876A:130B ipv6.addr == 2053:0:130f::9c2:876a:130b ipv6.addr == ::
  • 27. Page 27 Combining Expressions not ip tr.dst[0:3] == 0.6.29 xor tr.src[0:3] == 0.6.29 ip.scr == 10.0.0.5 or ip.src == 192.1.1.1 ip.src == 10.0.0.5 and tcp.flags.fin Example Logical NOT!not Logical XOR^^xor Logical OR||or Logical AND&&and DescriptionC-LikeShortcut
  • 28. Page 28 Substring Operators Wireshark allows you to select subsequences of a sequence in rather elaborate ways. After a label you can place a pair of brackets [ ] containing a comma separated list of range specifiers. eth.src[0:3] == 00:00:83 eth.src[1-2] == 00:83 eth.src[:4] == 00:00:83:00 eth.src[4:] == 20:20 eth.src[2] == 83 eth.src[0:3,1-2,:4,4:,2] == 00:00:83:00:83:00:00:83:00:20:20:83
  • 29. Page 29 The "Filter Expression" dialog box Protocol field to be checked Operator to be performed
  • 30. Page 30 Example #6 – Filter Traffic Between Hosts SDSDSD 172.16.100.111 172.16.100.12 Port mirror to be configured from the laptop, to The Server port or The PC port
  • 31. Page 31 Example #7 – Filter Traffic Between Hosts ip.addr == 172.16.100.111 and ip.addr == 172.16.100.12
  • 32. Page 32 Example #8 – Filter Traffic Between Hosts To ISP Port mirror to be configured from the laptop, to the router port 192.168.101.253
  • 33. Page 33 Example #9 – Filter Traffic Between Hosts ip.addr == 192.168.101.253
  • 34. Page 34 Example #10 – Filtering ICMP icmp
  • 35. Page 35 Example #11 – Filtering Mail Traffic tcp.port == 110
  • 36. Page 36 Saving a Display Filter When viewing the saved data, for saving a display filter go to: Analyze  Display Filters And you will get: Choose a name and save the filter as defined
  • 37. Page 37 Chapter Content Capture filters – basics and filter language Display filters – basics and filter language Case studies
  • 38. Page 38 Example #12 - DCERPC DCERPC
  • 39. Page 39 Example #13 - DCERPC DCERPC Spoolss runs over DCERPC and therefore presented under this filter
  • 40. Page 40 Example #14 - Retransmissions tcp.analysis.retransmission
  • 41. Page 41 Example #15 – Zero Window tcp.analysis.zero_window
  • 42. Page 42 Summary For more information, technical data and many examples and case studies: http://www.amazon.com/Network-Analysis-Using-Wireshark- Cookbook/dp/1849517649 Thanks!!! Yoram Orzach yoram@ndi-com.com +972-52-4899699