Lab 3 - Student
Lab 3 - Student
Objectives In this practical you will use Wireshark to capture and inspect
network traffic. You will also apply UNIX file permissions using the
command line.
CLO: 2
Duration: 60+ min
Requirements Lab PC
Kali Linux (installed)
Lab Files: VM XP Professional.zip
About Wireshark Wireshark is a network protocol analyzer. It lets you see what's
happening on your network at a microscopic level.
others http://www.wireshark.org
Student Notes
2 | Intrusion Detection | Lab Instructor Manual | Dr. Samer Aoudi | Updated September
2018
Task 1: Capture Network Traffic (Wireshark)
Task Objectives
You will capture network traffic using Wireshark
Wireshark
1. Go to Kali and from the Applications menu select 09 - Sniffing & Spoofing
Wireshark
Wireshark can capture network traffic (i.e. packets) going into and out of your
computer through one of its network interfaces (e.g. NIC or Wireless NIC). When
you start a
network traffic capture, you must tell Wireshark what interface to listen to.
3. Before we select the network interface, let’s get the name. Open a terminal
window and run the ifconfig command (notice the eth0)
Notice the IP address of the Google server (216.58.207.14 in the screenshot above)
We already captured PING (or ICMP) traffic. Let’s capture web (or
HTTP/HTTPS) traffic:
12. Back to Wireshark and start capturing traffic again
13. Start the web browser and type the following address: google.com
14. After the webpage loads, close the browser and go back to Wireshark
Wireshark now captured the web communication that went through your VM’s eth0
interface
15. Stop the capture using the stop button
16. Save the capture file as web on the Desktop
What is the extension .pcapng
of a Wireshark capture
file?
Wireshark Packet Output Interface
Wireshark Panes:
When you Wireshark captures network traffic, it displays results (output) in 3
panes:
1. The packet list pane
The upper pane displays the packet in order by their number;
you can also see the source and destination IP address as well
as the protocol and length.
2. The packet details pane
This middle pane shows the protocols and protocol fields of
the packet selected in the "Packet List" pane. The protocols
and fields of the packet are displayed using a tree, which
can be expanded and collapsed.
3. The packet bytes pane
This lower pane shows the data of the current packet (selected
in the "Packet List" pane) in a hexdump style
17. When you select a packet/frame in the Packet List pane, you will get its
details in the Details pane. Select few packets and check out the information
about them
What is the total
Number 20
of Packets captured in
ping.pcapng?
What is the total
Number 1163
of Packets captured in
web.pcapng?
18. Open the ping.pcapng file and sort the results by protocol
What is the total 18
Number
of ICMP packets?
What is the IP address
of 172.217.19.174
google.com?
How did you get the By looking in to the destination IP Address
answer for the question
above?
Filter:
Wireshark may capture thousands of packets which makes it difficult to locate
what you’re looking for unless you can sort and filter.
Wireshark provides a powerful filter tool readily available above your
packet list
pane.
Notice the status bar at the bottom (your number may vary). In the
screenshot below, 10 ICMP packets are displayed out of 29 total (after
applying the filter)
How can you clear a By clicking on the “X” Butten at the end of the
filter? search bare.
The communication that took place between your web browser and the Google
web server is HTTP traffic via port 80 (or maybe HTTPS via port 443).
However, before HTTP traffic, your computer and the server had a 3-way TCP
handshake.
Wireshark’s Packet Details pane organizes information about each packet based on
the different TCP/IP layers:
Layer 2 Datalink:
Layer 3 Internet:
Layer 4 transport:
Can you find TCP flags in No there are no flags in this packet because UDP
this packet? Why or Is a connection less protocol.
why not?
4. Scroll down the field name and expand IPv4 –Internet Protocol Version 4 field group
5. Select the first field ip.addr
6. In the Relation list, select ==
7. Type the IP address as shown below and click OK
Expression Builder
8. In the Filter bar, click apply button to apply the IP filter you created
9. Notice that only 34 packets are now displayed (from a total of 43)
UNIX Permissions:
The first part (- or d) states whether it’s a file or a directory (folder). After
that there are three categories (user/group/other). For each category,
there are three permission types: read (r), write (w), and execute (x). If
one is not set, there will be hyphen (-).
Example:
Display Permissions:
1. With Kali running, right-click the capture1.pcap file and click Properties then
select the Permissions tab
3. Write down the full permission for this file as one block (e.g. drwxrwxrwx)
Full Permissions 777
Full Permissions (Octal) 111111111
7. This will open the text editor. Type some content and save the file on the Desktop as
Permissions1
Ensure that you are in the Desktop folder (if not, use the cd
command). Example: cd Desktop
Q: How would you find out more information about the ls command
and it’s options?
A: Using the man pages (man ls)
10. Write down the full permissions for the following:
Text Binary Octal
. rwxr-xr-x 755 111 101 101
.. rwxr-xr-x 755 111 101 101
Permissions1 rw-r--r-- 644 110 100 100
Change Permissions:
chmod:
The chmod utility changes the file mode bits for a specified file or folder
(i.e. it is used to change permissions). We can use in text mode or in octal
mode. For this activity, we will use octal mode in this format:
chmod [option] octal-mode file-name
Example:
11. Change the permissions for the Permissions1 file to rwxrw-r-- (using octal
mode and displaying changes)
What is rwxrw-r-- in 111 110 100
octal?
The write the chmod 764 Permissions1
command to change
the permissions to the
above? (Octal Mode)
12. Change the permissions for the Permissions1 file to r--r--r-- (using octal
mode and displaying changes)
Command (Octal Mode)
chmod 444 Permissions1