Ism3 Draft
Ism3 Draft
a. Start Wireshark and look at the upper pane. What "Protocol" and "info" are shown for the very first packet that it
reports? Do you think this was caused by your use of the web browser? Why or why not?’
PROTOCOL: TLSv1.2
Yes, it was caused by the use of web browser as google chrome was up and running in background
b. List up to 5 different protocols that appear in the protocol column in the unfiltered packet-listing window of the
lab activities
c. How long did it take from when the HTTP GET message was sent until the HTTP OK reply was received? (By default,
the value of the Time column in the packet- listing window is the amount of time, in seconds, since Wireshark tracing
began. To display the Time field in time-of-day format, select the Wireshark View pull down menu, then select Time
Display Format, then select Time-of-day.)
According to the screenshot, the time interval between the HTTP GET message and HTTP OK message is16.882119s -
16.881203s = 0.000916s
18BCE2188 JAESON KARTER JOSEPH 29/03/2021
d. In Wire shark If a packet is highlighted by black, what does it mean for the packet?
black identifies packets with errors—for example, they could have been delivered out of order.
e. In Wire shark What is the filter command for listing all outgoing http traffic?
http
f. In Wire shark Why does DNS use Follow UDP Stream while HTTP use Follow TCP Stream?
UDP is much faster when compared to TCP. TCP is slow as it uses 3-way handshake.
DNS requests are generally very small and they fit well within UDP segments.
UDP is not reliable, but reliability can be added to the application layer. An application can
use UDP can be made reliable by using the timeout and resend at the application layer.
g. How long did it take from when the HTTP GET message was sent until the HTTP Acknowledgement / OK reply was
received?
According to the screenshot, the time interval between the HTTP GET message and HTTP OK message is16.882119s -
16.881203s = 0.000916s
18BCE2188 JAESON KARTER JOSEPH 29/03/2021
h. Which filter is used in Wireshark for capturing a specific type of traffic?
To filter traffic from any specific IP address type: ip.addr == 'xxx.xx.xx.xx' in the Apply a display filter field.
To filter traffic for specific protocol say TCP, UDP, SMTP, ARP, DNS Requests etc just type the protocol name in the
Apply a display filter field.
Wireshark has two filtering languages: capture filters and display filters. Capture filters are used for
filtering when capturing packets Display filters are used for filtering which packets are displayed
and are discussed below.
Display filters allow you to concentrate on the packets you are interested in while hiding the
currently uninteresting ones. They allow you to only display packets based on:
Protocol
The presence of a field
The values of fields
A comparison between fields
To only display packets containing a particular protocol, type the protocol name in the display filter
toolbar of the Wireshark window and press enter to apply the filter.
i. Which filter is used in wireshark for capturing all type of traffic content.?
2. Do the following steps for capturing the information and answer the following questions.
Write a Python program to extract the following details from wireshark pcap file
a. No of ARP Request.
b. No of TCP SYN
c. No of UDP request
d. No of IPV4 request
18BCE2188 JAESON KARTER JOSEPH 29/03/2021
e. No of IPV6 request
Or
import dpkt
import datetime
import socket
from dpkt.compat import compat_ord
def mac_addr(address):
"""Convert a MAC address to a readable/printable string
Args:
18BCE2188 JAESON KARTER JOSEPH 29/03/2021
address (str): a MAC address in hex form (e.g. '\x01\x02\x03\x04\x05\x06')
Returns:
str: Printable/readable MAC address
"""
return ':'.join('%02x' % compat_ord(b) for b in address)
def inet_to_str(inet):
"""Convert inet object to a string
Args:
inet (inet struct): inet network address
Returns:
str: Printable/readable IP address
"""
# First try ipv4 and then ipv6
try:
return socket.inet_ntop(socket.AF_INET, inet)
except ValueError:
return socket.inet_ntop(socket.AF_INET6, inet)
def print_packets(pcap):
"""Print out information about each packet in a pcap
Args:
pcap: dpkt pcap reader object (dpkt.pcap.Reader)
"""
# For each packet in the pcap process the contents
for timestamp, buf in pcap:
# Now unpack the data within the Ethernet frame (the IP packet)
# Pulling out src, dst, length, fragment info, TTL, and Protocol
ip = eth.data
# Pull out fragment information (flags and offset all packed into off field, so use bitmasks)
def test():
"""Open up a test pcap file and print out the packets"""
with open('LAB3.pcap', 'rb') as f:
pcap = dpkt.pcap.Reader(f)
print_packets(pcap)
if __name__ == '__main__':
test()