Lab1 Instruction
Lab1 Instruction
Lab1 Instruction
- Application Layer: The application layer includes the protocols used by most
applications for providing user services. Examples of application layer protocols
are Hypertext Transfer Protocol (HTTP), Secure Shell (SSH), File Transfer
Protocol (FTP), and Simple Mail Transfer Protocol (SMTP).
Packet Sniffer
Packet sniffer is a basic tool for observing network packet exchanges in a computer. As
the name suggests, a packet sniffer captures (“sniffs”) packets being sent/received
from/by your computer; it will also typically store and/or display the contents of the various
protocol fields in these captured packets. A packet sniffer itself is passive. It observes
messages being sent and received by applications and protocols running on your
computer, but never sends packets itself.
Figure 3 shows the structure of a packet sniffer. At the right of Figure 3 are the protocols
(in this case, Internet protocols) and applications (such as a web browser or ftp client)
that normally run on your computer. The packet sniffer, shown within the dashed
rectangle in Figure 3 is an addition to the usual software in your computer, and consists
of two parts. The packet capture library receives a copy of every link-layer frame that is
sent from or received by your computer. Messages exchanged by higher layer protocols
such as HTTP, FTP, TCP, UDP, DNS, or IP all are eventually encapsulated in link-layer
frames that are transmitted over physical media such as an Ethernet cable. In Figure 1,
the assumed physical media is an Ethernet, and so all upper-layer protocols are
eventually encapsulated within an Ethernet frame. Capturing all link-layer frames thus
gives you access to all messages sent/received from/by all protocols and applications
executing in your computer.
The second component of a packet sniffer is the packet analyzer, which displays the
contents of all fields within a protocol message. In order to do so, the packet analyzer
must “understand” the structure of all messages exchanged by protocols. For example,
suppose we are interested in displaying the various fields in messages exchanged by the
HTTP protocol in Figure 3. The packet analyzer understands the format of Ethernet
frames, and so can identify the IP datagram within an Ethernet frame. It also understands
the IP datagram format, so that it can extract the TCP segment within the IP datagram.
Finally, it understands the TCP segment structure, so it can extract the HTTP message
contained in the TCP segment. Finally, it understands the HTTP protocol and so, for
example, knows that the first bytes of an HTTP message will contain the string “GET,”
“POST,” or “HEAD”.
We will be using the Wireshark packet sniffer [http://www.wireshark.org/] for these labs,
allowing us to display the contents of messages being sent/received from/by protocols at
different levels of the protocol stack. (Technically speaking, Wireshark is a packet
analyzer that uses a packet capture library in your computer). Wireshark is a free network
protocol analyzer that runs on Windows, Linux/Unix, and Mac computers.
The Kai Linux has Wireshark installed. You can just launch the Kali Linux VM and open
Wireshark there. Wireshark can also be downloaded from here:
https://www.wireshark.org/download.html
When you run the Wireshark program, the Wireshark graphic user interface will be shown
as Figure 5. Currently, the program is not capturing the packets.
Then, you need to choose an interface. If you are running the Wireshark on your laptop,
you need to select WiFi interface. If you are at a desktop, you need to select the Ethernet
interface being used. Note that there could be multiple interfaces. In general, you can
select any interface but that does not mean that traffic will flow through that interface. The
After downloading and installing Wireshark, you can launch it and click the name of an
interface under Interface List to start capturing packets on that interface. For example, if
you want to capture traffic on the wireless network, click your wireless interface.
Test Run
Do the following steps:
1. Start up the Wireshark program (select an interface and press start to capture
packets).
2. Start up your favorite browser (ceweasel in Kali Linux).
3. In your browser, go to Wayne State homepage by typing www.wayne.edu.
4. After your browser has displayed the http://www.wayne.edu page, stop Wireshark
packet capture by selecting stop in the Wireshark capture window. This will cause
the Wireshark capture window to disappear and the main Wireshark window to
display all packets captured since you began packet capture see image below:
Notice that we now view only the packets that are of protocol HTTP. However, we also
still do not have the exact communication we want to focus on because using HTTP as a
filter is not descriptive enough to allow us to find our connection to http://www.wayne.edu.
We need to be more precise if we want to capture the correct set of packets.
8. Now, we can try another protocol. Let’s use Domain Name System (DNS) protocol
as an example here.
Click on Follow UDP Stream, and then you will see following screen.
There is a FTP server installed on the Kali Linux VM. You need to use a terminal
to log into the server and use Wireshark to capture the password. The username
for the FTP server is csc5991-student, and the password is [WSU-csc5991.]
without the brackets. You will user the username and password to login the FTP
server while Wireshark is running. Note that the FTP server is installed on the
localhost, make sure you select the right interface for the capturing. You need to
explain to me how you find the password and a screenshot of the password
packet. Have fun!