Investigating and Mitigating Man-in the-Middle (MITM) Attacks on a Simulated IoT Network Using MQTT
Abstract
As the Internet of Things (IoT) grows very fast, it relies heavily on the Message
Queuing Telemetry Transport (MQTT) protocol for efficient communication.
However, because it sends data in plain text by default, it is easy for hackers to
attack the network. This paper looks at how a Man-in-the-Middle (MITM) attack
affects a simulated MQTT-based IoT setup and tests how well different security
steps work to block it.We built a controlled virtual environment using VirtualBox
with three parts: Ubuntu (acting as the MQTT Broker/Publisher), Windows 11
(acting as the Subscriber using Paho MQTT), and Kali Linux (acting as the
Attacker). We intercepted the network traffic using Ettercap for ARP spoofing,
along with Wireshark and tcpdump to capture data packets. In the first test
without any security, the attacker easily read the plain text data (temperature
sensor readings) and changed the messages on the fly without the system
noticing.To fix these problems, we added a flexible security setup to the
Mosquitto broker. We enabled Transport Layer Security (TLS 1.2) encryption,
Certificate Authority (CA) verification, and password-based login for clients.The
test results showed that before securing it, normal MQTT had very weak security,
even though it was fast. But after turning on TLS on port 8883 with user
passwords, all the data was fully encrypted. This completely stopped hackers
from reading the packets, changing the messages, or logging into the broker
without permission. Our final comparison proves that mixing TLS encryption,
digital certificates, and simple passwords gives a very high level of security. It
successfully protects the data, keeps it accurate, and stops MITM attacks in IoT
systems. Overall, this study offers a simple, practical framework that you can
easily use to secure low-power IoT devices.
Collections
- 2026-2030 [51]