Introduction to Wireshark

Wireshark is the world’s foremost and widely-used network protocol analyzer. It lets you see what’s happening on your network at a microscopic level and is the de facto (and often de jure) standard across many commercial and non-profit enterprises, government agencies, and educational institutions. Wireshark development thrives thanks to the volunteer contributions of networking experts around the globe and is the continuation of a project started by Gerald Combs in 1998.

1. Install Wireshark:

wilp-assignment-wireshark-1

wilp-assignment-wireshark-2

2. Run Wireshark

wilp-assignment-wireshark-3

wilp-assignment-wireshark-4

3. Capture-> Interfaces
a. How many interfaces does your system have?
This System has Nine Interfaces:

wilp-assignment-wireshark-5

b. Identify the IP address of “lo” interface.
The IP address of “lo” interface is: 127.0.0.1

wilp-assignment-wireshark-6

4. Go to Capture->Options menu.
a. Check “eth0” interface and uncheck all other interfaces:

wilp-assignment-wireshark-7

b. Uncheck “Use promiscuous mode on all interfaces”:

wilp-assignment-wireshark-8

wilp-assignment-wireshark-9

5. Do packet capturing by clicking Capture->Start button. Now, the captured packets are shown in the center window. Browse one or more websites. After a while (15 to 20 seconds), stop capturing (Capture->Stop button).

wilp-assignment-wireshark-10

wilp-assignment-wireshark-11

wilp-assignment-wireshark-12

wilp-assignment-wireshark-13

a. What is promiscuous mode of operation?
In a network, promiscuous mode allows a network device to intercept and read each network packet that arrives in its entirety. This mode of operation is sometimes given to a network snoop server that captures and saves all packets for analysis (for example, for monitoring network usage).

In an Ethernet local area network (LAN), promiscuous mode is a mode of operation in which every data packet transmitted can be received and read by a network adapter. Promiscuous mode is often used to monitor network activity.

b. There are several protocol packets captured by your system. Write down the names of five of them?

i. DNS – Domain Name System
ii. TCP – Transmission Control Protocol
iii. HTTP – Hypertext Transfer Protocol
iv. TLSv1.2 – Transport Layer Security Version 1.2
v. OCSP – Online Certificate Status Protocol

6. Filters – There are display filters and capture filters. Display filters can be used on already captured packets. Specify any one of the following items in the display filter and press “Apply”.
a. TCP:

wilp-assignment-wireshark-14

Observations: Only the packets related to TCP and associated protocols are displayed. Other packets are hidden. Such as TCP, HTTP, TLSV1.2, OCSP.

b. UDP:

wilp-assignment-wireshark-15

Observations: Only the packets related to UDP protocols are displayed. Other packets are hidden such as DNS. The packets are filtered in display only, all the packets captured are still present.

7. Capture filters is used to restrict the type of packets to capture. Capture filters can be specified in Capture->Options by typing in “Capture Filter” textbox. For each of the following filters, type them in the text space for Capture Filter and start a new capture. Note your observation.
a. tcp:

wilp-assignment-wireshark-16

Observations: Only Packets that use underlying TCP protocol are captured:

wilp-assignment-wireshark-17

b. udp

wilp-assignment-wireshark-18

Observations: Only Packets that use underlying UDP protocol are captured:

wilp-assignment-wireshark-19

c. tcp port 22

wilp-assignment-wireshark-20

Observations: No Packets are captured (port 22 is for SSH and it’s not used in this case.):

wilp-assignment-wireshark-21

8. Coloring rules – Depending on the protocol (IP, TCP, ARP, etc.) the color of a packet is different. These rules can be changed accordingly (View->Coloring Rules).

wilp-assignment-wireshark-22

wilp-assignment-wireshark-23

9. By observing the packets in Wireshark, identify your own IP address and the IP address of the website you visited:

wilp-assignment-wireshark-24

My Machine IP Address: 10.0.2.15
Yahoo.com’ IP Address: 106.10.178.36

10. Saving the output while capturing: After stopping the capture, do it from File->Save As:

wilp-assignment-wireshark-25

a. Close the file and try to open the pcap file in Wireshark:

wilp-assignment-wireshark-26

wilp-assignment-wireshark-27

FILTERS

1. Type the following filter commands in the filter bar and click on “Apply” button. Note your observations.
a. ip.addr == Your IP address

wilp-assignment-wireshark-28

Only the packets which have the ip address = 10.0.2.15 as either source address or destination address only are displayed.
b. ip.src == Your IP address

wilp-assignment-wireshark-29

Only the packets which have the ip address = 10.0.2.15 as source address only are displayed.

c. ip.dst == Your IP address

wilp-assignment-wireshark-30

Only the packets which have the ip address = 10.0.2.15 as destination address only are displayed.
d. dns and http

wilp-assignment-wireshark-31

No packet is captured because each packet has only one associated protocol UDP or TCP. DNS uses UDP whereas HTTP uses TCP.

e. tcp.port == 443

wilp-assignment-wireshark-32

Only packets which have protocol = tcp AND port = 443 associated with them are captured.
f. tcp.analysis.flags

wilp-assignment-wireshark-33

g. !(arp or dns or icmp)

wilp-assignment-wireshark-34

All packets except ARP or DNS or ICMP are displayed.
h. tcp contains facebook

wilp-assignment-wireshark-35

All TCP traffic packets which contains the word “facebook” will be displayed.

i. udp contains facebook

wilp-assignment-wireshark-36

All UDP packets which contains the word “facebook” will be displayed.

j. http.request

wilp-assignment-wireshark-37

All packets from the PC with http request will be displayed.

k. http.response.code == 200

wilp-assignment-wireshark-38

The packets which contains successful request fulfilment by servers but not any content will be displayed.

l. tcp.flags.syn == 1

wilp-assignment-wireshark-39

Displays all TCP packets with SYN flag = true
m. tcp.flags.reset == 1

wilp-assignment-wireshark-40

Displays all TCP packets with RST flag = true.

n. sip && rtp

wilp-assignment-wireshark-41

No packets displayed. As a packet could either be associated with Session Initiation Protocol (SIP) or RTP Real Time Transport Protocol. First session is initiated by SIP then data is transmitted by RTP.

Statistics in Wireshark

1. Start a new capture in Wireshark.

wilp-assignment-wireshark-42

2. Browse a couple of websites.

wilp-assignment-wireshark-43

3. Stop the capture after a while (30 to 40 seconds).

wilp-assignment-wireshark-44

4. Explore Statistics -> Endpoints to identify entities involved in capture.

wilp-assignment-wireshark-45

wilp-assignment-wireshark-46

wilp-assignment-wireshark-47

wilp-assignment-wireshark-48

wilp-assignment-wireshark-49

a. How many ethernet endpoints are visible? Is your PC’s MAC address part of the ethernet endpoints?

Two Ethernet Points are available.
Yes Mac Addresses are part of ethernet end points.

b. How many IP address are visible? Is your PC’s IP address part of the IPv4 endpoints?
There are total 30 IP addresses visible.
Yes my PCs IP Address is part of the IPV4 end points.

5. Explore Statistics->Conversations to cover flows (pair of end points).
a. Sort on different columns in TCP –e.g. Duration, Packets, Address A, Rel Start etc.

wilp-assignment-wireshark-50

wilp-assignment-wireshark-51

wilp-assignment-wireshark-52

wilp-assignment-wireshark-53.png

b. Experiment with “Follow Stream” button on the popup dialog which adds a Display filter.

wilp-assignment-wireshark-54

wilp-assignment-wireshark-55

wilp-assignment-wireshark-56

6. Explore Statistics -> Flow Graph to understand sequence of events for the filtered capture.

wilp-assignment-wireshark-57.png

wilp-assignment-wireshark-58

wilp-assignment-wireshark-59

7. Explore Statistics -> Packet Lengths to get a list of different packet size ranges and its statistics.

wilp-assignment-wireshark-60

8. Explore Statistics -> IO Graph for complete communication, and after filtering for TCP communication.

wilp-assignment-wireshark-61

wilp-assignment-wireshark-62

wilp-assignment-wireshark-63.png

wilp-assignment-wireshark-64.png

wilp-assignment-wireshark-65.png

wilp-assignment-wireshark-66.png

wilp-assignment-wireshark-67.png

wilp-assignment-wireshark-68.png

a. Compare two TCP flows – e.g. stream 6 and 4 below.
b. Observe the time slider below the graph.

wilp-assignment-wireshark-69.png

wilp-assignment-wireshark-70.png

wilp-assignment-wireshark-71.png

wilp-assignment-wireshark-72.png

wilp-assignment-wireshark-73.png

wilp-assignment-wireshark-74.png

Disclaimer: This post may be a solution to an Inter-networking Technologies Assignment. It should only be used as a reference to understand the concepts and apply in your own way to prepare the solutions. Caution: Copy Pasting it as it is may fetch you zero marks.

About Anurag Rajput 10 Articles
Technical Officer

Be the first to comment

Leave a Reply