Full Practical
Full Practical
In Wireshark, you can use display filters to focus on specific protocols like HTTP, TCP, and
UDP. Here are the commands for filtering these protocols:
HTTP operates over TCP, typically on port 80 (unencrypted). To filter HTTP traffic, you can use
the following filters:
http
http.request.method == "GET"
http.request.method == "POST"
http.request
http.response
TCP is a connection-oriented protocol. You can filter based on different TCP parameters.
tcp
Practicals of CNAM Subject List
tcp.port == 80
UDP is a connectionless protocol, often used for DNS, DHCP, and other lightweight protocols.
udp
Filter for UDP traffic on a specific port (e.g., DNS on port 53):
udp.port == 53
Combining Filters
You can combine these filters using logical operators like && (AND), || (OR), and ! (NOT).
These filters can help you focus on the specific network traffic you want to analyze in
Wireshark. Tools
Practicals of CNAM Subject List
Ans:-
To fill in the Ethernet Traffic Distribution by Protocols table, you can follow these steps
using Wireshark:
Steps:
Table to Fill
After recording the data from Protocol Hierarchy, the SUMM of the traffic percentage should
be 100%.
Application Protocols:
These typically include HTTP, FTP, Mail (SMTP/POP/IMAP), DNS over UDP/TCP, etc.
These are higher-level protocols used by applications.
Service Protocols:
These include DNS, ICMP, ARP, and any protocol used for network services and control.
Examples: ARP, ICMP, DHCP, DNS (in service context), etc.
1. Count the number of packets for application protocols (e.g., HTTP, FTP, etc.).
o You can get this from the Protocol Hierarchy under the appropriate sections (e.g., HTTP
under TCP).
2. Count the number of packets for service protocols (e.g., DNS, ICMP, ARP, etc.).
o Again, get this from the Protocol Hierarchy.
Practicals of CNAM Subject List
Practicals of CNAM Subject List
To fill in the table based on Wireshark's Capture File Properties and compute the relative
network load (L), follow these steps:
Steps:
Table to Fill
Nr Parameter Value
1 Time of capture, min (from Wireshark)
2 Packets (from Wireshark)
3 Bytes, MiB (from Wireshark)
4 Average packet size, B (from Wireshark)
5 Average packets per second, pps (from Wireshark)
6 Average bytes per second, B/s (from Wireshark)
7 Relative Network Load, L (%) Calculated (see below)
Practicals of CNAM Subject List
Practicals of CNAM Subject List
Practical 4 – Capture Data Packets using WireShark Tool Using Ipv4 and Ipv6 Protocol filter
commands
This is for IPv4
IPv4 traffic
ip
ip.addr == 192.168.1.1
ip.src == 192.168.1.1
ip.dst == 192.168.1.1
!(ip.addr == 192.168.1.1)
ip.flags.mf == 1
Filter packets based on total length (e.g., for packets larger than 1500 bytes):
ip.ttl == 64
Here are some easy and commonly used IPv6 filter commands for Wireshark:
Example
ipv6.src == 2001:db8::1
Example:
ipv6.dst == 2001:db8::2
Example:
ipv6.addr == 2001:db8::1
ipv6.dst[0] == ff
ipv6.tclass == <value>
Example:
ipv6.tclass == 0x10
8. To filter for IPv6 packets with a specific source address and ICMPv6 type:
Practical – 5
Ans:- To customize Wireshark for specific analysis, you can create custom columns and apply
custom coloring rules to enhance the visibility and analysis of packet data. Here's how you can
accomplish these tasks:
Custom columns allow you to display additional information in Wireshark’s packet list, such as
specific protocol fields or packet properties.
2. Right-click on any existing column header (like "No." or "Source") and choose
"Column Preferences...".
Practicals of CNAM Subject List
o Click on the new column you added, and in the Fields section, enter the display
filter name of the field you want to add.
o For example, to display the Time to Live (TTL), use:
ip.ttl
tcp.flags
5. Click OK to save the changes. The new column will now appear in the packet list,
displaying the chosen field.
Source Port:
tcp.srcport or udp.srcport
Destination Port:
tcp.dstport or udp.dstport
tcp.seq
ICMP Type:
icmp.type
Custom coloring rules make it easier to visually distinguish specific types of traffic or packets of
interest.
ICMP Traffic:
o Filter: icmp
o Foreground: White
o Background: Red (to highlight ICMP traffic like pings)
TCP Traffic:
o Filter: tcp
o Foreground: Black
o Background: Light Green (to easily identify TCP traffic)
UDP Traffic:
o Filter: udp
o Foreground: Black
o Background: Light Blue (for UDP traffic)
DNS Requests:
o Filter: dns
o Foreground: Black
o Background: Yellow (to highlight DNS queries)
You can move your rules up or down in the list to prioritize which rules should apply
first.
The topmost rules in the list take precedence, so more general rules like "TCP traffic"
should be lower, while more specific ones (like DNS or ICMP) should be higher.
Practicals of CNAM Subject List
Summary:
Custom Columns help you display specific packet details, such as TTL, TCP Flags, or
custom protocol information.
Coloring Rules enhance visual analysis by highlighting different traffic types, making
important patterns or issues stand out.
By customizing Wireshark this way, you can streamline your analysis process for specific types
of traffic or protocol behaviors.
Practical – 6
Protocol Hierarchy Statistics give you a breakdown of the different protocols present in your
capture, showing you how the traffic is distributed among them.
Steps:
1. Open Wireshark and Load the Capture File:
Start Wireshark and either begin capturing traffic or open a pre-existing capture
file.
Practicals of CNAM Subject List
IO Graphs (Input/Output Graphs) allow you to visualize traffic trends over time, helping you
identify patterns, spikes, or drops in traffic.
Steps:
1. Open Wireshark and Load the Capture File:
Open the capture file that you want to analyze.
Practicals of CNAM Subject List
2. Access IO Graphs:
Go to the menu and click on Statistics > IO Graphs.
3. Configure the Graph:
The IO Graphs window will open with a default graph showing packets per
second over time.
Set Y Axis: Choose what you want to plot on the Y-axis, such as the number of
packets, bytes, or specific field values.
Set X Axis: The X-axis typically represents time, but you can adjust the interval
(e.g., every second, every minute) depending on your needs.
Steps:
1. Open Wireshark and Load the Capture File:
Open the relevant capture file in Wireshark.
Identify Anomalies: Look for unusual patterns or disruptions in the flow, which
might indicate problems such as packet loss or out-of-order delivery.
Practical 7
Examine DNS Requests and Response
Objective: Capture and analyze DNS traffic.
To capture and analyze DNS traffic, you can use network analysis tools like Wireshark. Below
are the detailed steps for capturing and analyzing DNS traffic:
2. Inspect DNS Responses: Analyze DNS response packets to see how the queries were
resolved. The response will include:
Example Analysis:
DNS Query: You might see a packet with a query for www.example.com. The type field in
the query might show A if it's requesting an IPv4 address.
DNS Response: The response packet might show that www.example.com resolves to
93.184.216.34. It will have the same Transaction ID as the query, and the response will include
the IP address in the "Answers" section.
Additional Tips:
Practicals of CNAM Subject List
Follow Streams: Wireshark allows you to follow the DNS stream to see the entire conversation
between the client and server.
Statistics: Use Wireshark's statistics tools to get an overview of DNS traffic, including the
number of queries and responses, as well as any potential issues.
By following these steps, you can effectively capture and analyze DNS traffic to understand how
domain names are resolved on your network.
Wireshark provides a range of display filters to help you isolate and analyze DNS traffic more
precisely. Here’s a comprehensive list of useful DNS-related display filters you can use in
Wireshark:
dns
Purpose: Displays all DNS packets (both queries and responses).
dns.flags.response == 0
Purpose: Shows DNS queries (requests for information).
dns.qry.name == "example.com"
Purpose: Displays DNS queries for a specific domain (e.g., example.com).
dns.qry.type == 1
Purpose: Shows DNS queries for A records (IPv4 addresses). For other record types,
change the number (e.g., 2 for AAAA, 15 for MX).
dns.flags.response == 1
Purpose: Shows DNS responses (answers to queries).
dns.a == 93.184.216.34
Purpose: Displays DNS responses containing a specific IP address (e.g., 93.184.216.34).
dns.resp.name == "example.com"
Purpose: Displays DNS responses for a specific domain.
dns.qry.type == 1
Purpose: Filters DNS queries for A records.
dns.qry.type == 28
Practicals of CNAM Subject List
dns.flags.qr == 1
Purpose: Displays DNS response packets (where the QR flag is set to 1).
dns.flags.qr == 0
Purpose: Displays DNS query packets (where the QR flag is set to 0).
dns.flags.rcode == 3
Purpose: Shows DNS responses with a specific response code, such as "Name Error"
(Non- Existent Domain).
Combining Filters
You can combine filters to refine your search. For example:
Practical Tips
Auto-complete: Wireshark’s filter bar supports auto-completion. As you start typing a filter
expression, Wireshark will suggest possible completions.
Save Filters: You can save frequently used filters in Wireshark for easy access later.
Use Colorization: You can set up color rules in Wireshark to highlight DNS packets based on
specific filters or criteria, which can help in quickly identifying important traffic.
By using these filters, you can effectively drill down into DNS traffic and analyze specific
aspects of DNS queries and responses.
Colorization in Wireshark helps visually distinguish different types of network traffic, making it
easier to identify and analyze specific packets. You can set up color rules to highlight packets
based on various criteria, including DNS traffic. Here's a step-by-step guide to setting up and
using colorization in Wireshark:
Setting Up Colorization in Wireshark
Colorization in Wireshark enhances your ability to quickly identify and analyze different
types of network traffic, making it a powerful tool for network troubleshooting and
analysis.
Practical - 8
Identify and Analyze ARP Traffic
Steps: Start a capture session. Apply a filter for ARP traffic (arp).
Ans :- Analyzing Address Resolution Protocol (ARP) traffic with Wireshark helps you
understand how IP addresses are mapped to MAC addresses on your network. Here’s a step-by-
step guide to capturing and analyzing ARP packets:
a. Open Wireshark
Launch Wireshark on your computer.
Filter: arp
ARP.
“Conversation” feature:
1. Go to Statistics > Protocol Hierarchy and look for ARP in the list.
2. This will give you an overview of how much ARP traffic is present compared to other
protocols.
-to-MAC mappings:
ARP Role
Address Resolution Protocol (ARP) is a very fundamental protocol in computer networking.
When a PC wants to send a message over the network, it has to encapsulate the data down the
layers of the OSI model. At each layer, it has to fill all header information such as TCP/UDP
ports in the layer 4 header, source, and destination IP addresses in the Layer 3 header, and source
and destination MAC addresses in the Layer 2 header. If you think about it, all this information
is available to the end client except for the destination MAC address. Address Resolution
Protocol (ARP) has been introduced to resolve a MAC address based on a given IP address in a
local network.
Practical – 9
Capture Data Packets in Wireshark tool Using “Ethernet” Protocol
In Wireshark, Ethernet filters can be quite specific and useful for analyzing network traffic at the
data link layer. Here’s a list of some commonly used Ethernet filter commands and their
descriptions:
Basic Ethernet Filter Commands
1. Filter All Ethernet Traffic:
eth
This filter captures all Ethernet frames.
eth.src == aa:bb:cc:dd:ee:ff
Replace aa:bb:cc:dd:ee:ff with the MAC address you're interested in.
eth.dst == aa:bb:cc:dd:ee:ff
Replace aa:bb:cc:dd:ee:ff with the MAC address you're interested in.
eth.type == 0x0800
o ARP:
eth.type == 0x0806
o IPv6:
eth.type == 0x86dd
o VLAN:
eth.type == 0x8100
Practicals of CNAM Subject List
vlan
vlan.id == 100
6. Filter by Ethernet Length Field (useful for detecting abnormal frame sizes):
eth.len == 64
Replace 64 with the frame length you're interested in.
Combining Filters
You can combine Ethernet filters with other protocol filters using logical operators. For example:
Filter Ethernet traffic from a specific MAC address that is also IPv4:
Filter Ethernet frames with VLAN tags and specific VLAN ID:
Filter all Ethernet traffic except traffic from a specific MAC address:
These filters will help you narrow down the Ethernet traffic in your capture to find the specific
frames or types of traffic you're interested in.
Practicals of CNAM Subject List
Practical – 10
Capture Data Packets Using Wireshark Tool and Analyze data using “ICMP” Protocol.
Ans:- Here are some easy and basic ICMP protocol filter commands for Wireshark:
icmp
icmp.type == 8
icmp.type == 0
icmp.type == 3
ICMPv6 Filters:
icmpv6
icmpv6.type == 128
icmpv6.type == 129
Practicals of CNAM Subject List
icmpv6.type == 135
icmpv6.type == 136
-----------------------------------------------------------------------