Skip to main content
Ethical Hacking
CHAPTER 12

Wireshark and Network Monitoring Basics

Updated: May 15, 2026
25 min read

# CHAPTER 12

Wireshark and Network Monitoring Basics

1. Introduction

Data does not magically teleport across the internet; it is chopped into tiny pieces called "Packets," fired through cables and routers, and reassembled at the destination. If you want to understand exactly what an application is doing, or if you want to catch a hacker exfiltrating data, you must look at the raw packets. Wireshark is the world's foremost network protocol analyzer. In this chapter, we will learn how to capture network traffic, read the contents of a packet, and understand the devastating reality of unencrypted communication.

2. Learning Objectives

By the end of this chapter, you will be able to:
  • Define Packet Sniffing and Network Protocol Analysis.
  • Understand the basic interface and function of Wireshark.
  • Filter network traffic to isolate specific conversations.
  • Analyze the contents of an unencrypted HTTP packet.
  • Understand why network monitoring is a core defensive capability.

3. Beginner-Friendly Explanation

Imagine standing in a transparent post office.
  • People are constantly handing letters to the postmaster.
  • Some letters are sealed in thick metal envelopes (HTTPS/Encrypted). You can see *who* is sending them, but you can't read the letter.
  • Some letters are written on transparent glass (HTTP/Unencrypted). You can read every single word, including passwords and bank balances, just by looking at them as they pass by.
  • Wireshark is a high-speed camera that takes a photograph of every single letter that passes through the post office, allowing you to pause time and read them all at your own pace.

4. The Concept of Packet Sniffing

When your computer connects to a network (like a Wi-Fi router), it usually ignores all traffic that isn't addressed to its specific IP address. Packet sniffers (like Wireshark) place your network card into Promiscuous Mode. In this mode, your computer aggressively reads *every single packet* flying through the air or across the local network switch, regardless of who it is addressed to.

5. Introducing Wireshark

Wireshark is pre-installed on Kali Linux. When you open it, you select a network interface (e.g., eth0 for wired, wlan0 for wireless). It instantly begins capturing thousands of packets per second. The interface is split into three main panes:
  1. 1. Packet List: A summary of every packet (Time, Source IP, Destination IP, Protocol).
  1. 2. Packet Details: A deep dive into a selected packet, breaking it down by OSI Model layers (Ethernet, IP, TCP, HTTP).
  1. 3. Packet Bytes: The raw hexadecimal and ASCII data of the packet.

6. The Power of Display Filters

Because Wireshark captures thousands of packets, finding the one you want is like finding a needle in a haystack. Display Filters are your most powerful tool.
  • http: Only shows unencrypted web traffic.
  • ip.addr == 192.168.1.50: Only shows traffic sent to or from that specific IP.
  • tcp.port == 22: Only shows SSH traffic.

7. Mini Project: Analyze Local Network Packets

Let's see why HTTP is dangerous.

Step-by-Step Overview: *(Assumption: You are running Wireshark on your Kali VM).*

  1. 1. Open Wireshark and double-click eth0 to start capturing.
  1. 2. Open a web browser inside Kali and navigate to a known HTTP (unencrypted) testing site, like http://testphp.vulnweb.com/login.php.
  1. 3. Type a fake username (Alice) and password (SuperSecret123) and click Login.
  1. 4. Go back to Wireshark and click the red "Stop" square.
  1. 5. In the Display Filter bar at the top, type http.request.method == POST and press Enter.
  1. 6. Find the packet that says POST /login.php. Right-click it, select Follow -> HTTP Stream.
  1. 7. *The Result:* A new window opens showing the exact text sent over the wire. You will clearly see uname=Alice&pass=SuperSecret123 in plain text! If a hacker was sniffing your network, they just stole your password.

8. Real-World Scenarios

A company notices their internet is unusually slow at 2:00 AM every night. The firewall logs show a massive amount of data leaving the network, but the logs don't say *what* the data is. A Security Operations Center (SOC) analyst runs a packet capture (PCAP) using Wireshark. By analyzing the packet details, they discover that an internal server has been compromised and is utilizing the FTP protocol to upload gigabytes of sensitive customer databases to an unknown IP address in Eastern Europe. The analyst immediately isolates the server.

9. Best Practices

  • PCAP Storage: Network monitoring generates massive amounts of data. Enterprises use dedicated appliances to capture and store PCAP (Packet Capture) files for 30 to 90 days. If a breach is discovered today, investigators can load last month's PCAP files into Wireshark to perform digital forensics and see exactly how the hacker got in.
Wiretapping Laws. Using Wireshark to capture network traffic on a network you do not own (like a public coffee shop, a university, or your workplace) is illegal and constitutes wiretapping. You must only capture traffic on your own home network or inside your isolated VirtualBox lab environment.

11. Exercises

  1. 1. Define "Promiscuous Mode" and explain its necessity when performing network packet capture.
  1. 2. Describe the difference between the information visible in a captured HTTP packet versus a captured HTTPS packet.

12. FAQs

Q: Can Wireshark decrypt HTTPS traffic? A: Generally, no. HTTPS (TLS encryption) is designed specifically to defeat packet sniffers. Wireshark will capture the packet, but the payload will be unreadable cryptographic gibberish. The only way Wireshark can decrypt it is if you explicitly provide it with the server's private RSA encryption keys, which a hacker generally won't have.

13. Interview Questions

  • Q: A user is complaining about intermittent connectivity issues to an internal application. Detail how you would utilize Wireshark and display filters to isolate the user's traffic and identify potential TCP retransmissions or latency bottlenecks.
  • Q: Explain the concept of the OSI Model as it relates to analyzing a packet within the Wireshark "Packet Details" pane.

14. Summary

In Chapter 12, we obtained x-ray vision into our network. We learned that data transmission is not magic; it is the physical movement of packets. We utilized Wireshark to capture and dissect these packets, demonstrating the catastrophic vulnerability of unencrypted HTTP communication. We established that packet analysis is not just an offensive tool for stealing passwords, but a critical defensive mechanism for diagnosing network anomalies and performing digital forensics after a breach.

15. Next Chapter Recommendation

We understand wired network traffic. But what about the traffic flying invisibly through the air? Proceed to Chapter 13: Wireless Network Security Fundamentals.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·