In the landscape of defensive security, understanding how an attacker intercepts unencrypted data is a fundamental skill for incident response and network hardening. This lab scenario guides IT students and junior engineers through the process of capturing and analyzing cleartext HTTP traffic using Wireshark within a simulated Man-in-the-Middle (MITM) environment. By observing how credentials and session tokens are exposed in plain text, you will gain practical insight into the necessity of TLS/SSL encryption and learn how to identify suspicious network behavior before it leads to a breach.
Prerequisites and Environment Setup
Before initiating any packet capture, ensure your environment is safe and isolated. This lab requires a Linux-based virtual machine (such as Kali Linux or Parrot Security OS) with Wireshark and the ettercap utility installed. You must have a vulnerable web server running locally or on a separate VM that serves cleartext HTTP content (port 80).
Important Safety Warning: Never perform MITM attacks on live networks without explicit written authorization. The techniques described here are for educational purposes, authorized penetration testing, and defensive security training only. Always operate in an isolated lab environment to prevent accidental disruption of production services.
To simulate a MITM attack, we will use ettercap, a powerful tool often used by both attackers and defenders to manipulate network traffic. We will configure it to perform ARP poisoning, redirecting traffic from your browser to a local mirror server that logs the cleartext data.
Step-by-Step Traffic Capture Configuration
The first phase involves setting up the network topology and initiating the packet capture. Follow these numbered steps to replicate the attack vector in a controlled setting.
- Identify Network Interfaces: Open a terminal and list your active network interfaces using the command
ip addr. Note the interface name (e.g.,eth0orwlan0) that connects to your lab network segment. - Start Wireshark Capture: Launch Wireshark and select your active interface. Click “Capture Options” to ensure you are capturing only TCP port 80 traffic if desired, though capturing all traffic is recommended for full analysis. Start the capture immediately before triggering any web activity.
- Configure the MITM Tool: In the terminal, run
ettercap -T. This launches Ettercap in text mode. Enter your victim IP address (your browser’s IP) and the gateway IP address. Select “ARP poisoning” as the attack type. - Redirect Traffic to a Logger: Configure Ettercap to redirect HTTP traffic to a local log file or a mirror server running on port 8080. This ensures that even if you analyze Wireshark, you have a dedicated log stream for correlation.
Analyzing Cleartext HTTP Payloads
Once the MITM bridge is active and your browser navigates to the vulnerable web server (e.g., http://192.168.1.50/login), Wireshark will begin populating with packets. Stop the capture after a few seconds of interaction.
In Wireshark, apply a display filter to isolate the cleartext traffic:
tcp.port == 80 && http.request.method == "GET"
Expand the HTTP packet details in the right-hand pane. You will notice that fields such as User-Agent, Referer, and form submissions appear in the “Packet Bytes” or “Follow TCP Stream” view without encryption. If the web application uses a login form over HTTP, you may see usernames and passwords transmitted as readable ASCII characters.
Illustrative Output Example
When following the TCP stream of a login request, the payload might look like this:
GET /login.php?username=admin&password=secret123 HTTP/1.1
Host: vulnerable-server.local
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
Content-Type: application/x-www-form-urlencoded
In a cleartext scenario, the credentials admin and secret123 are visible directly in the packet data. In a properly secured HTTPS environment, this data would be encrypted within the TLS record layer, making it unreadable without the session keys.
Verification and Log Correlation
To verify the effectiveness of your capture and analysis, cross-reference the Wireshark findings with the logs generated by the MITM proxy or Ettercap. Open the log file created during the redirection phase. You should find a timestamped record matching the exact URL and payload seen in Wireshark.
This correlation step is crucial for incident response. In a real-world breach investigation, defenders often have to piece together fragmented logs from firewalls, proxies, and endpoint sensors. By confirming that the MITM tool successfully logged the traffic, you validate that your monitoring systems would have detected the interception event.
Common Errors and Mitigation Strategies
During this lab, several common errors may occur. Understanding these helps in troubleshooting real-world scenarios where tools fail or produce false positives.
- Error: ARP Poisoning Fails: If Ettercap cannot redirect traffic, check your network switch configuration. Managed switches often have dynamic ARP inspection (DAI) enabled, which blocks spoofed ARP replies.
- Fix: Ensure you are on a flat network segment without DAI or implement the bypass commands specific to your switch vendor if authorized for testing.
- Error: Wireshark Misses Packets: If packets appear in the capture but not in the filtered view, ensure your filter syntax is correct. Also, verify that “Follow TCP Stream” is enabled on the packet details pane to see the reconstructed conversation.
- Error: Browser Security Warnings: Modern browsers may block connections if they detect a MITM proxy without valid certificates. Since we are using cleartext HTTP here, these warnings might not appear, but in mixed environments, users often ignore certificate errors, leading to exposure.
Student Practice Task and Industry Application
For students, the assignment is to capture traffic from a public Wi-Fi hotspot simulation (using airmon-ng and a fake AP) and analyze a simple HTTP site for data leakage. For industry practitioners, this skill applies to securing IoT devices that lack TLS support or auditing legacy systems that still run on HTTP.
In both cases, the goal is to identify where cleartext traffic exists in the network architecture. Once identified, the remediation step is mandatory: enforce HTTPS with valid certificates, implement HSTS (HTTP Strict Transport Security) headers, and deploy WAFs (Web Application Firewalls) to detect and block MITM attempts.
Conclusion
This lab demonstrates that cleartext HTTP traffic is an open book for anyone positioned between the client and the server. By mastering Wireshark analysis in a simulated MITM environment, defenders can better understand the mechanics of data interception. The key takeaway is that relying on network isolation alone is insufficient; encryption must be enforced at the application layer. Always verify policy terms with authoritative sources regarding acceptable use and ensure that any testing aligns with organizational security policies and local laws.
Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.

