S04 - Filtering Traffic
- Introduction
- Common Wireshark Filters
2. When filtering traffic with filters, the filter bar will be GREEN when correct, RED when there's something wrong, or YELLOW when it could be ambiguous
2. Capture Filters vs Display Filters
1. Display filters are applied after the fact, while investigating captured packets
2. A capture filter is applied when you're first bringing packets into the device
1. Only want to focus on a certain IP, etc.
2. Much simpler than display filters
1. Built using the Berkeley Packet Filter Syntax
3. Not as ideal as Display filters, because you're more likely to miss what you're actually looking for
3. Filtering Traffic
1. You can filter packets by protocol, but sometimes it's worth going deeper
1. e.g., filtering by http
will only reveal packets that include HTTP payloads, but not the three-way TCP handshake at the beginning
1. Filtering with tcp.port==80
WILL show the handshake, and any other traffic going over TCP port 80, which should only be HTTP and other related protocols
4. Filtering by Conversation
1. Think about the basis of your conversation
1. MAC address? IP? TCP sequence?
2. Right-click>Apply as Filter, Conversation Filter, etc.
5. Modifiers
1. There are common modifiers used by wireshark
2. You can use the "English" or shortcut version interchangeably
3.
- Save As vs Export
- "Save As" saves everything, filtered or not
- "Extract Specified Packets" allows you to choose which packets you want to export
- Activity
- How many DNS packets are in the trace file?
- Couple of ways to search:
dns
,udp.port==53
- 228 DNS packets
- Couple of ways to search:
- How many DNS packets contain the word "Udemy"? (Regardless of case)
dns matches "udemy"
- 20
- How many HTTP packets are in the pcap?
http
ortcp.port==80
- 66 with
http
, 211 with TCP
- Set a filter for TCP port 80. How many packets meet that filter?
tcp.port==80
- 211
- How many packets are in the top IP conversation? Set a filter for this conversation.
- OH, it's asking about the conversation with the most packets
- Statistics>Conversations>IPv4>Sort by Packets
- 406
- OH, it's asking about the conversation with the most packets
- In the top IP conversation, how many packets have the word "Udemy", regardless of case?
(ip.addr==10.0.2.15 && ip.addr==104.16.65.85) and frame matches "udemy"
- 3
- How many packets have the SYN bit set?
- Select, find SYN flag, Right-click>Apply as Filter>Selected
- 146
- How many TCP Resets are in the pcap?
tcp.flags.reset==1
- 9
- How many TCP SYN/ACKs are in the pcap?
tcp.flags.syn==1 and tcp.flags.ack==1
ortcp.flags==0x012
- 73
- Are any SYN/ACKs coming from the 10.0.2.15 station? Y/N?
tcp.flags.syn==1 and tcp.flags.ack==1 && ip.src==10.0.2.15
- No
- How many DNS packets are in the trace file?