Skip to content

iotsrg/mqtt-ust

Repository files navigation

MQTT Mayhem: Publish & Pwn [DIY Labs]

Exploiting and Securing MQTT in IoT Environments


Overview

Target Audience: IoT Pentesters, Firmware Developers, Embedded Security Engineers
Goal: Demonstrate practical MQTT misconfigurations, vulnerabilities, and defenses through real-world demos using ESP32 and MQTT broker setup.


Lab Setup

Required Tools:

  • MQTT Broker
  • MQTT clients and visualizers
  • MQTT pentest tools (MQTT-Fuzz - FUME)
  • ESP32 development board (acting as a vulnerable MQTT client)
  • Raspberrypi (acts as MQTT Broker)

Steps

Steps to setup MQTT Client [ESP32]:


Steps to setup MQTT Broker [Rpi]:


MQTT Protocol Deep Dive (Good to know before pentesting/Labs)

  • Cover the MQTT architecture: clients, broker, topics, sessions
  • Explore the publish/subscribe model
  • Explore QoS levels, retained messages, wildcard subscriptions
  • Identify common areas where MQTT implementations go wrong

Setup

  • Start the broker and connect it to the ESP32 client
  • Setup topic subscriptions and sensor/actuator emulation
  • Confirm working communication flow between ESP32 and broker

MQTT Vulnerabilities [included in labs]

Anonymous Access

  • Demonstrate how brokers without authentication can be freely accessed by attackers

Retained Message Injection

  • Show how attackers can persistently inject payloads that execute every time a client reconnects

Topic Flooding Attack

  • Simulate excessive topic creation or publish actions to overload the broker or client

Rogue Broker Injection

  • Redirect a client (e.g., ESP32) to a malicious broker that can spoof responses or inject commands

Client Behavior Hijack

  • Publish malicious commands to subscribed topics to control or crash the target device

Ready for labs?

Case Study - CVE-2021-34432


Best Practices:


What-Next? - BonusPoints

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors